Results 1 to 2 of 2

Thread: Minimize to tray - crash

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    Warsaw/Poland
    Posts
    56
    Thanks
    8
    Thanked 4 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Minimize to tray - crash

    Hi,

    I need help, I want to minimize program to tray, and everything is ok but when program is minimized and messagebox (or any dialog/popup) shows program is quiting with Exited normally (?!) Tested on qt 4.7 and 4.8.
    So how and what I need to change in this code ? Or maybe there is better solution for minimizing program ? (I need example of course)

    Qt Code:
    1. void MainWindow::changeEvent(QEvent *event)
    2. {
    3. QMainWindow::changeEvent(event);
    4.  
    5. if (event->type() == QEvent::WindowStateChange)
    6. {
    7.  
    8. if ((e->oldState() != Qt::WindowMinimized) && isMinimized())
    9. {
    10. if (Core::instance()->settings["minimize_to_tray"] == "on")
    11. {
    12. QTimer::singleShot(0, this, SLOT(hide()));
    13. event->ignore();
    14. }
    15. }
    16. }
    17. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by mero; 7th February 2012 at 08:39.

Similar Threads

  1. Minimize to Tray
    By QT8seven in forum Qt Programming
    Replies: 3
    Last Post: 5th December 2011, 11:12
  2. Minimize to system tray
    By aLiNuSh in forum Newbie
    Replies: 17
    Last Post: 4th March 2010, 12:51
  3. Minimize to system tray
    By krivenok in forum Qt Programming
    Replies: 5
    Last Post: 13th January 2009, 04:34
  4. Tray Icon
    By vishesh in forum Qt Programming
    Replies: 1
    Last Post: 12th July 2007, 19:10
  5. Tray Ballon
    By eu.x in forum Newbie
    Replies: 5
    Last Post: 28th February 2007, 12:00

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
  •  
Qt is a trademark of The Qt Company.