Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Make a application that create a QSystemTrayIcon and no taskbar entry
Forum Updated to NodeBB v4.3 + New Features

Make a application that create a QSystemTrayIcon and no taskbar entry

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 5.1k 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.
  • S Offline
    S Offline
    stucremon
    wrote on last edited by
    #1

    @#include <QWidget>
    #include <QApplication>
    #include <QSystemTrayIcon>

    int main(int argc, char** argv)
    {
    QApplication app(argc, argv);
    QWidget w1;
    QSystemTrayIcon icon(QIcon("./icon.png"), &w1);
    icon.show();
    app.setQuitOnLastWindowClosed(false);
    return app.exec();
    }@

    When I run this code, sometimes it make no taskbar entry but sometimes it does
    Can anyone explain me why?
    And how can I make a application that only make a systemtray icon without taskbar entry?
    I am using Linux Mint with MATE
    Sorry for my bad english!

    1 Reply Last reply
    0
    • 8 Offline
      8 Offline
      8majkel8
      wrote on last edited by
      #2

      @
      #include <QApplication>
      #include <QSystemTrayIcon>

      int main(int argc, char** argv)
      {
      QApplication app(argc, argv);

      QSystemTrayIcon icon(QIcon("./icon.png"));
      icon.show();
      
      return app.exec&#40;&#41;;
      

      }
      @

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stucremon
        wrote on last edited by
        #3

        [quote author="8majkel8" date="1371136224"]@
        #include <QApplication>
        #include <QSystemTrayIcon>

        int main(int argc, char** argv)
        {
        QApplication app(argc, argv);

        QSystemTrayIcon icon(QIcon("./icon.png"));
        icon.show();
        
        return app.exec(&#41;;
        

        }
        @[/quote]

        It doesn't work. Sometimes it make a taskbar entry.
        This taskbar entry remain even after i have killed this program

        1 Reply Last reply
        0
        • 8 Offline
          8 Offline
          8majkel8
          wrote on last edited by
          #4

          It's common for all taskabar applications that was not quit but terminated.
          You have to add some custom menu etc. with exit action. Calling QCoreApplication::quit() might be enough.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            stucremon
            wrote on last edited by
            #5

            I have tried some code that i found in internet. All of them work corectly in Windows7 but not in LinuxMint with MATE.
            Are there somethings incompatible?
            I use Qt 5.0.2

            1 Reply Last reply
            0
            • mrdebugM Offline
              mrdebugM Offline
              mrdebug
              wrote on last edited by
              #6

              I have the same problem:
              http://qt-project.org/forums/viewthread/28655/

              Need programmers to hire?
              www.labcsp.com
              www.denisgottardello.it
              GMT+1
              Skype: mrdebug

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

                Perhaps the problem is Linux Mint, and not Qt? Perhaps Linux Mint always creates a task-bar entry by default, whether it is requested by the application or not?

                1 Reply Last reply
                0
                • mrdebugM Offline
                  mrdebugM Offline
                  mrdebug
                  wrote on last edited by
                  #8

                  I use Debian 7 instead of Linux Mint. With Qt 4.8.4 all works well.

                  Need programmers to hire?
                  www.labcsp.com
                  www.denisgottardello.it
                  GMT+1
                  Skype: mrdebug

                  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