Commit ea96c245 authored by Friedemann Kleint's avatar Friedemann Kleint

Fix compilation with Qt 5/Windows.

- Adapt to qpa change,
  qtbase:36547f4eff44361f7a6acd0cff107c0e47561f93.
- Implement the progress bar icon for Qt 5/Windows.

Change-Id: I42def27fb5e05a6227ce56dd580a5e669d211855
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 29fd6bf6
......@@ -210,6 +210,7 @@ RESOURCES += core.qrc \
win32 {
SOURCES += progressmanager/progressmanager_win.cpp
greaterThan(QT_MAJOR_VERSION, 4): QT += gui-private # Uses QPlatformNativeInterface.
LIBS += -lole32
}
else:macx {
......
......@@ -39,7 +39,7 @@
#if QT_VERSION >= 0x050000
# include <QGuiApplication>
# include <QWindow>
# include <QPlatformNativeInterface>
# include <qpa/qplatformnativeinterface.h>
#endif
#include <QLabel>
......@@ -62,6 +62,8 @@ namespace {
#if QT_VERSION >= 0x050000
Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p);
static inline QWindow *windowOfWidget(const QWidget *widget)
{
if (QWindow *window = widget->windowHandle())
......@@ -121,7 +123,7 @@ void Core::Internal::ProgressManagerPrivate::setApplicationLabel(const QString &
if (text.isEmpty()) {
pITask->SetOverlayIcon(winId, NULL, NULL);
} else {
QPixmap pix = QPixmap(":/projectexplorer/images/compile_error.png");
QPixmap pix = QPixmap(QLatin1String(":/projectexplorer/images/compile_error.png"));
QPainter p(&pix);
p.setPen(Qt::white);
QFont font = p.font();
......@@ -129,11 +131,11 @@ void Core::Internal::ProgressManagerPrivate::setApplicationLabel(const QString &
p.setFont(font);
p.drawText(QRect(QPoint(0,0), pix.size()), Qt::AlignHCenter|Qt::AlignCenter, text);
#if QT_VERSION >= 0x050000
// See pixmaputils.cpp in the Windows plugin.
Q_UNIMPLEMENTED();
const HICON icon = qt_pixmapToWinHICON(pix);
#else
pITask->SetOverlayIcon(winId, pix.toWinHICON(), (wchar_t*)text.utf16());
const HICON icon = pix.toWinHICON();
#endif
pITask->SetOverlayIcon(winId, icon, (wchar_t*)text.utf16());
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment