Results 1 to 4 of 4

Thread: How to block the normal buttons of a QWidget

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default How to block the normal buttons of a QWidget

    Hello!

    I want to block thoose normal buttons that appears in a QWidget (the "?" and the "X"), so when the user wants to close the widget, he would have to use the buttons I personally put there to be used (the "OK" in my example).

    abc.jpg

    How do I do that?

    By the other hand, a curiosity: which is the signal that is emitted when this same buttons are clicked? (the "?" and "X") or how can I capture they "clicking" so I can do some things to my object when they are clicked? (In fact, its because I don't know how to capture they being clicked that I want to block them =]).


    Thanks!


    Momergil

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to block the normal buttons of a QWidget

    Read about QWidget and Qt::WindowFlags

  3. #3
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to block the normal buttons of a QWidget

    Check out the QWidget::setWindowFlags, read about Qt::CustomizeWindowHint, Qt::WindowCloseButtonHint and Qt::WindowMinMaxButtons.

  4. The following user says thank you to stampede for this useful post:

    Momergil (12th April 2014)

  5. #4
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to block the normal buttons of a QWidget

    Thanks!

    Momergil

Similar Threads

  1. Replies: 2
    Last Post: 14th July 2011, 16:17
  2. Replies: 2
    Last Post: 16th May 2011, 01:15
  3. Style sheets bug? Or normal behavior?
    By Syntho in forum Qt Programming
    Replies: 0
    Last Post: 7th June 2010, 10:16
  4. Replies: 1
    Last Post: 29th May 2010, 00:01
  5. Problem with Parent QWidget and Buttons not working
    By VireX in forum Qt Programming
    Replies: 7
    Last Post: 11th May 2007, 23: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.