From 1c0d4891ef86c7d8bd2d900dbf1c43f0eb298f18 Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Fri, 10 Oct 2014 19:47:59 +0000 Subject: [PATCH] Allow OSX config dialog to be resized --- support/configdialog.cpp | 18 ++++++++++++++++++ support/configdialog.h | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/support/configdialog.cpp b/support/configdialog.cpp index cdb49c57a..96fafd5a6 100644 --- a/support/configdialog.cpp +++ b/support/configdialog.cpp @@ -213,6 +213,10 @@ bool ConfigDialog::setCurrentPage(const QString &id) setCaption(it.value().item->text()); it.value().item->setChecked(true); } + if (isVisible()) { + it.value().widget->ensurePolished(); + ensurePolished(); + } int newH=it.value().widget->sizeHint().height()+toolBar->height()+buttonBox->height()+layout()->spacing()+(2*layout()->margin()); if (isVisible()) { if (newH!=height()) { @@ -226,6 +230,8 @@ bool ConfigDialog::setCurrentPage(const QString &id) } } else { setFixedHeight(newH); + resize(width(), newH); + setMaximumHeight(QWIDGETSIZE_MAX); } #else pageWidget->setCurrentPage(pages[id]); @@ -233,6 +239,18 @@ bool ConfigDialog::setCurrentPage(const QString &id) return true; } +#ifdef __APPLE__ +void ConfigDialog::setH(int h) +{ + if (h==resizeAnim->endValue().toInt()) { + setMaximumHeight(QWIDGETSIZE_MAX); + resize(width(), h); + } else { + setFixedHeight(h); + } +} +#endif + QWidget * ConfigDialog::getPage(const QString &id) const { if (!pages.contains(id)) { diff --git a/support/configdialog.h b/support/configdialog.h index acf815867..7e17e7ad6 100644 --- a/support/configdialog.h +++ b/support/configdialog.h @@ -68,7 +68,7 @@ public: void accept(); void reject(); int getH() const { return height(); } - void setH(int h) { setFixedHeight(h); } + void setH(int h); #endif virtual void save()=0;