Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Sytem tray icon not available for QtQuick2 apps?
Forum Updated to NodeBB v4.3 + New Features

Sytem tray icon not available for QtQuick2 apps?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ivoryz
    wrote on last edited by
    #1

    AFAIK, QSystemTrayIcon comes from the QtWidgets module, and cannot be used directly in QtQuick2 apps which use QGuiApplication and QQuickView. My small test resulted in "QWidget: Cannot create a QWidget when no GUI is being used" during run-time when

    @(QSystemTrayIcon*)trayIcon->show()@

    is called (QSystemTrayIcon inherits QObject rather than QWidget, though) or when any QWidget descendant is instantiated, like:

    @trayIconMenu = new QMenu()@

    How to use system tray icons with QtQuick2 then? Is this feature under development in Qt5? Any workarounds, e.g. sending/receiving signals between a QtQuick2 and QApplication-based systray apps?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      I think it's still being worked on, IIRC. Same goes for window icons, actually.

      Try instantiating QApplication instead of QGuiApplication, maybe it will work this way (I haven't tried).

      (Z(:^

      1 Reply Last reply
      0
      • I Offline
        I Offline
        Itehnological
        wrote on last edited by
        #3

        That works, except that it creates an additional window with the tray icon.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved