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. [Solved] QSystemTrayIcon close without exit.
Qt 6.11 is out! See what's new in the release blog

[Solved] QSystemTrayIcon close without exit.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.0k 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.
  • Z Offline
    Z Offline
    zither
    wrote on last edited by
    #1

    Dear all,

    I made a QSystemTrayIcon application like that.
    @MyApp::MyApp(QWidget *parent) : QMainWindow(parent)
    {
    this->setVisible(false);

     QSystemTrayIcon *trayIcon = new QSystemTrayIcon(this);
     trayIcon->setVisible(true);
    
     QMenu *trayMenu = QMenu(this);
     trayMenu->addAction(about);
    
     trayIcon->setContextMenu(trayMenu);
    
     connect(about,SIGNAL(triggered()),qApp,SLOT(aboutQt()));
    

    }@

    The problem is that when I close the about Qt dialog, it also exit the application.
    How can I solve that?

    Thanks

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p-himik
      wrote on last edited by
      #2

      Look at "quitOnLastWindowClosed property":http://doc.qt.nokia.com/latest/qapplication.html#quitOnLastWindowClosed-prop

      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