View Full Version : QSystemTrayIcon and Signals

29th August 2011, 06:35
I'm having trouble understanding signals/slots while implementing QSystemTrayIcon. I have been going over the Signal/Slot documentation in Qt Doc as well as a nice example for QSystemTrayIcon available http://doc.qt.nokia.com/4.7/desktop-systray.html. I am creating a simple dialog and want my systemtrayicon to always be visible.

What am I going to want in place of "showIconCheckBox"? I don't need a checkbox because I want my condition to always be true. I understand the rest of the syntax of this line of code except this.

connect(showIconCheckBox, SIGNAL(toggled(bool)),trayIcon, SLOT(setVisible(bool)));

Likewise with this line. What am I going to want in place of iconComboBox? Do I even need anything?

connect(iconComboBox, SIGNAL(currentIndexChanged(int)),this, SLOT(setIcon(int)));

Thanks again!

29th August 2011, 09:40
You don't need any of those connections. If you want the tray icon to be visible then call setIcon() and show().