Child window elements are blocked
Solved
General and Desktop
-
Hi!
I have three windows: MainWindow, SelectPreset, Preset.
The SelectPreset window is called from the MainWindow window.
And the Preset window is called from the SelectPreset window.
But I can't understand why the Preset window elements are blocked (At the same time, this happens for some reason in Debian, in other systems I did not notice this).Here's how my files work:
mainwindow.cpp
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } . . . SelectPreset select_preset; select_preset.setModal(true); select_preset.exec();
selectpreset.cpp
SelectPreset::SelectPreset(QWidget *parent) : QDialog(parent), ui_selectpreset(new Ui::SelectPreset) { ui_selectpreset->setupUi(this); } . . . Preset preset; preset.setModal(true); preset.exec();
preset.cpp
Preset::Preset(QWidget *parent) : QDialog(parent), ui_preset(new Ui::Preset) { ui_preset->setupUi(this); }
-
Modal windows will start their own event loop and block other windows.
exec
will always start a new event loop and show a modal dialog. If you dont want modal windows, useshow()
for example.
https://doc.qt.io/qt-5/qdialog.html#modal-prop