Allow OSX config dialog to be resized

This commit is contained in:
craig.p.drummond
2014-10-10 19:47:59 +00:00
committed by craig.p.drummond
parent caaf5a5a8e
commit 1c0d4891ef
2 changed files with 19 additions and 1 deletions

View File

@@ -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)) {

View File

@@ -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;