PDA

View Full Version : System tray icon in Status Bar



estanisgeyer
15th September 2010, 16:11
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

guiQt
15th September 2010, 18:24
QStatusBar::addWidget ( QWidget * widget, int stretch = 0 )
where widget is a QToolButton with a properly defined menu:

QToolButton::setMenu ( QMenu * menu )

estanisgeyer
15th September 2010, 20:06
Yes, the menu is no problem. The problem is the message balloon.

Ginsengelf
16th September 2010, 07:25
Hi, maybe you can use QHoverEvent? Or use mouseEnterEvent and show balloon if a timer fires before mouseLeaveEvent?

Ginsengelf

estanisgeyer
16th September 2010, 13:58
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

estanisgeyer
17th September 2010, 15:32
Suggests? It's a very hard code?
Thanks,

Marcelo E. Geyer

JohannesMunk
17th September 2010, 16:31
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

MTK358
17th September 2010, 19:28
What's wrong with QSystemTrayIcon::showMessage()?

JohannesMunk
17th September 2010, 19:57
He is not using a systemtrayicon. He wants something similiar inside his application.