Qt modal dialogue and the main process

I have a program that executes some process in the main window, and I need a modal dialog box with some customizable elements that will be shown above it to show progress. It should also block user interaction with the main window. The main process should start while the dialog is displayed. Which way is better (in qt) for this purpose?

+7
source share
1 answer

It actually sounds easy (if I didn't understand your question).

QDialog my_progress_dialog( this ); my_progress_dialog.setModal( true ); my_progress_dialog.show(); 

Calling show() not exec() will leave you in the main eventloop. At the same time, installing a modal modal block blocks all users from entering the main window. Completion of the assignment.

Have you looked at the QProgressDialog ? This is there for this purpose.

+17
source

All Articles