Results 1 to 7 of 7

Thread: Windows focus / Windows Shutdown Problems

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2006
    Posts
    68
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Windows focus / Windows Shutdown Problems

    Hi All,

    I am have 2 annoying problems with the Windows version of my program. I mostly use Linux and neither of these occur there, so I'm hoping someone who uses Windows a lot might be able to help.

    1) My program runs mostly in the icon tray, and uses a pop-up to alert users when they have new messages. The popup is a QDialog with the following in the constructor:

    setWindowFlags( Qt:: Dialog | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint );

    This works great on Linux, but on Windows causes the pop-up to steal focus. I have tried playing with just about every windows flag I can find, but there seems to be no way for a widget to be On Top in Windows but not steal focus when it first appears with QT, although I have seen it done with GTK and Visual C++. Any ideas?

    2) I modified the TrayIcon example so that my program minimized instead of shutting down when someone clicks the close button. To exit the program the Tray-icon Context menu is used.

    The problem is that on Windows, if the App is open (And the main window showing) and you shutdown or restart Windows, the program is minimized, and windows halts it's shutdown.

    Is there any way to detect if the close came from outside the program or from a user clicking the close button?

    Thanks loads
    Last edited by December; 21st October 2007 at 07:13.

Similar Threads

  1. Replies: 2
    Last Post: 24th July 2006, 18:36

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.