How can I prevent QDialog class from closing

后端 未结 3 848
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 16:09

How can I prevent QDialog class from closing after \"Ok\" button was pressed? I need to close the window only if the some actions were performed correctly on this dialog, in

3条回答
  •  日久生厌
    2021-01-18 16:38

    While you probably shouldn't make a button available that won't do anything when the user clicks it, if you absolutely must override the default close behavior, then you need to override QDialog::accept().

提交回复
热议问题