Results 1 to 9 of 9

Thread: System tray icon in Status Bar

  1. #1
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Lightbulb System tray icon in Status Bar

    Hi,
    I want to create a feature similar to the system tray icon, but in a status bar of my window MainWindow, is this possible?
    How can I do this? I need a north.

    Thanks,

    Marcelo E. Geyer

  2. #2
    Join Date
    Mar 2010
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: System tray icon in Status Bar

    Qt Code:
    1. QStatusBar::addWidget ( QWidget * widget, int stretch = 0 )
    To copy to clipboard, switch view to plain text mode 
    where widget is a QToolButton with a properly defined menu:
    Qt Code:
    1. QToolButton::setMenu ( QMenu * menu )
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: System tray icon in Status Bar

    Yes, the menu is no problem. The problem is the message balloon.

  4. #4
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    506
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: System tray icon in Status Bar

    Hi, maybe you can use QHoverEvent? Or use mouseEnterEvent and show balloon if a timer fires before mouseLeaveEvent?

    Ginsengelf

  5. #5
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: System tray icon in Status Bar

    Hi,

    The central problem is how to make a balloon message. An example of how I want is when there is a connection to a server in the system tray automatically appears a message that no network available, without the need to position the mouse over.
    That's what I want to do, but not using the system tray, but using a QToolButton I have in the status bar of my mainwindow. With QSystemTray is simple, but how to adapt this in the status bar?

    Thanks,

    Marcelo E. Geyer

  6. #6
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: System tray icon in Status Bar

    Suggests? It's a very hard code?
    Thanks,

    Marcelo E. Geyer

  7. #7
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: System tray icon in Status Bar

    No solution for a balloon. But you could place a QWhatsThis message at the right position until you find a better replacement.

    QWhatsThis::showText ..
    QTimer::singleShot => QWhatsThis::hideText ..

    Joh

  8. #8
    Join Date
    Jun 2010
    Posts
    142
    Thanks
    11
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: System tray icon in Status Bar

    What's wrong with QSystemTrayIcon::showMessage()?

  9. #9
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: System tray icon in Status Bar

    He is not using a systemtrayicon. He wants something similiar inside his application.

Similar Threads

  1. Problem using System Tray Icon....
    By Bong.Da.City in forum Newbie
    Replies: 15
    Last Post: 31st August 2010, 18:40
  2. system tray message is not displaying near tary icon
    By sudhansu in forum Qt Programming
    Replies: 0
    Last Post: 29th March 2010, 17:31
  3. How to keep System tray icons
    By mkkguru in forum Qt Programming
    Replies: 10
    Last Post: 24th February 2010, 16:19
  4. How to write some text next to the system tray icon?
    By alex chpenst in forum Qt Programming
    Replies: 3
    Last Post: 5th September 2008, 08:43
  5. Replies: 4
    Last Post: 30th June 2008, 06:25

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.