[Qt-interest] QSystemTrayIcon extensibility?
Phil Barila
phil at rebit.com
Sat May 8 07:04:05 CEST 2010
Hi all,
I'm pretty new at Qt. I'd like to use the QSystemTrayIcon as the basis for a user notification widget. As implemented, it seems that the only activations available are mouse clicks. I need mouse-overs, too.
I've been examining the QSystemTrayIcon implementation, hoping to find a way to enable a callback on mouse-overs. From what I've been able to discern, there is no way to do that without code reuse by copy/paste, since the interface doesn't only exposes mouse-clicks, and the class which implements the Win32 message handler is defined inside the qsystemtrayicon_win.cpp file, so it's not easily subclassed.
Am I missing some obvious construct by which I might add mouse-over activation? With only a small amount of hackery, I was able to call installEventFilter() on the private QSystemTrayIconSys object, but the installed filter doesn't get called in a way that is useful for my purposes (it really doesn't get called at all). I also called setMouseTracking(true) on the sys object, and that was the only event that came into my filter, MouseTrackingChange. After all that, I still only get my the slot connected to the activated() signal invoked on mouse clicks. Unfortunately, it doesn't appear that there is any support for signaling mouse-overs in the QSystemTrayIconSys::winEvent() routine. Is there another signal I'm missing? Is there another API besides installEventFilter() that I don't know about that would allow me to register a winEvent callback on the sys object (or something)? As I noted above, subclassing QSystemTrayIconSys is quite problematic as it is implemented today, and will require almost complete copy/paste of the QSystemTrayIcon source in order to accomplish that.
I'm also going probably going to need to put up my own balloon, as I'm going to need to show custom icons, but that's for later. If someone can point me at the right bits to enable the mouse-overs, or confirm what I've already discovered, I'll be very grateful.
Thanks,
Phil
[cid:image001.jpg at 01CAEE11.6E85AEF0] Phil Barila | Senior Software Engineer | www.rebit.com<http://www.rebit.com/> | (720) 204-3353 | phil at rebit.com<mailto:norton at rebit.com>
Computer Times and Dragon Steel Mods Editor's Choice and 2009 CRN Emerging Vendor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100507/b2a3d753/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 898 bytes
Desc: image001.jpg
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100507/b2a3d753/attachment.jpg
More information about the Qt-interest-old
mailing list