Results 1 to 2 of 2

Thread: QSystemTrayIcon closes my complete application

  1. #1
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default QSystemTrayIcon closes my complete application

    Hey @all,

    I'Ve an application with an system tray icon. When the application is hidden and i open and close a dialog from the context menu of the tray icon, then the complete application is closed.

    Here is how i open the preference dialog for example:
    Qt Code:
    1. Preferences *pPreferences = new Preferences(this);
    2. if(pPreferences) {
    3. pPreferences->setAttribute(Qt::WA_DeleteOnClose);
    4. pPreferences->exec();
    5. }
    To copy to clipboard, switch view to plain text mode 
    and in the preference dialog I've the following to close it, if the button "Close" was pressed:
    Qt Code:
    1. connect(m_ui->btnClose, SIGNAL(clicked()), this, SLOT(close()));
    To copy to clipboard, switch view to plain text mode 
    So, when I press the "Close" button from the preference dialog, then the complete application is closed. The tray icon is gone when i move the mouse cursor over it.

    I hope someone could help me please

    Best Regards
    NoRulez

  2. #2
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QSystemTrayIcon closes my complete application

    Funny, that happens to me only if the main window isn't showing, which seems to be your case also..

Similar Threads

  1. hey i need some in guidance to complete my project
    By saranyabahala in forum Newbie
    Replies: 3
    Last Post: 15th March 2010, 12:06
  2. complete tablewidget
    By tux-world in forum Newbie
    Replies: 3
    Last Post: 11th March 2010, 02:07
  3. Complete newbie with programming and Qt
    By Jacob in forum Newbie
    Replies: 1
    Last Post: 6th March 2010, 06:26
  4. Replies: 1
    Last Post: 15th November 2009, 22:14
  5. QMessageBox closes entire application
    By Leoha_Zveri in forum Qt Programming
    Replies: 2
    Last Post: 19th September 2009, 11:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.