Windows: Initialize the mouse cursor resources

Initializing resources is required for static Qt builds on Windows.

Task-number: QTBUG-42075
Change-Id: I3074fd8ab57ac48762f589eb3776ed5cc7e2e31d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Alessandro Portale 2014-10-21 11:46:32 +02:00
parent 763a48fe1a
commit 4fbd2dd4a6
2 changed files with 13 additions and 1 deletions

View File

@ -48,6 +48,13 @@
#include <QtCore/QDebug>
#include <QtCore/QScopedArrayPointer>
static void initResources()
{
#if !defined (Q_OS_WINCE) && !defined (QT_NO_IMAGEFORMAT_PNG)
Q_INIT_RESOURCE(cursors);
#endif
}
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0);
@ -568,6 +575,11 @@ QWindowsWindowCursor QWindowsCursor::pixmapWindowCursor(const QCursor &c)
return it.value();
}
QWindowsCursor::QWindowsCursor()
{
initResources();
}
/*!
\brief Set a cursor on a window.

View File

@ -91,7 +91,7 @@ public:
CursorSuppressed // Cursor suppressed by touch interaction (Windows 8).
};
QWindowsCursor() {}
QWindowsCursor();
void changeCursor(QCursor * widgetCursor, QWindow * widget) Q_DECL_OVERRIDE;
QPoint pos() const Q_DECL_OVERRIDE;