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

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

    XMLWordPrintable

Details

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

    Description

      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).

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes