Results 1 to 6 of 6

Thread: How to bring child Qt::Tool windows back on top after main window gets focus again

  1. #1
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to bring child Qt::Tool windows back on top after main window gets focus again

    Here is my situation: I have a main window that spawns many child Qt:Tool type widgets windows that work nicely until they are covered by other applications, or the main window is minimized. Once I restore the main window or give it focus, I would like these child windows to be visible (on top) again, but instead the remain buried under windows of other applications. Is there a simple way to manage this an keep their original stacking order?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to bring child Qt::Tool windows back on top after main window gets focus agai

    One easy solution could be to put your widgets (which are currently set as tool windows) inside a QDialog and set it as a tool window.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to bring child Qt::Tool windows back on top after main window gets focus agai

    Did you use the Qt::WindowStaysOnTopHint flag when constructing the tool windows?
    Save yourself some pain. Learn C++ before learning Qt.

  4. #4
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to bring child Qt::Tool windows back on top after main window gets focus agai

    That flag doesn't do what I want. If you use that, your tool windows always stay on top, even when your main application window is minimized. I want my tool windows to appear and dissapear when my main window does, and not show as seperate windows on the taskbar either.

    Quote Originally Posted by Chicken Blood Machine
    Did you use the Qt::WindowStaysOnTopHint flag when constructing the tool windows?

  5. #5
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to bring child Qt::Tool windows back on top after main window gets focus agai

    The tool windows aren't really tool windows in the classic sense. They can be quite large, and you might have 20 or more of them open at once. I wanted to do a frameless layout where these windows can be floating anywhere on the desktop (see below), but are still linked to the main application window in tems of minimize/restore. I believe Adobe Photoshop and similar programs have the same type of behavior with their tool windows.

    Quote Originally Posted by jpn
    One easy solution could be to put your widgets (which are currently set as tool windows) inside a QDialog and set it as a tool window.

  6. #6
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to bring child Qt::Tool windows back on top after main window gets focus agai

    Update: I solved the problem.

    I had changed some other code which was making these tool windows have a NULL parent. This is what was causing the strange decoupled behavior.

    Colby

Similar Threads

  1. Replies: 2
    Last Post: 24th July 2006, 18:36
  2. cannot make a main window modal
    By Dark_Tower in forum Qt Programming
    Replies: 12
    Last Post: 23rd March 2006, 10:21

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.