Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PyQt6: Popup QMainWindow sometimes ignoring ("missing") clicks even if opened and activated
Qt 6.11 is out! See what's new in the release blog

PyQt6: Popup QMainWindow sometimes ignoring ("missing") clicks even if opened and activated

Scheduled Pinned Locked Moved Unsolved Qt for Python
pythonqt for python
1 Posts 1 Posters 57 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 1 Offline
    1 Offline
    1st-alex
    wrote last edited by
    #1

    I’m building a macOS menu bar extra (a.k.a. system tray) app using PyQt6. When clicking the menu bar icon, a popup window appears, which is a QMainWindow with the Qt.WindowType.Popup window flag set.

    I’m noticing sporadic issues where the popup window doesn't respond to clicks even though it's open. Sometimes, clicking on a QPushButton inside the popup, or an action on the QMenu, causes it to close abruptly without the clicked signal being invoked on the button or the triggered action on a menu item (i.e., clicks are sometimes being “missed”). The popup window contains a QTreeWidget which I’ve styled with QSS so that hovering over a QTreeWidgetItem will cause it to be highlighted; sometimes the highlight doesn’t appear, suggesting that the open popup window is ignoring user interaction. Switching between windows from other open applications and then clicking the menu bar icon for my app sometimes causes the issue to occur.

    The issue is reproducible on macOS 15 Sequoia and macOS 26 Tahoe, using a mouse (on a Mac Mini) and a trackpad (on a MacBook Air). I'm using PyQt6 version 6.11.0, and Python 3.14.4. The app is distributed as a PyInstaller build, but I've noticed this issue sometimes occurring on my dev machine, where the app is executed directly from the Python interpreter.

    I tried calling the activateWindow() method on the QMainWindow object for the popup window, as well as calling grabMouse() (and releaseMouse() in the overridden method closeEvent()). I also ensured that the widgets within the popup window have its self object passed to their constructors. But the issue is still occurring.

    What should I be doing to ensure that the popup window is consistently capturing mouse input when it’s opened? What gotchas and caveats that I missed that could be causing this issue?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved