Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restore minimized frameless window in qml

Tags:

c++

qt

qml

I have a default main.cpp file and write some code in my qml file. Something like this:

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()
            }
        }
}

So, my question is: how after i have minimized window to restore it? Because there's no programm on control panel in Windows.

like image 200
cyberbudy Avatar asked Dec 04 '25 17:12

cyberbudy


1 Answers

This works properly on my computer:

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

Window is still Frameless but there is app icon in taskbar.

like image 176
Kosovan Avatar answered Dec 06 '25 07:12

Kosovan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!