diff options
-rw-r--r-- | gui/main-window.cpp | 24 | ||||
-rw-r--r-- | gui/main.cpp | 2 |
2 files changed, 10 insertions, 16 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp index 17702789..e12b85a7 100644 --- a/gui/main-window.cpp +++ b/gui/main-window.cpp @@ -46,9 +46,7 @@ MainWindow::MainWindow() : ui.setupUi(this); { - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - adjustSize(); - setFixedSize(size()); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | windowFlags()); } @@ -587,13 +585,15 @@ bool MainWindow::mk_window_common(ptr<t>& d, F&& ctor) } else if ((d = ptr<t>(ctor()))) { - QEventLoop e(d.get()); + QWidget& w = *d; - e.processEvents(); d->adjustSize(); e.processEvents(); + w.setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | w.windowFlags()); - // drain the event loop to reflow properly - d->setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | d->windowFlags()); e.processEvents(); - d->show(); + w.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + + w.show(); + w.adjustSize(); + w.setFixedSize(w.size()); return true; } @@ -616,14 +616,6 @@ bool MainWindow::mk_dialog(std::shared_ptr<dylib> lib, ptr<t>& d) return nullptr; }); - if (just_created) - { - using plugin_api::detail::BaseDialog; - QObject::connect(static_cast<BaseDialog*>(d.get()), &BaseDialog::closing, - this, [&d]() { d = nullptr; }, - Qt::QueuedConnection); - } - return just_created; } diff --git a/gui/main.cpp b/gui/main.cpp index 99f63267..3481c534 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -178,6 +178,8 @@ main(int argc, char** argv) { w->setVisible(true); w->show(); + w->adjustSize(); + w->setFixedSize(w->size()); } else w->setVisible(false); |