What should I do to use a blocked modal dialog like QT exec?


If I can use a blocked modal dialog like this:

QDialog* childDialog = new QDialog(pWindow);
int resutl = childDialog ->exec();
if (resutl == QDialog::Accepted)
    qDebug() << "You Choose Ok";
    qDebug() << "You Choose Cancel";

The code will be much simple.
But I know Qt’s modal dialog transfers the event loops, can lvgl do that?
Maybe there is any other way?
Thank you very much!

You can create a modal dialog that prevents the user from clicking on anything else, however, you still need to use event callbacks. The event loop cannot be run inside the dialog box itself.

Thank you for your answer.