summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/performinstallationform.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-09-10 11:54:44 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-09-11 11:11:45 +0200
commit520a9f300fb0c14a704bb2cad3fb555a47a1ddbc (patch)
treef158ec390b4dc722b40a7a86e43ec022a5d77a83 /src/libs/installer/performinstallationform.cpp
parentdbd94d02756d48f2412be1c02e59ba4f13b572c7 (diff)
Implement progress indicator on taskbar on Windows.
Task-number: QTIFW-15 Change-Id: Ia11c185f25dff2f1614425ec5ff78e79b2fa2a77 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/libs/installer/performinstallationform.cpp')
-rw-r--r--src/libs/installer/performinstallationform.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libs/installer/performinstallationform.cpp b/src/libs/installer/performinstallationform.cpp
index 5480b397a..2405fc49b 100644
--- a/src/libs/installer/performinstallationform.cpp
+++ b/src/libs/installer/performinstallationform.cpp
@@ -44,7 +44,7 @@
#include "lazyplaintextedit.h"
#include "progresscoordinator.h"
-
+#include <QApplication>
#include <QLabel>
#include <QProgressBar>
#include <QPushButton>
@@ -53,6 +53,11 @@
#include <QtCore/QTimer>
+#ifdef Q_OS_WIN
+# include <QWinTaskbarButton>
+# include <QWinTaskbarProgress>
+#endif
+
using namespace QInstaller;
// -- PerformInstallationForm
@@ -65,6 +70,10 @@ PerformInstallationForm::PerformInstallationForm(QObject *parent)
, m_detailsBrowser(0)
, m_updateTimer(0)
{
+#ifdef Q_OS_WIN
+ m_taskButton = new QWinTaskbarButton(this);
+ m_taskButton->progress()->setVisible(true);
+#endif
}
void PerformInstallationForm::setupUi(QWidget *widget)
@@ -136,6 +145,11 @@ void PerformInstallationForm::updateProgress()
const int progressPercentage = progressCoordninator->progressInPercentage();
m_progressBar->setValue(progressPercentage);
+#ifdef Q_OS_WIN
+ if (!m_taskButton->window())
+ m_taskButton->setWindow(QApplication::activeWindow()->windowHandle());
+ m_taskButton->progress()->setValue(progressPercentage);
+#endif
static QString lastLabelText;
if (lastLabelText == progressCoordninator->labelText())