Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QDialog with ok and cancel buttons

I need Qt Dialog with ok and cancel buttons with standard functionality, placed on the right side of its layout. I need to inherit from it and add other widgets to its layout. I can implement it myself, but maybe there is something standard, in that case I prefer to use it, since it will be more portable.

QMessageBox shows a message, I need something more general, only QDialog and standard buttons, or maybe QDialog has an option which activates them.

like image 835
Ashot Avatar asked Jun 19 '13 12:06

Ashot


People also ask

What is QDialogButtonBox?

QDialogButtonBox allows a developer to add buttons to it and will automatically use the appropriate layout for the user's desktop environment. Most buttons for a dialog follow certain roles. Such roles include: Accepting or rejecting the dialog. Asking for help.

How do I close QDialog?

Disabling the Esc key that in QDialog closes/cancels the dialog.


1 Answers

Subclass QDialog and use a QDialogButtonBox for the standard buttons (docs).

like image 183
cmannett85 Avatar answered Oct 06 '22 23:10

cmannett85