Results 1 to 3 of 3

Thread: QSystemTrayIcon help

  1. #1
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QSystemTrayIcon help

    Hi, I have 4 different images that are used as tray icons depending on the application state(on,off,starting,stopping). I want to add a ? image on the icon if a certain event occurs. So when the event occurs the icon would change to the current icon with a ? on it. Do I have to create 4 different icons or is there another way to do it?
    I strongly suspect its gonna be easier to create the different icons but I'm curious to know if there's another way.
    Ubuntu: Eclipse Galileo with CDT and QT integration plug-in.

    Try, try and try again. Abort. Continue. Fail?

  2. #2
    Join Date
    Jul 2009
    Posts
    139
    Thanks
    13
    Thanked 59 Times in 52 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QSystemTrayIcon help

    You can use QImage. Note, to get an QIcon from a QImage:
    Qt Code:
    1. QIcon icon(QPixmap::fromImage(img));
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to numbat for this useful post:

    SkylineBob (13th January 2010)

  4. #3
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QSystemTrayIcon help

    Thanks, I'll look into that.
    Ubuntu: Eclipse Galileo with CDT and QT integration plug-in.

    Try, try and try again. Abort. Continue. Fail?

Similar Threads

  1. QSystemTrayIcon::showMessage
    By radojkod in forum Qt Programming
    Replies: 0
    Last Post: 4th December 2008, 13:13
  2. Problem with QSystemTrayIcon on Mac OS
    By mourad in forum Qt Programming
    Replies: 1
    Last Post: 22nd May 2008, 10:53
  3. QSystemTrayIcon - how to make one?
    By slava in forum Qt Programming
    Replies: 4
    Last Post: 9th March 2008, 11:00
  4. QSystemTrayIcon on click() ?
    By probine in forum Qt Programming
    Replies: 4
    Last Post: 25th January 2007, 08:43
  5. Info about QSystemTrayIcon
    By yogeshm02 in forum Qt Programming
    Replies: 2
    Last Post: 13th December 2006, 14:20

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.