c++ - Qt QSystemTrayIcon not sending activated signal -


I'm trying to copy the QT cysthere example here:

Things work apart from it QSystemTrayIcon object is not sending active signal.

Here's my main window. CPP code is:

  #include & lt; QtGui & gt; #include "mainwindow.h" #include "ui_mainwindow.h" Main Window :: Main Window (QWidget * Guardian): QMainWindow (Parent), UI (New UI :: MainWondo) {UI- & gt; SetupUi (this); Quimesbox :: Notifications (0, tr ("cystre"), tr ("loaded."); CreateTrayIcon (); Connect (Tray icon, Signal (active (QSystemTrayIcon :: ActivationReason)), this slot (iconActivated (QSystemTrayIcon :: ActivationReason))); TrayIcon-> Show (); } Zero MainWindow :: createTrayIcon () {trayIcon = New QSystemTrayIcon (this); } Zero MainWindow :: iconActivated (QSystemTrayIcon :: ActiveationReason Reason) {QMessageBox :: Notification (0, tr ("Systray"), tr ("test")); } Main Microsoft :: Messequite () {QMessageBox :: information (0, tr ("systray"), tr ("Sorry, I've already done what I can help. \ N" "Maybe you ask a human Should try? "); } Main Window :: ~ MAIN WANDO () {DELETE UI; }  

I am using QT 4.5.2 on Windows XP SP2. Is this a problem with Windows XP? Or am I doing something wrong? I do not have a QiQ set for the tray icon Is this a problem?

Any help would be appreciated.

Thank you! Jaren

Well if anyone is interested, then I got the problem. The problem was actually in the header file.

Here's one that works:

  #ifndef MAINWINDOW_H #Define MAINWINDOW_H #Include & lt; QWidget & gt; # Include & lt; QSystemTrayIcon & gt; Classroom Vessel: Public QWidget {Q_OBJECT Public: Maine Wando (); Private Slots: Zero Icon Active (QSystemTrayIcon :: Activation Reason Cause); Private: Qections * Minimum Action; QAction * Maximum Action; QAction * restoreAction; Qation * Action; QSystemTrayIcon * trayIcon; Creating Null operations (); Zero Beatoreicon (); Zero message (); }; #endif // MAINWINDOW_H  

icon needs to be declared as an active scout I had declared it as a private event.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -