Skip to content

The application does not minimize when you click on its icon in the taskbar using pyqt qml #8

@Jeinerox

Description

@Jeinerox

Describe the bug
Hello! I'm having trouble figuring out why my application isn't minimizing when I use your library. I've noticed that when I combine your library with QQmlApplicationEngine, the application doesn't minimize when I click the icon in the taskbar. This only happens when I use this combination, though, as other PyQt classes work fine.

To Reproduce
Run this code and see if you can minimize the application by using the taskbar icon.

import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQml import QQmlApplicationEngine
import PyTaskbar 

if __name__ == '__main__':
    app = QGuiApplication(sys.argv)
    engine = QQmlApplicationEngine()
    engine.load('interface.qml')
    main_window = engine.rootObjects()[0]
    taskbar_progress = PyTaskbar.Progress(hwnd=int(main_window.winId()))
    taskbar_progress.init()  
    if not engine.rootObjects():
        sys.exit(-1)
    sys.exit(app.exec_())
import QtQuick 2.15
import QtQuick.Controls 2.15
ApplicationWindow {
    visible: true
    width: 400
    height: 300
    title: "Hello World"
    Rectangle {
        anchors.fill: parent
        color: "#ffffff"
        Text {
            text: "Hello, World!"
            anchors.centerIn: parent
            font.pixelSize: 32
            color: "#000000"
        }
    }
}

Expected behavior
The app should minimize when the icon is clicked in the taskbar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions