簡體   English   中英

恢復QML中最小化的無框窗口

[英]Restore minimized frameless window in qml

我有一個默認的main.cpp文件,並在qml文件中寫了一些代碼。 像這樣:

ApplicationWindow {
id: mainWindow

width: 640
height: 480
color: "white"

visible: true

flags: Qt.FramelessWindowHint

      Rectangle {
            id: minimizeButton

            width: 32
            height: 32

            Rectangle {
                anchors {
                    bottom: parent.bottom
                    left: parent.left
                    right: parent.right
                }

                color: "grey"

                height: 2

                scale: mouse.pressed ? 0.8 : 1.0
                smooth: mouse.pressed
            }

            MouseArea {
                id: mouse
                anchors.fill: parent

                hoverEnabled: true

                onClicked: mainWindow.showMinimized()
            }
        }
}

所以,我的問題是:最小化窗口后如何還原它? 因為Windows中的控制面板上沒有程序。

這可以在我的計算機上正常運行:

flags: Qt.FramelessWindowHint |
       Qt.WindowMinimizeButtonHint |
       Qt.Window

窗口仍然是無框架的,但是任務欄中有應用程序圖標。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM