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 <shawn.rutledge@qt.io>bb10
parent
f7ba6a0acf
commit
f06e0f62fa
|
|
@ -99,7 +99,7 @@ void Dialog::start()
|
|||
startButton->setEnabled(false);
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
#endif
|
||||
|
||||
bytesWritten = 0;
|
||||
|
|
@ -162,7 +162,7 @@ void Dialog::updateServerProgress()
|
|||
tcpServerConnection->close();
|
||||
startButton->setEnabled(true);
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -198,6 +198,6 @@ void Dialog::displayError(QAbstractSocket::SocketError socketError)
|
|||
serverStatusLabel->setText(tr("Server ready"));
|
||||
startButton->setEnabled(true);
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -337,11 +337,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);
|
||||
|
|
@ -364,11 +364,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);
|
||||
|
|
|
|||
|
|
@ -161,9 +161,9 @@ void MainWindow::save()
|
|||
}
|
||||
|
||||
QTextStream out(&file);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
out << textEdit->toHtml();
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
|
||||
statusBar()->showMessage(tr("Saved '%1'").arg(fileName), 2000);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,9 +82,9 @@ bool MdiChild::loadFile(const QString &fileName)
|
|||
}
|
||||
|
||||
QTextStream in(&file);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
setPlainText(in.readAll());
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
|
||||
setCurrentFile(fileName);
|
||||
|
||||
|
|
@ -124,9 +124,9 @@ bool MdiChild::saveFile(const QString &fileName)
|
|||
}
|
||||
|
||||
QTextStream out(&file);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
out << toPlainText();
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
|
||||
setCurrentFile(fileName);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -338,9 +338,9 @@ void MainWindow::loadFile(const QString &fileName)
|
|||
}
|
||||
|
||||
QTextStream in(&file);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
textEdit->setPlainText(in.readAll());
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
|
||||
setCurrentFile(fileName);
|
||||
statusBar()->showMessage(tr("File loaded"), 2000);
|
||||
|
|
@ -434,9 +434,9 @@ bool MainWindow::saveFile(const QString &fileName)
|
|||
}
|
||||
|
||||
QTextStream out(&file);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
out << textEdit->toPlainText();
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
|
||||
setCurrentFile(fileName);
|
||||
statusBar()->showMessage(tr("File saved"), 2000);
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
|
|||
|
||||
//! [6]
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
#endif
|
||||
QStringList words;
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
|
|||
}
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
//! [6]
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
|
|||
return new QStringListModel(completer);
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
#endif
|
||||
QStringList words;
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
|
|||
}
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
return new QStringListModel(words, completer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
|
|||
return new QStringListModel(completer);
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
#endif
|
||||
QStringList words;
|
||||
|
||||
|
|
@ -218,7 +218,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
|
|||
}
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
|
||||
return model;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
//! [0]
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
calculateHugeMandelbrot(); // lunch time...
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
//! [0]
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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("<qt")) && firstTag.contains(QLatin1String("type")) && firstTag.contains(QLatin1String("detail"))) {
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
#if QT_CONFIG(whatsthis)
|
||||
QWhatsThis::showText(QCursor::pos(), txt, q);
|
||||
|
|
@ -353,7 +353,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url)
|
|||
|
||||
#ifndef QT_NO_CURSOR
|
||||
if (q->isVisible())
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
emit q->sourceChanged(url);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9422,7 +9422,7 @@ QWidgetBackingStore* backingStore(QWidget &widget)
|
|||
void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs
|
||||
QGuiApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs
|
||||
#endif
|
||||
QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame
|
||||
QPalette palette;
|
||||
|
|
@ -9459,7 +9459,7 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
|
|||
QTRY_COMPARE(mainPixmap.toImage().convertToFormat(QImage::Format_RGB32),
|
||||
correct.toImage().convertToFormat(QImage::Format_RGB32));
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,10 +79,10 @@ void MainWindow::toggleOverrideCursor()
|
|||
{
|
||||
switch (override) {
|
||||
case 0:
|
||||
QApplication::setOverrideCursor(Qt::BusyCursor);
|
||||
QGuiApplication::setOverrideCursor(Qt::BusyCursor);
|
||||
break;
|
||||
case 1:
|
||||
QApplication::restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
break;
|
||||
case 2:
|
||||
ui->label->grabMouse(Qt::ForbiddenCursor);
|
||||
|
|
|
|||
Loading…
Reference in New Issue