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

Qt 5.12-developed tray program on Ubuntu cannot operate normally, mouse click events are disordered

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.12.12
    • Build tools: qmake
    • None
    • 开发环境:qt 5.12.12
      运行环境:ubuntu 18.04
    • Linux/X11
    • Linux/X11

    Description

      A tray application developed with Qt 5.12 exhibits abnormal behavior when running on Ubuntu 18.x (18.04) and Ubuntu 16.x (16.04), with erratic mouse click events.

      Symptoms:
      1) Tray single-click event is unresponsive.
      2) Tray double-click is required to trigger QSystemTrayIcon::trigger.
      3) QSystemTrayIcon::trigger event cannot be triggered.

      The event signal handling code is as follows:

      void SystemTrayIcon::onActivated(QSystemTrayIcon::ActivationReason reason)
      {
      switch (reason) {
      case QSystemTrayIcon::unknown:
      vdi_info("QSystemTrayIcon::Unknown");
      break;
      case QSystemTrayIcon::doubleclick:
      vdi_info("QSystemTrayIcon::DoubleClick");
      emit trigger(DoubleClick);
      break;
      case QSystemTrayIcon::trigger:
      vdi_info("QSystemTrayIcon::Trigger");
      emit trigger(OneClick);
      break;
      case QSystemTrayIcon::context:
      vdi_info("QSystemTrayIcon::Context");
      emit trigger(RightClick);
      break;
      default:
      vdi_info("QSystemTrayIcon::%d", reason);
      break;
      }
      }
      
      connect(m_sysTray, &QSystemTrayIcon::activated, this, &SystemTrayIcon::onActivated);
      

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            gyz chaoxu Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes