Results 1 to 2 of 2

Thread: QSystemTrayIcon and Signals

  1. #1
    Join Date
    Aug 2011
    Location
    The Internet
    Posts
    29
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSystemTrayIcon and Signals

    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.
    Qt Code:
    1. connect(showIconCheckBox, SIGNAL(toggled(bool)),trayIcon, SLOT(setVisible(bool)));
    To copy to clipboard, switch view to plain text mode 

    Likewise with this line. What am I going to want in place of iconComboBox? Do I even need anything?
    Qt Code:
    1. connect(iconComboBox, SIGNAL(currentIndexChanged(int)),this, SLOT(setIcon(int)));
    To copy to clipboard, switch view to plain text mode 

    Thanks again!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSystemTrayIcon and Signals

    You don't need any of those connections. If you want the tray icon to be visible then call setIcon() and show().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 6
    Last Post: 29th April 2011, 15:22
  2. Replies: 1
    Last Post: 24th October 2010, 11:09
  3. QSystemTrayIcon help
    By SkylineBob in forum Qt Programming
    Replies: 2
    Last Post: 13th January 2010, 17:22
  4. QSystemTrayIcon does not scale on X11
    By bleucanard in forum Qt Programming
    Replies: 0
    Last Post: 3rd March 2008, 09:35
  5. QThread and signals (linux/UNIX signals not Qt Signals)
    By Micawber in forum Qt Programming
    Replies: 1
    Last Post: 28th November 2007, 22:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.