summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-01-25 15:31:16 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-01-26 07:10:44 +0000
commitd0a31fc05638d7c38c13caacf309a86e0d4cc187 (patch)
tree17ede6e0d27b9db66f171b895f73fd8607614be7 /src/libs
parent08bdace731aeeb34b50f5988223ed5c23a8cbb56 (diff)
Make LicenseAgreementPage license list & details browser user-resizable
Task-number: QTIFW-1987 Change-Id: Ide5a8b6912f96981de2fa79e02013d13bb17b43f Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/packagemanagergui.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 9887584aa..c33d9bb3b 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -67,6 +67,7 @@
#include <QProgressBar>
#include <QPushButton>
#include <QRadioButton>
+#include <QSplitter>
#include <QStringListModel>
#include <QTextBrowser>
@@ -1915,7 +1916,6 @@ LicenseAgreementPage::LicenseAgreementPage(PackageManagerCore *core)
m_licenseListWidget = new QListWidget(this);
m_licenseListWidget->setObjectName(QLatin1String("LicenseListWidget"));
- m_licenseListWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
connect(m_licenseListWidget, &QListWidget::currentItemChanged,
this, &LicenseAgreementPage::currentItemChanged);
@@ -1924,15 +1924,18 @@ LicenseAgreementPage::LicenseAgreementPage(PackageManagerCore *core)
m_textBrowser->setOpenLinks(false);
m_textBrowser->setOpenExternalLinks(true);
m_textBrowser->setObjectName(QLatin1String("LicenseTextBrowser"));
- m_textBrowser->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
connect(m_textBrowser, &QTextBrowser::anchorClicked, this, &LicenseAgreementPage::openLicenseUrl);
- QVBoxLayout *licenseBoxLayout = new QVBoxLayout();
- licenseBoxLayout->addWidget(m_licenseListWidget);
- licenseBoxLayout->addWidget(m_textBrowser);
+ QSplitter *licenseSplitter = new QSplitter(this);
+ licenseSplitter->setOrientation(Qt::Vertical);
+ licenseSplitter->setChildrenCollapsible(false);
+ licenseSplitter->addWidget(m_licenseListWidget);
+ licenseSplitter->addWidget(m_textBrowser);
+ licenseSplitter->setStretchFactor(0, 1);
+ licenseSplitter->setStretchFactor(1, 3);
QVBoxLayout *layout = new QVBoxLayout(this);
- layout->addLayout(licenseBoxLayout);
+ layout->addWidget(licenseSplitter);
m_acceptCheckBox = new QCheckBox(this);
m_acceptCheckBox->setShortcut(QKeySequence(tr("Alt+A", "agree license")));