title: Qt Minimized Taskbar Icon Mouse Event
body: <p>I've tried virtually every way possible to hook the activated() signal of a taskbar icon to a corresponding slot. However, I do not understand why Qt(Qt5 Cretor) says I don't have a matching function for the slot. </p>
  
  <blockquote>
    <p><strong>Qt Error:</strong></p>
    
    <p>C:\Users\potato\Desktop\CCT-master\CCTracker\cctsystemtray.cpp:40:
    error: no matching function for call to
    'QObject::connect(QSystemTrayIcon*&amp;, const char*, CCTSystemTray*
    const, const char*)'this,
    SLOT(systrayActivated(QSystemTrayIcon::ActivationReason)))</p>
  </blockquote>
  
  <p>As far as I can tell, according to <a href="http://qt-project.org/doc/qt-5/qsystemtrayicon.html#activated" rel="nofollow">Qt Documentation</a>, </p>
  
  <p>The activated() signal is used to catch mouse events such as clicks and double clicks for the taskbar icon. At first try I thought it's only signals and slots, but then for whatever reason activated() just won't fit. And If I try connecting activated() to a slot from another class, everything fails due to pointer errors. </p>
  
  <p>Here's are the working parts inside <strong>CCTSystemTray.h</strong>:</p>
  
  <pre><code>class CCTSystemTray
  {
  public:
      CCTSystemTray();
      void initSystemTray(QWidget *rootWindow);
  private:
      QSystemTrayIcon* systray;
  
  public slots:
      void systrayActivated(QSystemTrayIcon::ActivationReason);
  };
  </code></pre>
  
  <p>And <strong>CCTSystemTray.cpp</strong>:</p>
  
  <pre><code>// Above are Class declearations, menu items, etc...
  
  QObject::connect(this-&gt;systray, SIGNAL(QSystemTrayIcon::activated(QSystemTrayIcon::ActivationReason reason)),
          this, SLOT(systrayActivated(QSystemTrayIcon::ActivationReason)));
  }
  
  void CCTSystemTray::systrayActivated(QSystemTrayIcon::ActivationReason)
  {
      qDebug() &lt;&lt; "Hello";
  }
  </code></pre>
  
  <p>The full code sample can be found <a href="http://pastebin.com/BRcrgrb4" rel="nofollow">here</a> on <a href="http://pastebin.com/BRcrgrb4" rel="nofollow">pastebin</a>. </p>
  
  <p>If someone can help me out from hair-pulling, that'd be great! </p>
  
  <p>Thank you all. </p>