Results 1 to 3 of 3

Thread: how to disable X button to close th window

  1. #1
    Join Date
    Feb 2007
    Posts
    63
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default how to disable X button to close th window

    I everyone,
    I wanted to disable the X button at the top right corner of the page which is used to close the page.
    how can i do this??????

    Regards
    Raghvendra

  2. #2
    Join Date
    Dec 2007
    Posts
    129
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to disable X button to close th window


  3. #3
    Join Date
    Aug 2006
    Location
    Zürich, Switzerland
    Posts
    23
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to disable X button to close th window

    With Qt 4.5 and MDI child windows you get rid of the close button with the following flags which must be supplied at the time when the MDI child window is added to the MDI area:

    Qt Code:
    1. mychildwindow* child1 = new MyChildWindow(this);
    2.  
    3. Qt::WindowFlags flags;
    4. flags = Qt::Window | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint;
    5.  
    6. mdiArea->addSubWindow(child1, flags);
    To copy to clipboard, switch view to plain text mode 

    Didn't try with top level widgets but this could work for them too.

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. Window title bar and "X" button
    By markcole in forum Qt Programming
    Replies: 3
    Last Post: 20th December 2007, 20:58
  3. Maximize Window button of Manin Window
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2007, 08:20
  4. Disable Checkable Button Question
    By jbpvr in forum Qt Programming
    Replies: 9
    Last Post: 20th March 2007, 17:57
  5. 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.