Drag & Drop to systray icon
-
Is it possible to get info about a file (or capture text that is) dragged and dropped on my Qt App systray icon ?
-
"QSystemTrayIcon":http://doc.qt.nokia.com/stable/qsystemtrayicon.html inherits directly from QObject and does not accept drops at all.
I don't know if it is possible at all to do this on any operating system.
Do you really mean the system tray (see the screenshot in the link above). Or do you mean something like the "Dock":http://en.wikipedia.org/wiki/Dock_(computing) on "OS X":http://en.wikipedia.org/wiki/Dock_(Mac_OS_X) or the "Taskbar":http://en.wikipedia.org/wiki/Taskbar on windows?
-
@Volker yes i mean systray icon and i saw it on mac already, and also in windows in a c# application.
-
is this related : http://developer.qt.nokia.com/forums/viewthread/943 ?
-
[quote author="ahmed.helal" date="1292951491"]is this related : http://developer.qt.nokia.com/forums/viewthread/943 ?[/quote]
Yes, it's the same problem in that thread.
-
@volker any idea if the suggested solution is valid ?
-
No chance to get drag'n'drop working with pure Qt, at least not in a platform independent manner.
QSystemTrayIcon is "only" a QObject, not a QWidget and therefore does not have setAccptDrops().
On a Mac the icon does not get any events at all (you can check by installing an event filter).
-
[quote author="Volker" date="1292951292"]systray icon on the mac is in the top right corner, included in the menu bar. I do not know of an application that support a drop on this icon. You can have menus though.[/quote]
For instance droplr. Check out its 30-sec screencast. http://droplr.com/hello