简体   繁体   中英

How to make QInputDialog box modal less?

I am using multiple QInput Dialog boxes in my UI, using the syntax like

QString s = QInputDialog::getText(this,"Sleep Command ",
    "Enter the number of seconds" );

but when ever these Input dialog boxes pops up, the mainwindow becomes unresponsive, so how do i make all the QInputDialog boxes "modal less " and the mainwindow always stays responsive??

so how do i make all the QInputDialog boxes "modal less "

reading the doc here:

https://doc.qt.io/qt-5/qinputdialog.html#details

you will find that using the static methods involves the fact that the dialogs are invoked "modal",

The dialog's parent is parent. The dialog will be modal and uses the specified widget flags.

so no , you can't use the method and don't block the main window until the user quits the dialog, BUT you can (imho is a bad idea) declare your own instance of a Dialog and show it instead of execute it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM