dqml icon indicating copy to clipboard operation
dqml copied to clipboard

[enhancement] System tray icon support?

Open MoritzMaxeiner opened this issue 9 years ago • 5 comments

Native QML does not provide support for system tray icons, instead one needs to leverage QT and bind to QML as shown here or here. Would it be possible to get support for this into dqml?

Specifically, the functionality I am after is this: One tray icon with two actions "Show" and "Quit", the former of which shows a specific window (maybe by its QML id?) if it is not yet shown (and focuses it), while the latter quits the QML application. It would also be nice if tray's icon could be loaded from QT's Resource system.

MoritzMaxeiner avatar Dec 22 '15 18:12 MoritzMaxeiner

Yes, i've to decide if to put this functionality in the DOtherSide (for simplicity of the implementation) or to put it in a different QML module (better) that a user can use by adding the module in the qml import path.

filcuc avatar Dec 23 '15 21:12 filcuc

Cool! Would the latter mean that I would need to load some (C++) shared library that connects to Qt or would this be done completely in QML? Sorry if that should be obvious, but I'm not sure which you mean.

MoritzMaxeiner avatar Dec 23 '15 22:12 MoritzMaxeiner

Yes, basically something like QtQuickControls (so a shared library to put in your import path)

import DOtherSide.Extra 1.0

Window {
  SystemTrayIcon {
    visible: true
    menu: Menu { ... }
  }
}

filcuc avatar Dec 24 '15 11:12 filcuc

Hm, I assume Qt takes care of loading the shared library dynamically (from where ever the module lies)?

MoritzMaxeiner avatar Dec 24 '15 11:12 MoritzMaxeiner

yes correct

2015-12-24 12:41 GMT+01:00 Moritz Maxeiner [email protected]:

Hm, I assume Qt takes care of loading the shared library dynamically (from where ever the module lies)?

— Reply to this email directly or view it on GitHub https://github.com/filcuc/dqml/issues/8#issuecomment-167097355.

Filippo Cucchetto

filcuc avatar Dec 24 '15 11:12 filcuc