Hi,
I'm trying to learn how to create and launch a dialog from my main application but I don't find valid tutorial or resources.
Can I have a help please?
Best Regards,
Franco
Printable View
Hi,
I'm trying to learn how to create and launch a dialog from my main application but I don't find valid tutorial or resources.
Can I have a help please?
Best Regards,
Franco
It depends on what dialog do you want to have. If some simple warning or question then use QMessageBox's static methods (like QMessageBox::warning()). If it is not enough then either create your own dialog by subclassing QDialog and connecting some buttons or whatever you will have there to accept() and reject() slots of your dialog and then just create object of your class and call QDialog::exec() on it or you can create object of QDialog, set widgets and layouts to it (connect what you want to accept() and reject()) and call exec() on it.
Maybe you can draw a rough sketch of what you need and post it?
Ok I try it.
When I press File->add to list as you can see in the image 1 Attachment 4256 I would launch a dialog similar to this in the image 2Attachment 4257 but I'm unable to create the dialog. I would use designer to do faster but I saw that designer only create a *.ui file.
What I have to do with this ui file?
Best Reards,
Franco
You can use 'uic' to convert 'ui' file to '.h' file. This file contains a class with a function 'setupUi' that will create the ui you designed in QtDesigner.