-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.1
-
None
-
Fedora KDE Spin running in UTM / QEMU, Wayland, all packages updated, PySide6 installed through system [note: have to update all packages after installing pyside6 through system under this distro else it will blackscreen on next boot.]
Using QTimer.SingleShot to read the window state of a window in Qt gets it wrong. PySide6 reproducer:
import sys from PySide6.QtWidgets import QApplication, QWidget from PySide6.QtCore import Qt, QTimer def monitor_and_report(window): state = window.windowState() is_min = window.isMinimized() flag_min = bool(state & Qt.WindowMinimized) print("window.isMinimized():", is_min) print("windowState has Qt.WindowMinimized flag:", flag_min) def main(): app = QApplication(sys.argv) window = QWidget() window.setWindowTitle("Minimized Window + Qt event loop") window.resize(400, 200) window.showMinimized() monitor_and_report(window) QTimer.singleShot(1500, lambda: monitor_and_report(window)) sys.exit(app.exec()) if __name__ == "__main__": main()
gives me both True for the first round and both False for the second one. There is no unminimizing done in the GUI during these two reports.