Results 1 to 6 of 6

Thread: Any trick to have 'subwindows' without loosing the main window focus ?

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Any trick to have 'subwindows' without loosing the main window focus ?

    Maybe it is impossible...
    I have a ms windows main window and I want to have sub windows or subpanels with free screen movement. I can use dialog and Qt::splashscreen flag, but when I am on these sub's I lose the focus caption for the main window. Is there any trick to do what I want ?
    Thanks

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Any trick to have 'subwindows' without loosing the main window focus ?

    What do you mean by "when I am on these subs" if you do not mean the subwindow has focus?

  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Any trick to have 'subwindows' without loosing the main window focus ?

    Theese subwindows have not 'window' title caption, so they have the focus but it is not 'visual' focus (that is , if there is not tittle caption, you dont see the 'traditional' focus by the color change of the title caption).
    I can not think of any other 'trick' that having a custom main window without window title bar, building my own title and change the color of title bar manually when the app receives the focus.
    In example, dreamweaver for windows has not 'windows' title bar.
    What do you think about ?

  4. #4
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Any trick to have 'subwindows' without loosing the main window focus ?

    Is, by any chance, MDI what you want?
    You could easily customize child windows and this way your parent never looses focus.

    Unless I misunderstood you.

  5. #5
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Any trick to have 'subwindows' without loosing the main window focus ?

    Thanks Spitfire.
    I forgot to say that I want something like MDI but outside the mainwindow. (The Mdi let you having subwindows but always inside your main mdi window... )
    Thanks anyway

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Any trick to have 'subwindows' without loosing the main window focus ?

    So your complaint is that when your main program opens the secondary windows they automatically activate and take focus from the main window. Try:
    Qt Code:
    1. setAttribute(Qt::WA_ShowWithoutActivating);
    To copy to clipboard, switch view to plain text mode 
    in the secondary window constructor.

Similar Threads

  1. Replies: 0
    Last Post: 24th November 2011, 09:08
  2. Replies: 7
    Last Post: 23rd April 2011, 02:29
  3. Window focus issues (How to force focus to a window?)
    By montylee in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2009, 01:00
  4. Replies: 11
    Last Post: 11th August 2008, 09:14
  5. Replies: 5
    Last Post: 4th August 2006, 23: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.