summaryrefslogtreecommitdiffhomepage
path: root/gui/main-window.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-09-22 14:17:14 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-09-22 14:25:26 +0200
commit125c1673c267fdff97332adc82436c66342a9bf9 (patch)
tree88b62e094e08d472b0cb3588d4619974ef65c07e /gui/main-window.cpp
parent55fe003f5ca47def59057df9d51661a483eec894 (diff)
gui: call adjust-size() after show()
Diffstat (limited to 'gui/main-window.cpp')
-rw-r--r--gui/main-window.cpp24
1 files changed, 8 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;
}