Results 1 to 6 of 6

Thread: Close Button on Modal Widget?

  1. #1
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Close Button on Modal Widget?

    Hi All,

    I have a widget which open on a dialog.
    I have set the modality of that widget by using

    Qt Code:
    1. this->setWindowModality (Qt::ApplicationModal);
    To copy to clipboard, switch view to plain text mode 

    This works fine in the sense that it open a modal widget but the problem is that it does not show the close button on the upper left corner.

    So how should I make a modal widget with close button enabled.

    Thanks.

  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: Close Button on Modal Widget?

    QDialog::exec() might be a bit less error-prone way to handle modal dialogs...
    J-P Nurmi

  3. #3
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Close Button on Modal Widget?

    Thanks for Reply.
    But Actually I am using QWidget not QDialog.

  4. #4
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Close Button on Modal Widget?

    Even If I use QDialog still I am not getting close button.
    I am opening the dialog on a Widget.

  5. #5
    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: Close Button on Modal Widget?

    Which version of Qt? Here's one relevant bug I could find but it was already fixed to Qt 4.1.3: http://trolltech.com/developer/task-...entry&id=95836
    J-P Nurmi

  6. #6
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Close Button on Modal Widget?

    I am using Qt 4.2.2.
    Do I need to set some flags.

Similar Threads

  1. Disable Close button (X) of a QDialog
    By BrainB0ne in forum Qt Programming
    Replies: 29
    Last Post: 8th December 2009, 17:01
  2. Replies: 3
    Last Post: 17th October 2007, 12:52
  3. Replies: 1
    Last Post: 7th July 2007, 09:03
  4. setting widget as modal, disables button
    By munna in forum Qt Programming
    Replies: 3
    Last Post: 27th November 2006, 09:49
  5. Replies: 3
    Last Post: 16th November 2006, 12:24

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.