ui: adapt window size to contents if bigger than preferred size

This commit is contained in:
Eberhard Graether
2016-03-11 21:50:07 +01:00
parent f6e2821430
commit 813cde4d26
4 changed files with 15 additions and 5 deletions
@@ -76,7 +76,7 @@ void QtProjectWizzardContentPaths::populateForm(QGridLayout* layout, int& row)
QSize QtProjectWizzardContentPaths::preferredWindowSize() const
{
return QSize(850, 500);
return QSize(750, 500);
}
void QtProjectWizzardContentPaths::setInfo(const QString& title, const QString& description, const QString& help)
@@ -119,7 +119,7 @@ QtProjectWizzardContentPathsSource::QtProjectWizzardContentPathsSource(
QSize QtProjectWizzardContentPathsSource::preferredWindowSize() const
{
return QSize(850, 370);
return QSize(750, 370);
}
void QtProjectWizzardContentPathsSource::load()
@@ -112,7 +112,7 @@ void QtProjectWizzardContentSelect::populateWindow(QGridLayout* layout)
layout->addWidget(container, 0, QtProjectWizzardWindow::BACK_COL);
m_description = new QLabel();
m_description = new QLabel(" \n \n");
m_description->setWordWrap(true);
m_description->setOpenExternalLinks(true);
m_description->setObjectName("projectDescription");
@@ -132,5 +132,5 @@ bool QtProjectWizzardContentSimple::check()
QSize QtProjectWizzardContentSimple::preferredWindowSize() const
{
return QSize(750, 350);
return QSize(650, 350);
}
@@ -66,7 +66,17 @@ void QtProjectWizzardWindow::windowReady()
m_content->windowReady();
resize(content()->preferredWindowSize());
QSize actualSize = m_window->sizeHint() + QSize(50, 50);
QSize preferredSize = content()->preferredWindowSize();
if (actualSize.height() > preferredSize.height())
{
resize(actualSize);
}
else
{
resize(preferredSize);
}
}
void QtProjectWizzardWindow::handleNext()