Results 1 to 2 of 2

Thread: Disable default button in QDialog

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Disable default button in QDialog

    Is there an elegant way to disable the default button in a QDialog ?

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Disable default button in QDialog

    I don't know how to do this if you use Designer -> Dialog(with buttons), but

    you can create your own buttons and use: okButton->setDisabled(true); //in the class constructor
    And connect some signal (bool) to setEnable(bool) slot of the button (if user edits something.. or what should trigger the activation of okButton)
    Last edited by Zlatomir; 4th June 2010 at 16:48.

Similar Threads

  1. Disable default tab behaviour for a QGraphicsItem
    By nmather in forum Qt Programming
    Replies: 3
    Last Post: 13th December 2017, 10:30
  2. Disable window menu on a QDialog
    By febil in forum Qt Programming
    Replies: 5
    Last Post: 24th June 2011, 00:58
  3. Form with default button
    By miraks in forum Qt Programming
    Replies: 7
    Last Post: 25th January 2010, 15:50
  4. Disable Close button (X) of a QDialog
    By BrainB0ne in forum Qt Programming
    Replies: 29
    Last Post: 8th December 2009, 17:01
  5. QDialog and default button.
    By hicpalm in forum Qt Programming
    Replies: 2
    Last Post: 30th April 2008, 11:11

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
  •  
Qt is a trademark of The Qt Company.