}
}
+static inline void applyWindowCursor(const QList<QWindow *> &l)
+{
+ for (int i = 0; i < l.size(); ++i) {
+ QWindow *w = l.at(i);
+ if (w->handle() && w->windowType() != Qt::Desktop)
+ applyCursor(w, w->cursor());
+ }
+}
+
/*!
\fn void QGuiApplication::setOverrideCursor(const QCursor &cursor)
if (qGuiApp->d_func()->cursor_list.isEmpty())
return;
qGuiApp->d_func()->cursor_list.removeFirst();
- QCursor c(qGuiApp->d_func()->cursor_list.value(0, QCursor()));
- applyCursor(QGuiApplicationPrivate::window_list, c);
+ if (qGuiApp->d_func()->cursor_list.size() > 0) {
+ QCursor c(qGuiApp->d_func()->cursor_list.value(0));
+ applyCursor(QGuiApplicationPrivate::window_list, c);
+ } else {
+ applyWindowCursor(QGuiApplicationPrivate::window_list);
+ }
}
#endif// QT_NO_CURSOR
static inline void applyCursor(QWidget *w, QCursor c)
{
if (QWindow *window = w->windowHandle())
- if (const QScreen *screen = window->screen())
- if (QPlatformCursor *cursor = screen->handle()->cursor())
- cursor->changeCursor(&c, window);
+ window->setCursor(c);
}
void qt_qpa_set_cursor(QWidget *w, bool force)
return;
if (w->isWindow() || w->testAttribute(Qt::WA_SetCursor)) {
- QCursor *oc = QApplication::overrideCursor();
- if (oc)
- applyCursor(nativeParent, *oc);
- else if (w->isEnabled())
+ if (w->isEnabled())
applyCursor(nativeParent, w->cursor());
else
// Enforce the windows behavior of clearing the cursor on