PDA

View Full Version : Special Dialog



avis_phoenix
28th September 2006, 21:47
I want to make a dialog window that has 4 pushbuttons and I want that when push a button closes the window and the main window it receives something to know that button I press; How I do it?
:)

wysota
28th September 2006, 22:05
I want to make a dialog window that has 4 pushbuttons and I want that when push a button closes the window and the main window it receives something to know that button I press; How I do it?
:)
The docs say:


void QDialog::done ( int r ) [virtual slot]
Closes the dialog and sets its result code to r. If this dialog is shown with exec(), done() causes the local event loop to finish, and exec() to return r.

Therefore probably the easiest way is to use QSignalMapper or QButtonGroup to transform clicked(void) into clicked(int) and connect it to that slot.

jpn
29th September 2006, 06:05
QButtonGroup could be a good choice too as it has a signal called buttonClicked(int id).