Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt5 System Tray Icon with QtQuick 2

    General and Desktop
    3
    6
    5021
    Loading More Posts
    • 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
      Itehnological last edited by

      I am trying to add a system tray icon to my QtQuick 2 application. I found these two classes in the "docs":http://qt-project.org/doc/qt-5.0/qtdoc/classes.html:
      QSystemTrayIcon and QPlatformSystemTrayIcon.

      When using the first QSystemTrayIcon class with the QtQuick2ApplicationViewer a second window is displayed by the QSystemTrayIcon class. I guess that it's caused by the fact that the first class is a QWidget based class and the second isn't.

      Then I decided that I can use the QPlatformSystemTrayIcon which doesn't seem to inherit QWidget, but unfortunately when I try to include it "as described in the docs":http://qt-project.org/doc/qt-5.0/qtgui/qplatformsystemtrayicon.html I get an error message, that the class doesn't exist.

      How am I supposed to include the QPlatformSystemTrayIcon class or is there an alternative for a system tray icon?

      P.S. I don't believe that it has to do with the problem, but I am running Qt5 Final Release on Ubuntu 12.04 x86

      1 Reply Last reply Reply Quote 0
      • M
        Milovidov last edited by

        What about QSystemTrayIcon in Qt5.0.0? How do i can accept QSystemTrayIcon with Qt Qucik 2.0 application?

        1 Reply Last reply Reply Quote 0
        • sierdzio
          sierdzio Moderators last edited by

          If you check out newest Qt5 code from git or wait for Qt 5.1.0, it will be possible to embed QML apps (QWindows) into QtWidgets. That would probably help you solve this problem.

          (Z(:^

          1 Reply Last reply Reply Quote 0
          • M
            Milovidov last edited by

            Yes, i have Qt5 from Git. But didn't see how i can insert QWidnow into QWidget.

            1 Reply Last reply Reply Quote 0
            • sierdzio
              sierdzio Moderators last edited by

              Take a look at this "Qt bug":https://bugreports.qt-project.org/browse/QTBUG-25643. It's probably not in the Qt5-git yet, you need to check out master branches (or whatever they are now called. I think it's either dev or stable nowadays).

              (Z(:^

              1 Reply Last reply Reply Quote 0
              • M
                Milovidov last edited by

                Ok, i understand, thank you!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post