From f06e0f62fafcb0eeb725122b2a5321363d417663 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 31 Oct 2018 21:00:46 +0100 Subject: Fix usage of QGuiApplication::set/resetOverrideCursor Replace all occurrences of QApplication::set/resetOverrideCursor with the QGuiApplication::set/resetOverrideCursor since it's a static function of QGuiApplication. Change-Id: Ic898ab50a7ad4ed2bc9c6acb26cf4a979c2f82af Reviewed-by: Shawn Rutledge --- src/corelib/doc/snippets/resource-system/mainwindow.cpp | 8 ++++---- src/gui/doc/snippets/code/src_gui_kernel_qguiapplication_x11.cpp | 4 ++-- src/widgets/kernel/qwhatsthis.cpp | 6 +++--- src/widgets/kernel/qwidget.cpp | 4 ++-- src/widgets/widgets/qtextbrowser.cpp | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/corelib/doc/snippets/resource-system/mainwindow.cpp b/src/corelib/doc/snippets/resource-system/mainwindow.cpp index 6fcf52e588..0ab0034d5e 100644 --- a/src/corelib/doc/snippets/resource-system/mainwindow.cpp +++ b/src/corelib/doc/snippets/resource-system/mainwindow.cpp @@ -338,11 +338,11 @@ void MainWindow::loadFile(const QString &fileName) QTextStream in(&file); #ifndef QT_NO_CURSOR - QApplication::setOverrideCursor(Qt::WaitCursor); + QGuiApplication::setOverrideCursor(Qt::WaitCursor); #endif textEdit->setPlainText(in.readAll()); #ifndef QT_NO_CURSOR - QApplication::restoreOverrideCursor(); + QGuiApplication::restoreOverrideCursor(); #endif setCurrentFile(fileName); @@ -365,11 +365,11 @@ bool MainWindow::saveFile(const QString &fileName) QTextStream out(&file); #ifndef QT_NO_CURSOR - QApplication::setOverrideCursor(Qt::WaitCursor); + QGuiApplication::setOverrideCursor(Qt::WaitCursor); #endif out << textEdit->toPlainText(); #ifndef QT_NO_CURSOR - QApplication::restoreOverrideCursor(); + QGuiApplication::restoreOverrideCursor(); #endif setCurrentFile(fileName); diff --git a/src/gui/doc/snippets/code/src_gui_kernel_qguiapplication_x11.cpp b/src/gui/doc/snippets/code/src_gui_kernel_qguiapplication_x11.cpp index e91aa3d548..961ecd6cde 100644 --- a/src/gui/doc/snippets/code/src_gui_kernel_qguiapplication_x11.cpp +++ b/src/gui/doc/snippets/code/src_gui_kernel_qguiapplication_x11.cpp @@ -49,7 +49,7 @@ ****************************************************************************/ //! [0] -QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); +QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); calculateHugeMandelbrot(); // lunch time... -QApplication::restoreOverrideCursor(); +QGuiApplication::restoreOverrideCursor(); //! [0] diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index 1fa83d3238..4a798a7490 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -398,10 +398,10 @@ QWhatsThisPrivate::QWhatsThisPrivate() #ifdef QT_NO_CURSOR Q_UNUSED(sentEvent); #else - QApplication::setOverrideCursor((!sentEvent || !e.isAccepted())? + QGuiApplication::setOverrideCursor((!sentEvent || !e.isAccepted())? Qt::ForbiddenCursor:Qt::WhatsThisCursor); } else { - QApplication::setOverrideCursor(Qt::WhatsThisCursor); + QGuiApplication::setOverrideCursor(Qt::WhatsThisCursor); #endif } #ifndef QT_NO_ACCESSIBILITY @@ -417,7 +417,7 @@ QWhatsThisPrivate::~QWhatsThisPrivate() action->setChecked(false); #endif // QT_CONFIG(action) #ifndef QT_NO_CURSOR - QApplication::restoreOverrideCursor(); + QGuiApplication::restoreOverrideCursor(); #endif #ifndef QT_NO_ACCESSIBILITY QAccessibleEvent event(this, QAccessible::ContextHelpEnd); diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 1bca3fc119..4300d83e9c 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -4920,9 +4920,9 @@ void QWidget::unsetLayoutDirection() Some underlying window implementations will reset the cursor if it leaves a widget even if the mouse is grabbed. If you want to have a cursor set for all widgets, even when outside the window, consider - QApplication::setOverrideCursor(). + QGuiApplication::setOverrideCursor(). - \sa QApplication::setOverrideCursor() + \sa QGuiApplication::setOverrideCursor() */ #ifndef QT_NO_CURSOR diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp index 46b973bae7..1f00adcfe2 100644 --- a/src/widgets/widgets/qtextbrowser.cpp +++ b/src/widgets/widgets/qtextbrowser.cpp @@ -274,7 +274,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url) Q_Q(QTextBrowser); #ifndef QT_NO_CURSOR if (q->isVisible()) - QApplication::setOverrideCursor(Qt::WaitCursor); + QGuiApplication::setOverrideCursor(Qt::WaitCursor); #endif textOrSourceChanged = true; @@ -308,7 +308,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url) const QStringRef firstTag = txt.leftRef(txt.indexOf(QLatin1Char('>')) + 1); if (firstTag.startsWith(QLatin1String("isVisible()) - QApplication::restoreOverrideCursor(); + QGuiApplication::restoreOverrideCursor(); #endif emit q->sourceChanged(url); } -- cgit v1.2.3