diff options
-rw-r--r-- | src/plugins/platforms/windows/qwindowscursor.cpp | 3 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsscreen.cpp | 11 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsscreen.h | 8 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 10 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 4 |
5 files changed, 34 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp index 0479eb6d58..4dc9af61d8 100644 --- a/src/plugins/platforms/windows/qwindowscursor.cpp +++ b/src/plugins/platforms/windows/qwindowscursor.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#ifndef QT_NO_CURSOR #include "qwindowscursor.h" #include "qwindowscontext.h" #include "qwindowswindow.h" @@ -498,3 +499,5 @@ HCURSOR QWindowsWindowCursor::handle() const } QT_END_NAMESPACE + +#endif // !QT_NO_CURSOR diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 9bb16793cc..f616972aa0 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -168,8 +168,10 @@ static QDebug operator<<(QDebug dbg, const QWindowsScreenData &d) // Return the cursor to be shared by all screens (virtual desktop). static inline QSharedPointer<QWindowsCursor> sharedCursor() { +#ifndef QT_NO_CURSOR if (const QScreen *primaryScreen = QGuiApplication::primaryScreen()) return static_cast<const QWindowsScreen *>(primaryScreen->handle())->windowsCursor(); +#endif return QSharedPointer<QWindowsCursor>(new QWindowsCursor); } @@ -182,7 +184,10 @@ static inline QSharedPointer<QWindowsCursor> sharedCursor() */ QWindowsScreen::QWindowsScreen(const QWindowsScreenData &data) : - m_data(data), m_cursor(sharedCursor()) + m_data(data) +#ifndef QT_NO_CURSOR + ,m_cursor(sharedCursor()) +#endif { } @@ -250,7 +255,11 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags) QWindow *QWindowsScreen::windowUnderMouse(unsigned flags) { +#ifndef QT_NO_CURSOR return QWindowsScreen::windowAt(QWindowsCursor::mousePosition(), flags); +#else + return 0; +#endif } QWindowsScreen *QWindowsScreen::screenOf(const QWindow *w) diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h index 7da1a4d207..216973125b 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.h +++ b/src/plugins/platforms/windows/qwindowsscreen.h @@ -79,7 +79,9 @@ struct QWindowsScreenData class QWindowsScreen : public QPlatformScreen { public: +#ifndef QT_NO_CURSOR typedef QSharedPointer<QWindowsCursor> WindowsCursorPtr; +#endif explicit QWindowsScreen(const QWindowsScreenData &data); @@ -106,14 +108,20 @@ public: inline void handleChanges(const QWindowsScreenData &newData); +#ifndef QT_NO_CURSOR QPlatformCursor *cursor() const { return m_cursor.data(); } const WindowsCursorPtr &windowsCursor() const { return m_cursor; } +#else + QPlatformCursor *cursor() const { return 0; } +#endif // !QT_NO_CURSOR const QWindowsScreenData &data() const { return m_data; } private: QWindowsScreenData m_data; +#ifndef QT_NO_CURSOR const WindowsCursorPtr m_cursor; +#endif }; class QWindowsScreenManager diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 2ebc3a06fa..3530f0af68 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -44,7 +44,9 @@ #include "qwindowscontext.h" #include "qwindowsdrag.h" #include "qwindowsscreen.h" -#include "qwindowscursor.h" +#ifdef QT_NO_CURSOR +# include "qwindowscursor.h" +#endif #ifdef QT_OPENGL_ES_2 # include "qwindowseglcontext.h" @@ -726,7 +728,9 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : m_hdc(0), m_windowState(Qt::WindowNoState), m_opacity(1.0), +#ifndef QT_NO_CURSOR m_cursor(QWindowsScreen::screenOf(aWindow)->windowsCursor()->standardWindowCursor()), +#endif m_dropTarget(0), m_savedStyle(0), m_format(aWindow->format()), @@ -1649,11 +1653,14 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const void QWindowsWindow::applyCursor() { +#ifndef QT_NO_CURSOR SetCursor(m_cursor.handle()); +#endif } void QWindowsWindow::setCursor(const QWindowsWindowCursor &c) { +#ifndef QT_NO_CURSOR if (c.handle() != m_cursor.handle()) { const bool underMouse = QWindowsContext::instance()->windowUnderMouse() == window(); if (QWindowsContext::verboseWindows) @@ -1663,6 +1670,7 @@ void QWindowsWindow::setCursor(const QWindowsWindowCursor &c) if (underMouse) applyCursor(); } +#endif } /*! diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index c30b6e62b0..f3b480b0af 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -224,7 +224,9 @@ public: void getSizeHints(MINMAXINFO *mmi) const; #endif +#ifndef QT_NO_CURSOR QWindowsWindowCursor cursor() const { return m_cursor; } +#endif void setCursor(const QWindowsWindowCursor &c); void applyCursor(); @@ -270,7 +272,9 @@ private: HDC m_hdc; Qt::WindowState m_windowState; qreal m_opacity; +#ifndef QT_NO_CURSOR QWindowsWindowCursor m_cursor; +#endif QWindowsOleDropTarget *m_dropTarget; unsigned m_savedStyle; QRect m_savedFrameGeometry; |