summaryrefslogtreecommitdiffstats
path: root/installerbuilder/libinstaller/packagemanagergui.cpp
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2011-06-28 15:09:24 +0200
committerkh1 <qt-info@nokia.com>2011-06-28 15:09:24 +0200
commita4db26923e0a29e16da56eea8b80c5d1e5521372 (patch)
tree9c2b77ebd44e877936395bb9dfdc8d57eb5fe493 /installerbuilder/libinstaller/packagemanagergui.cpp
parentc071f76a7881b831a1cbc8a369b4ef9a75dd4e7e (diff)
Properly support different styles.
Make sure we put an empty character inside the sub title section, so the header will show up in all styles and not screw up the color of the pages (white and gray mixed).
Diffstat (limited to 'installerbuilder/libinstaller/packagemanagergui.cpp')
-rw-r--r--installerbuilder/libinstaller/packagemanagergui.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/installerbuilder/libinstaller/packagemanagergui.cpp b/installerbuilder/libinstaller/packagemanagergui.cpp
index 5d73bb30f..120aee9f6 100644
--- a/installerbuilder/libinstaller/packagemanagergui.cpp
+++ b/installerbuilder/libinstaller/packagemanagergui.cpp
@@ -77,6 +77,7 @@
#include <QtGui/QTreeView>
#include <QtGui/QVBoxLayout>
#include <QtGui/QScrollBar>
+#include <QtGui/QShowEvent>
#include <QtScript/QScriptEngine>
@@ -129,6 +130,7 @@ public:
setPixmap(QWizard::WatermarkPixmap, QPixmap());
setLayout(new QVBoxLayout);
+ setSubTitle(QLatin1String(""));
setTitle(widget->windowTitle());
m_widget->setProperty("complete", true);
m_widget->setProperty("final", false);
@@ -216,7 +218,6 @@ PackageManagerGui::PackageManagerGui(PackageManagerCore *core, QWidget *parent)
#ifndef Q_WS_MAC
setWindowIcon(QIcon(m_core->settings().icon()));
- setWizardStyle(QWizard::ModernStyle);
#else
setPixmap(QWizard::BackgroundPixmap, m_core->settings().background());
#endif
@@ -403,6 +404,21 @@ bool PackageManagerGui::event(QEvent* event)
return QWizard::event(event);
}
+void PackageManagerGui::showEvent(QShowEvent *event)
+{
+ if (!event->spontaneous()) {
+ foreach (int id, pageIds()) {
+ const QString subTitle = page(id)->subTitle();
+ if (subTitle.isEmpty()) {
+ const QWizard::WizardStyle style = wizardStyle();
+ if ((style == QWizard::ClassicStyle || style == QWizard::ModernStyle))
+ page(id)->setSubTitle(QLatin1String(" ")); // otherwise the colors might screw up
+ }
+ }
+ }
+ QWizard::showEvent(event);
+}
+
void PackageManagerGui::wizardPageInsertionRequested(QWidget* widget,
QInstaller::PackageManagerCore::WizardPage page)
{
@@ -546,8 +562,6 @@ PackageManagerPage::PackageManagerPage(PackageManagerCore *core)
, m_complete(true)
, m_core(core)
{
- // otherwise the colors will screw up
- setSubTitle(QLatin1String(" "));
}
PackageManagerCore *PackageManagerPage::packageManagerCore() const