Results 1 to 4 of 4

Thread: setWindowModality doesn't work

  1. #1
    Join Date
    Sep 2007
    Location
    Ukraine, Kharkiv
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default setWindowModality doesn't work

    Hi everybody!

    I'm trying to make my dialogs modal with flag Qt::WindowModal.
    The parent window is dialog also, shown by calling its slot show(), so the main window is non-modal itself. The children dialogs call setWindowModality(WindowModal) in their ctors. And when I show those dialogs by calling show() they appear non-modal.

    Am I missing something? How can I force those dialogs to be modal?

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

    Default Re: setWindowModality doesn't work

    How about simply using QDialog::exec() instead of show()?
    J-P Nurmi

  3. #3
    Join Date
    Sep 2007
    Location
    Ukraine, Kharkiv
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setWindowModality doesn't work

    Can't do that because of a complex app architecture. It will hung the rest of app while that dialog will be shown

  4. #4
    Join Date
    Sep 2007
    Location
    Ukraine, Kharkiv
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setWindowModality doesn't work

    It's weird but modality began to work properly when I made the line setWindowModality the first line of dialog ctor

Similar Threads

  1. Printing via QPrinter doesnt work
    By mSergey in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2008, 19:00
  2. QActions don't work with menubar hidden
    By Pepe in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2007, 01:04
  3. Change work area OS
    By pakulo in forum Qt Programming
    Replies: 15
    Last Post: 15th May 2007, 07:20
  4. QTextEdit Justify align making work
    By dec0ding in forum Qt Programming
    Replies: 2
    Last Post: 13th January 2006, 12:02

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.