PDA

View Full Version : Input Dialog with Check Box?



PeterThePuter
25th October 2010, 04:56
Hey all,

I want to make a dialog that won't show itself in the future if the user selects a check box.

The trouble is how to put a checkbox in a dialog. I looked at QInputDialog, but didn't see anything for checkboxes. I also looked at QMessageBox, but don't know how to sneak a checkbox in.

Is there any way easier or more straightforward than using QDialog? If not, how would I go about it? Sorry, complete newbie here.

-PtP

tbscope
25th October 2010, 05:23
You can subclass the input dialog

wysota
25th October 2010, 06:40
Or you can use QErrorMessage.

richardcarl78
25th October 2010, 21:20
Thanks. This is very helpful. I did not know that you could subclass the input dialog. This forum is great. Thanks for taking the time to answer the question posted here.

PeterThePuter
26th October 2010, 05:16
Since the dialog is simple, I just decided to go the default route and subclass QDialog.

The only thing I am wondering is how to return an integer from QDialog::exec(). Or should have I subclassed QInputDialog?

Thanks!

tbscope
26th October 2010, 05:30
The exec() function returns one of two possible values:
http://doc.trolltech.com/latest/qdialog.html#DialogCode-enum

Do you want to change this? If so, why?