Results 1 to 4 of 4

Thread: modal that excludes parent's siblings

  1. #1
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question modal that excludes parent's siblings

    Is there any way to get a Modal window that doesn't block input to it's parent siblings? I'm trying to get multiple top-level windows working correctly but hitting several problems:

    1. All windows that are children of the same top-level window, when they use a modal window it blocks access to all the siblings. I don't want that. I know I could put an intermediate window in between, but that becomes cumbersome.

    2. If I make them all without a parent, I can't find a way to get a list of all those windows.

    3. I can't just stick them in a list, since I need to have them automatically removed when they are closed.

    4. QWidget doesn't support a plain QObject as parent. This is quite unfortunate -- it crashes.


    If any of the above problems can be solved I have a solution to my problem.

  2. #2
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: modal that excludes parent's siblings

    I found QApplication::topLevelWidgets(). This will work. Too bad about not having a better selection of modality models though.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: modal that excludes parent's siblings

    Modality in Qt is based on parent-child relationship. If you want multiple top-level windows, they should be parentless anyway. So it's not Qt's fault but rather the result of the way you use it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: modal that excludes parent's siblings

    I'm not sure that i correctly understand the problem, but i think you want Qt::WindowModal not Qt::ApplicationModal which is the default way when you use exec().
    Check the documentation about window modality

Similar Threads

  1. Qt non modal form how to
    By ras in forum Qt Programming
    Replies: 0
    Last Post: 5th August 2010, 19:20
  2. Creating modal dialogs
    By Luc4 in forum Qt Programming
    Replies: 8
    Last Post: 17th June 2010, 10:35
  3. Replies: 5
    Last Post: 21st April 2010, 21:36
  4. QT Modal Dialog
    By jiapei100 in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2010, 17:15
  5. Bug with modal windows on Mac? [Qt 3.3]
    By kalos80 in forum Qt Programming
    Replies: 0
    Last Post: 15th February 2008, 16:52

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.