mirror of
https://github.com/QuasarApp/installer-framework.git
synced 2025-04-28 06:24:32 +00:00
Fix wizard's maximum size
User can set height and width for wizard in config.xml. If the given dimentions does not fit to the screen, wizard was clipped and buttons were of the screen. Fixed so that the screen size cannot be exceeded. Task-number: QTIFW-1016 Change-Id: Iab6970d4203fc1271b93475aec71c946d0508653 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
This commit is contained in:
parent
a16f67ea99
commit
0886f83a9a
@ -73,6 +73,7 @@
|
||||
#include <QShowEvent>
|
||||
#include <QFileDialog>
|
||||
#include <QGroupBox>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qt_windows.h>
|
||||
@ -382,8 +383,16 @@ PackageManagerGui::PackageManagerGui(PackageManagerCore *core, QWidget *parent)
|
||||
d->m_defaultButtonText.insert(i, buttonText(QWizard::WizardButton(i)));
|
||||
|
||||
m_core->setGuiObject(this);
|
||||
|
||||
// We need to create this ugly hack so that the installer doesn't exceed the maximum size of the
|
||||
// screen. The screen size where the widget lies is not available until the widget is visible.
|
||||
QTimer::singleShot(30, this, SLOT(setMaxSize()));
|
||||
}
|
||||
|
||||
void PackageManagerGui::setMaxSize()
|
||||
{
|
||||
setMaximumSize(qApp->desktop()->availableGeometry(this).size());
|
||||
}
|
||||
/*!
|
||||
Destructs a package manager UI.
|
||||
*/
|
||||
|
@ -106,6 +106,7 @@ public Q_SLOTS:
|
||||
void rejectWithoutPrompt();
|
||||
void showFinishedPage();
|
||||
void setModified(bool value);
|
||||
void setMaxSize();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void wizardPageInsertionRequested(QWidget *widget, QInstaller::PackageManagerCore::WizardPage page);
|
||||
|
Loading…
x
Reference in New Issue
Block a user