From 7a0ae98978870fbc01e51c0ff60f9f51404d197b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 4 May 2011 14:58:13 +0200 Subject: [PATCH] Move some cursor handling to QGuiApplication from QApplication. --- src/gui/guikernel/qcursor.cpp | 4 +- src/gui/guikernel/qdnd.cpp | 14 +- src/gui/guikernel/qguiapplication.cpp | 290 +++++++++++++++++++++++++- src/gui/guikernel/qguiapplication.h | 12 +- src/gui/guikernel/qguiapplication_p.h | 9 + src/gui/kernel/qapplication.cpp | 270 ------------------------ src/gui/kernel/qapplication.h | 6 - src/gui/kernel/qapplication_p.h | 6 - src/gui/kernel/qapplication_qpa.cpp | 17 -- 9 files changed, 317 insertions(+), 311 deletions(-) diff --git a/src/gui/guikernel/qcursor.cpp b/src/gui/guikernel/qcursor.cpp index 823f6f1e8c..c2f92b4dce 100644 --- a/src/gui/guikernel/qcursor.cpp +++ b/src/gui/guikernel/qcursor.cpp @@ -43,7 +43,7 @@ #ifndef QT_NO_CURSOR -#include +#include #include #include #include @@ -410,7 +410,7 @@ void QCursorData::initialize() QCursor::QCursor() { if (!QCursorData::initialized) { - if (QApplication::startingUp()) { + if (QCoreApplication::startingUp()) { d = 0; return; } diff --git a/src/gui/guikernel/qdnd.cpp b/src/gui/guikernel/qdnd.cpp index 7063828610..db79b9042d 100644 --- a/src/gui/guikernel/qdnd.cpp +++ b/src/gui/guikernel/qdnd.cpp @@ -47,7 +47,7 @@ #include "qevent.h" #include "qfile.h" #include "qtextcodec.h" -#include "qapplication.h" +#include "qguiapplication.h" #include "qpoint.h" #include "qwidget.h" #include "qbuffer.h" @@ -60,7 +60,7 @@ #include "qdebug.h" #include -#include +#include #ifndef QT_NO_DRAGANDDROP @@ -154,7 +154,7 @@ QDragManager::~QDragManager() { #ifndef QT_NO_CURSOR if (restoreCursor) - QApplication::restoreOverrideCursor(); + QGuiApplication::restoreOverrideCursor(); #endif instance = 0; delete dropData; @@ -173,14 +173,14 @@ QPixmap QDragManager::dragCursor(Qt::DropAction action) const if (d && d->customCursors.contains(action)) return d->customCursors[action]; else if (action == Qt::MoveAction) - return QApplicationPrivate::instance()->getPixmapCursor(Qt::DragMoveCursor); + return QGuiApplicationPrivate::instance()->getPixmapCursor(Qt::DragMoveCursor); else if (action == Qt::CopyAction) - return QApplicationPrivate::instance()->getPixmapCursor(Qt::DragCopyCursor); + return QGuiApplicationPrivate::instance()->getPixmapCursor(Qt::DragCopyCursor); else if (action == Qt::LinkAction) - return QApplicationPrivate::instance()->getPixmapCursor(Qt::DragLinkCursor); + return QGuiApplicationPrivate::instance()->getPixmapCursor(Qt::DragLinkCursor); #ifdef Q_WS_WIN else if (action == Qt::IgnoreAction) - return QApplicationPrivate::instance()->getPixmapCursor(Qt::ForbiddenCursor); + return QGuiApplicationPrivate::instance()->getPixmapCursor(Qt::ForbiddenCursor); #endif return QPixmap(); } diff --git a/src/gui/guikernel/qguiapplication.cpp b/src/gui/guikernel/qguiapplication.cpp index ff84ef9f1d..24a3e333c1 100644 --- a/src/gui/guikernel/qguiapplication.cpp +++ b/src/gui/guikernel/qguiapplication.cpp @@ -64,6 +64,8 @@ #include "private/qwindow_p.h" #include "private/qkeymapper_p.h" +#include + #ifndef QT_NO_CLIPBOARD #include #endif @@ -144,6 +146,10 @@ QGuiApplication::~QGuiApplication() delete QGuiApplicationPrivate::qt_clipboard; QGuiApplicationPrivate::qt_clipboard = 0; + +#ifndef QT_NO_CURSOR + d->cursor_list.clear(); +#endif } QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags) @@ -466,7 +472,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo #if 0 if (self->inPopupMode()) { //popup mouse handling is magical... - mouseWindow = qApp->activePopupWidget(); + mouseWindow = qGuiApp->activePopupWidget(); implicit_mouse_grabber.clear(); //### how should popup mode and implicit mouse grab interact? @@ -878,6 +884,63 @@ Qt::LayoutDirection QGuiApplication::layoutDirection() return layout_direction; } +/*! + \fn QCursor *QGuiApplication::overrideCursor() + + Returns the active application override cursor. + + This function returns 0 if no application cursor has been defined (i.e. the + internal cursor stack is empty). + + \sa setOverrideCursor(), restoreOverrideCursor() +*/ +#ifndef QT_NO_CURSOR +QCursor *QGuiApplication::overrideCursor() +{ + return qGuiApp->d_func()->cursor_list.isEmpty() ? 0 : &qGuiApp->d_func()->cursor_list.first(); +} + +/*! + Changes the currently active application override cursor to \a cursor. + + This function has no effect if setOverrideCursor() was not called. + + \sa setOverrideCursor(), overrideCursor(), restoreOverrideCursor(), + QWidget::setCursor() + */ +void QGuiApplication::changeOverrideCursor(const QCursor &cursor) +{ + if (qGuiApp->d_func()->cursor_list.isEmpty()) + return; + qGuiApp->d_func()->cursor_list.removeFirst(); + setOverrideCursor(cursor); +} +#endif + +/*! + \fn void QGuiApplication::setOverrideCursor(const QCursor &cursor, bool replace) + + Use changeOverrideCursor(\a cursor) (if \a replace is true) or + setOverrideCursor(\a cursor) (if \a replace is false). +*/ + +#ifndef QT_NO_CURSOR +void QGuiApplication::setOverrideCursor(const QCursor &cursor) +{ + qGuiApp->d_func()->cursor_list.prepend(cursor); + qt_qpa_set_cursor(0, false); +} + +void QGuiApplication::restoreOverrideCursor() +{ + if (qGuiApp->d_func()->cursor_list.isEmpty()) + return; + qGuiApp->d_func()->cursor_list.removeFirst(); + qt_qpa_set_cursor(0, false); +} +#endif// QT_NO_CURSOR + + // Returns the current platform used by keyBindings uint QGuiApplicationPrivate::currentKeyPlatform() { @@ -935,5 +998,230 @@ Qt::LayoutDirection QGuiApplication::keyboardInputDirection() QFontDatabase::removeApplicationFont() */ +// These pixmaps approximate the images in the Windows User Interface Guidelines. + +// XPM + +static const char * const move_xpm[] = { +"11 20 3 1", +". c None", +#if defined(Q_WS_WIN) +"a c #000000", +"X c #FFFFFF", // Windows cursor is traditionally white +#else +"a c #FFFFFF", +"X c #000000", // X11 cursor is traditionally black +#endif +"aa.........", +"aXa........", +"aXXa.......", +"aXXXa......", +"aXXXXa.....", +"aXXXXXa....", +"aXXXXXXa...", +"aXXXXXXXa..", +"aXXXXXXXXa.", +"aXXXXXXXXXa", +"aXXXXXXaaaa", +"aXXXaXXa...", +"aXXaaXXa...", +"aXa..aXXa..", +"aa...aXXa..", +"a.....aXXa.", +"......aXXa.", +".......aXXa", +".......aXXa", +"........aa."}; + +#ifdef Q_WS_WIN +/* XPM */ +static const char * const ignore_xpm[] = { +"24 30 3 1", +". c None", +"a c #000000", +"X c #FFFFFF", +"aa......................", +"aXa.....................", +"aXXa....................", +"aXXXa...................", +"aXXXXa..................", +"aXXXXXa.................", +"aXXXXXXa................", +"aXXXXXXXa...............", +"aXXXXXXXXa..............", +"aXXXXXXXXXa.............", +"aXXXXXXaaaa.............", +"aXXXaXXa................", +"aXXaaXXa................", +"aXa..aXXa...............", +"aa...aXXa...............", +"a.....aXXa..............", +"......aXXa.....XXXX.....", +".......aXXa..XXaaaaXX...", +".......aXXa.XaaaaaaaaX..", +"........aa.XaaaXXXXaaaX.", +"...........XaaaaX..XaaX.", +"..........XaaXaaaX..XaaX", +"..........XaaXXaaaX.XaaX", +"..........XaaX.XaaaXXaaX", +"..........XaaX..XaaaXaaX", +"...........XaaX..XaaaaX.", +"...........XaaaXXXXaaaX.", +"............XaaaaaaaaX..", +".............XXaaaaXX...", +"...............XXXX....."}; +#endif + +/* XPM */ +static const char * const copy_xpm[] = { +"24 30 3 1", +". c None", +"a c #000000", +"X c #FFFFFF", +#if defined(Q_WS_WIN) // Windows cursor is traditionally white +"aa......................", +"aXa.....................", +"aXXa....................", +"aXXXa...................", +"aXXXXa..................", +"aXXXXXa.................", +"aXXXXXXa................", +"aXXXXXXXa...............", +"aXXXXXXXXa..............", +"aXXXXXXXXXa.............", +"aXXXXXXaaaa.............", +"aXXXaXXa................", +"aXXaaXXa................", +"aXa..aXXa...............", +"aa...aXXa...............", +"a.....aXXa..............", +"......aXXa..............", +".......aXXa.............", +".......aXXa.............", +"........aa...aaaaaaaaaaa", +#else +"XX......................", +"XaX.....................", +"XaaX....................", +"XaaaX...................", +"XaaaaX..................", +"XaaaaaX.................", +"XaaaaaaX................", +"XaaaaaaaX...............", +"XaaaaaaaaX..............", +"XaaaaaaaaaX.............", +"XaaaaaaXXXX.............", +"XaaaXaaX................", +"XaaXXaaX................", +"XaX..XaaX...............", +"XX...XaaX...............", +"X.....XaaX..............", +"......XaaX..............", +".......XaaX.............", +".......XaaX.............", +"........XX...aaaaaaaaaaa", +#endif +".............aXXXXXXXXXa", +".............aXXXXXXXXXa", +".............aXXXXaXXXXa", +".............aXXXXaXXXXa", +".............aXXaaaaaXXa", +".............aXXXXaXXXXa", +".............aXXXXaXXXXa", +".............aXXXXXXXXXa", +".............aXXXXXXXXXa", +".............aaaaaaaaaaa"}; + +/* XPM */ +static const char * const link_xpm[] = { +"24 30 3 1", +". c None", +"a c #000000", +"X c #FFFFFF", +#if defined(Q_WS_WIN) // Windows cursor is traditionally white +"aa......................", +"aXa.....................", +"aXXa....................", +"aXXXa...................", +"aXXXXa..................", +"aXXXXXa.................", +"aXXXXXXa................", +"aXXXXXXXa...............", +"aXXXXXXXXa..............", +"aXXXXXXXXXa.............", +"aXXXXXXaaaa.............", +"aXXXaXXa................", +"aXXaaXXa................", +"aXa..aXXa...............", +"aa...aXXa...............", +"a.....aXXa..............", +"......aXXa..............", +".......aXXa.............", +".......aXXa.............", +"........aa...aaaaaaaaaaa", +#else +"XX......................", +"XaX.....................", +"XaaX....................", +"XaaaX...................", +"XaaaaX..................", +"XaaaaaX.................", +"XaaaaaaX................", +"XaaaaaaaX...............", +"XaaaaaaaaX..............", +"XaaaaaaaaaX.............", +"XaaaaaaXXXX.............", +"XaaaXaaX................", +"XaaXXaaX................", +"XaX..XaaX...............", +"XX...XaaX...............", +"X.....XaaX..............", +"......XaaX..............", +".......XaaX.............", +".......XaaX.............", +"........XX...aaaaaaaaaaa", +#endif +".............aXXXXXXXXXa", +".............aXXXaaaaXXa", +".............aXXXXaaaXXa", +".............aXXXaaaaXXa", +".............aXXaaaXaXXa", +".............aXXaaXXXXXa", +".............aXXaXXXXXXa", +".............aXXXaXXXXXa", +".............aXXXXXXXXXa", +".............aaaaaaaaaaa"}; + +QPixmap QGuiApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) +{ +#if defined(Q_WS_X11) || defined(Q_WS_WIN) + if (!move_cursor) { + move_cursor = new QPixmap((const char **)move_xpm); + copy_cursor = new QPixmap((const char **)copy_xpm); + link_cursor = new QPixmap((const char **)link_xpm); +#ifdef Q_WS_WIN + ignore_cursor = new QPixmap((const char **)ignore_xpm); +#endif + } + + switch (cshape) { + case Qt::DragMoveCursor: + return *move_cursor; + case Qt::DragCopyCursor: + return *copy_cursor; + case Qt::DragLinkCursor: + return *link_cursor; +#ifdef Q_WS_WIN + case Qt::ForbiddenCursor: + return *ignore_cursor; +#endif + default: + break; + } +#else + Q_UNUSED(cshape); +#endif + return QPixmap(); +} QT_END_NAMESPACE diff --git a/src/gui/guikernel/qguiapplication.h b/src/gui/guikernel/qguiapplication.h index f1ac01dcfc..980e275a61 100644 --- a/src/gui/guikernel/qguiapplication.h +++ b/src/gui/guikernel/qguiapplication.h @@ -57,6 +57,16 @@ QT_MODULE(Gui) class QGuiApplicationPrivate; class QPlatformNativeInterface; +#if defined(qApp) +#undef qApp +#endif +#define qApp (static_cast(QCoreApplication::instance())) + +#if defined(qGuiApp) +#undef qGuiApp +#endif +#define qGuiApp (static_cast(QCoreApplication::instance())) + class Q_GUI_EXPORT QGuiApplication : public QCoreApplication { Q_OBJECT @@ -68,13 +78,11 @@ public: QGuiApplication(int &argc, char **argv, int = ApplicationFlags); virtual ~QGuiApplication(); -#if 0 #ifndef QT_NO_CURSOR static QCursor *overrideCursor(); static void setOverrideCursor(const QCursor &); static void changeOverrideCursor(const QCursor &); static void restoreOverrideCursor(); -#endif #endif static QFont font(); diff --git a/src/gui/guikernel/qguiapplication_p.h b/src/gui/guikernel/qguiapplication_p.h index 5236eac619..fc6c69748c 100644 --- a/src/gui/guikernel/qguiapplication_p.h +++ b/src/gui/guikernel/qguiapplication_p.h @@ -130,6 +130,9 @@ public: return alignment; } + QPixmap getPixmapCursor(Qt::CursorShape cshape); + + static QGuiApplicationPrivate *instance() { return self; } static bool app_do_modal; @@ -146,6 +149,10 @@ public: static QClipboard *qt_clipboard; #endif +#ifndef QT_NO_CURSOR + QList cursor_list; +#endif + static QFont *app_font; private: void init(); @@ -153,6 +160,8 @@ private: static QGuiApplicationPrivate *self; }; +extern void qt_qpa_set_cursor(QWidget *, bool); + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index d447c94ae5..9a9d46db5a 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -1124,9 +1124,6 @@ QApplication::~QApplication() QApplicationPrivate::app_style = 0; delete QApplicationPrivate::app_icon; QApplicationPrivate::app_icon = 0; -#ifndef QT_NO_CURSOR - d->cursor_list.clear(); -#endif #ifndef QT_NO_DRAGANDDROP if (qt_is_gui_used) @@ -3551,47 +3548,6 @@ Qt::Alignment QApplication::horizontalAlignment(Qt::Alignment align) } #endif - -/*! - \fn QCursor *QApplication::overrideCursor() - - Returns the active application override cursor. - - This function returns 0 if no application cursor has been defined (i.e. the - internal cursor stack is empty). - - \sa setOverrideCursor(), restoreOverrideCursor() -*/ -#ifndef QT_NO_CURSOR -QCursor *QApplication::overrideCursor() -{ - return qApp->d_func()->cursor_list.isEmpty() ? 0 : &qApp->d_func()->cursor_list.first(); -} - -/*! - Changes the currently active application override cursor to \a cursor. - - This function has no effect if setOverrideCursor() was not called. - - \sa setOverrideCursor(), overrideCursor(), restoreOverrideCursor(), - QWidget::setCursor() - */ -void QApplication::changeOverrideCursor(const QCursor &cursor) -{ - if (qApp->d_func()->cursor_list.isEmpty()) - return; - qApp->d_func()->cursor_list.removeFirst(); - setOverrideCursor(cursor); -} -#endif - -/*! - \fn void QApplication::setOverrideCursor(const QCursor &cursor, bool replace) - - Use changeOverrideCursor(\a cursor) (if \a replace is true) or - setOverrideCursor(\a cursor) (if \a replace is false). -*/ - /*! Enters the main event loop and waits until exit() is called, then returns the value that was set to exit() (which is 0 if exit() is called via @@ -5733,232 +5689,6 @@ QGestureManager* QGestureManager::instance() } #endif // QT_NO_GESTURES -// These pixmaps approximate the images in the Windows User Interface Guidelines. - -// XPM - -static const char * const move_xpm[] = { -"11 20 3 1", -". c None", -#if defined(Q_WS_WIN) -"a c #000000", -"X c #FFFFFF", // Windows cursor is traditionally white -#else -"a c #FFFFFF", -"X c #000000", // X11 cursor is traditionally black -#endif -"aa.........", -"aXa........", -"aXXa.......", -"aXXXa......", -"aXXXXa.....", -"aXXXXXa....", -"aXXXXXXa...", -"aXXXXXXXa..", -"aXXXXXXXXa.", -"aXXXXXXXXXa", -"aXXXXXXaaaa", -"aXXXaXXa...", -"aXXaaXXa...", -"aXa..aXXa..", -"aa...aXXa..", -"a.....aXXa.", -"......aXXa.", -".......aXXa", -".......aXXa", -"........aa."}; - -#ifdef Q_WS_WIN -/* XPM */ -static const char * const ignore_xpm[] = { -"24 30 3 1", -". c None", -"a c #000000", -"X c #FFFFFF", -"aa......................", -"aXa.....................", -"aXXa....................", -"aXXXa...................", -"aXXXXa..................", -"aXXXXXa.................", -"aXXXXXXa................", -"aXXXXXXXa...............", -"aXXXXXXXXa..............", -"aXXXXXXXXXa.............", -"aXXXXXXaaaa.............", -"aXXXaXXa................", -"aXXaaXXa................", -"aXa..aXXa...............", -"aa...aXXa...............", -"a.....aXXa..............", -"......aXXa.....XXXX.....", -".......aXXa..XXaaaaXX...", -".......aXXa.XaaaaaaaaX..", -"........aa.XaaaXXXXaaaX.", -"...........XaaaaX..XaaX.", -"..........XaaXaaaX..XaaX", -"..........XaaXXaaaX.XaaX", -"..........XaaX.XaaaXXaaX", -"..........XaaX..XaaaXaaX", -"...........XaaX..XaaaaX.", -"...........XaaaXXXXaaaX.", -"............XaaaaaaaaX..", -".............XXaaaaXX...", -"...............XXXX....."}; -#endif - -/* XPM */ -static const char * const copy_xpm[] = { -"24 30 3 1", -". c None", -"a c #000000", -"X c #FFFFFF", -#if defined(Q_WS_WIN) // Windows cursor is traditionally white -"aa......................", -"aXa.....................", -"aXXa....................", -"aXXXa...................", -"aXXXXa..................", -"aXXXXXa.................", -"aXXXXXXa................", -"aXXXXXXXa...............", -"aXXXXXXXXa..............", -"aXXXXXXXXXa.............", -"aXXXXXXaaaa.............", -"aXXXaXXa................", -"aXXaaXXa................", -"aXa..aXXa...............", -"aa...aXXa...............", -"a.....aXXa..............", -"......aXXa..............", -".......aXXa.............", -".......aXXa.............", -"........aa...aaaaaaaaaaa", -#else -"XX......................", -"XaX.....................", -"XaaX....................", -"XaaaX...................", -"XaaaaX..................", -"XaaaaaX.................", -"XaaaaaaX................", -"XaaaaaaaX...............", -"XaaaaaaaaX..............", -"XaaaaaaaaaX.............", -"XaaaaaaXXXX.............", -"XaaaXaaX................", -"XaaXXaaX................", -"XaX..XaaX...............", -"XX...XaaX...............", -"X.....XaaX..............", -"......XaaX..............", -".......XaaX.............", -".......XaaX.............", -"........XX...aaaaaaaaaaa", -#endif -".............aXXXXXXXXXa", -".............aXXXXXXXXXa", -".............aXXXXaXXXXa", -".............aXXXXaXXXXa", -".............aXXaaaaaXXa", -".............aXXXXaXXXXa", -".............aXXXXaXXXXa", -".............aXXXXXXXXXa", -".............aXXXXXXXXXa", -".............aaaaaaaaaaa"}; - -/* XPM */ -static const char * const link_xpm[] = { -"24 30 3 1", -". c None", -"a c #000000", -"X c #FFFFFF", -#if defined(Q_WS_WIN) // Windows cursor is traditionally white -"aa......................", -"aXa.....................", -"aXXa....................", -"aXXXa...................", -"aXXXXa..................", -"aXXXXXa.................", -"aXXXXXXa................", -"aXXXXXXXa...............", -"aXXXXXXXXa..............", -"aXXXXXXXXXa.............", -"aXXXXXXaaaa.............", -"aXXXaXXa................", -"aXXaaXXa................", -"aXa..aXXa...............", -"aa...aXXa...............", -"a.....aXXa..............", -"......aXXa..............", -".......aXXa.............", -".......aXXa.............", -"........aa...aaaaaaaaaaa", -#else -"XX......................", -"XaX.....................", -"XaaX....................", -"XaaaX...................", -"XaaaaX..................", -"XaaaaaX.................", -"XaaaaaaX................", -"XaaaaaaaX...............", -"XaaaaaaaaX..............", -"XaaaaaaaaaX.............", -"XaaaaaaXXXX.............", -"XaaaXaaX................", -"XaaXXaaX................", -"XaX..XaaX...............", -"XX...XaaX...............", -"X.....XaaX..............", -"......XaaX..............", -".......XaaX.............", -".......XaaX.............", -"........XX...aaaaaaaaaaa", -#endif -".............aXXXXXXXXXa", -".............aXXXaaaaXXa", -".............aXXXXaaaXXa", -".............aXXXaaaaXXa", -".............aXXaaaXaXXa", -".............aXXaaXXXXXa", -".............aXXaXXXXXXa", -".............aXXXaXXXXXa", -".............aXXXXXXXXXa", -".............aaaaaaaaaaa"}; - -QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) -{ -#if defined(Q_WS_X11) || defined(Q_WS_WIN) - if (!move_cursor) { - move_cursor = new QPixmap((const char **)move_xpm); - copy_cursor = new QPixmap((const char **)copy_xpm); - link_cursor = new QPixmap((const char **)link_xpm); -#ifdef Q_WS_WIN - ignore_cursor = new QPixmap((const char **)ignore_xpm); -#endif - } - - switch (cshape) { - case Qt::DragMoveCursor: - return *move_cursor; - case Qt::DragCopyCursor: - return *copy_cursor; - case Qt::DragLinkCursor: - return *link_cursor; -#ifdef Q_WS_WIN - case Qt::ForbiddenCursor: - return *ignore_cursor; -#endif - default: - break; - } -#else - Q_UNUSED(cshape); -#endif - return QPixmap(); -} - QString QApplicationPrivate::qmljsDebugArgumentsString() { return qmljs_debug_arguments; diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index c8df2cd9af..9db3b57030 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -156,12 +156,6 @@ public: // ### Qt4 compatibility, remove? static inline void setGraphicsSystem(const QString &) {} -#ifndef QT_NO_CURSOR - static QCursor *overrideCursor(); - static void setOverrideCursor(const QCursor &); - static void changeOverrideCursor(const QCursor &); - static void restoreOverrideCursor(); -#endif static QPalette palette(); static QPalette palette(const QWidget *); static QPalette palette(const char *className); diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 5033d6ce43..5e8ea1f21d 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -367,9 +367,6 @@ public: bool is_session_restored; #endif -#ifndef QT_NO_CURSOR - QList cursor_list; -#endif #ifndef QT_NO_GRAPHICSVIEW // Maintain a list of all scenes to ensure font and palette propagation to // all scenes. @@ -528,7 +525,6 @@ public: #if defined(Q_WS_WIN) QPixmap *ignore_cursor; #endif - QPixmap getPixmapCursor(Qt::CursorShape cshape); QMap > widgetForTouchPointId; QMap appCurrentTouchPoints; @@ -622,8 +618,6 @@ Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window, extern void qt_x11_enforce_cursor(QWidget *); #elif defined(Q_OS_SYMBIAN) extern void qt_symbian_set_cursor(QWidget *, bool); -#elif defined (Q_WS_QPA) - extern void qt_qpa_set_cursor(QWidget *, bool); #endif QT_END_NAMESPACE diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp index 30ae8cf3f1..e1876e41a9 100644 --- a/src/gui/kernel/qapplication_qpa.cpp +++ b/src/gui/kernel/qapplication_qpa.cpp @@ -333,23 +333,6 @@ bool QApplication::isEffectEnabled(Qt::UIEffect effect) } } -#ifndef QT_NO_CURSOR -void QApplication::setOverrideCursor(const QCursor &cursor) -{ - qApp->d_func()->cursor_list.prepend(cursor); - qt_qpa_set_cursor(0, false); -} - -void QApplication::restoreOverrideCursor() -{ - if (qApp->d_func()->cursor_list.isEmpty()) - return; - qApp->d_func()->cursor_list.removeFirst(); - qt_qpa_set_cursor(0, false); -} - -#endif// QT_NO_CURSOR - QWidget *QApplication::topLevelAt(const QPoint &pos) { QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();