Results 1 to 2 of 2

Thread: QDialog without the close button in the top right corner

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QDialog without the close button in the top right corner

    Hi.
    How can I make a modal QDialog that doesn't have the "X" in the top right corner (in the title) that you can use to close the dialog?
    I need to make it modal so that it doesn't let the user do anything (including closing the dialog) before it has finished doing stuff in the dialog.

    By the way, the dialog can still send and receive signals when it's modal, right?

  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: QDialog without the close button in the top right corner

    Quote Originally Posted by Morea View Post
    How can I make a modal QDialog that doesn't have the "X" in the top right corner (in the title) that you can use to close the dialog?
    As far as I know, there is no 100% reliable way to do this (unless you provide a custom fake title bar). You can provide certain hints but it's up to the underlying window system whether they are respected or not. I suggest you take a look at the window flags example. On the other hand, you can always ignore close events to prevent dialog from closing.

    By the way, the dialog can still send and receive signals when it's modal, right?
    Yes.
    J-P Nurmi

Similar Threads

  1. showing close Button(x) in QDialog
    By vishal.chauhan in forum Newbie
    Replies: 6
    Last Post: 4th April 2007, 10:01
  2. Replies: 2
    Last Post: 5th February 2007, 17:42
  3. Replies: 3
    Last Post: 16th November 2006, 12:24
  4. How to "hide window when close button pressed"
    By iGoo in forum Qt Programming
    Replies: 4
    Last Post: 26th July 2006, 09:53

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.