Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-7386

CLONE -QMenu exec()'ed on QSystemTrayIcon::Trigger won't disappear (Windows-only)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.7.0
    • 4.6.0
    • None
    • Win XP
    • af7d2b2127dadbdf828c60c75255bb1b4f591651

      To reproduce, replace the Window::iconActivated() function in the desktop/systray Qt example with the following code:

      ////////////////////////////////////////////////
      void Window::iconActivated(QSystemTrayIcon::ActivationReason reason)
      {
          switch (reason)
          {
              case QSystemTrayIcon::Trigger:
              {
                  QMenu menu;
                  menu.addAction("Test");
                  menu.exec(QCursor::pos());
              }
                  break;
              case QSystemTrayIcon::DoubleClick:
                  iconComboBox->setCurrentIndex((iconComboBox->currentIndex() + 1)
                                                % iconComboBox->count());
                  break;
              case QSystemTrayIcon::MiddleClick:
                  showMessage();
                  break;
              default:
                  ;
          }
      }
      ////////////////////////////////////////////////
      

      Then left-click on the icon in the system tray. A menu will come up, but clicking anywhere else on the desktop won't make it disappear. Context menus work fine though. This issue happens only on Windows (tested on XP).

        For Gerrit Dashboard: QTBUG-7386
        # Subject Branch Project Status CR V

            bachewii Jens
            carrouf carrouf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes