forked from qt-creator/qt-creator
Reduce usage of qApp in favor of static function calls
Q*Application classes have unusually many static functions. In many cases in our code, these functions are unnecessarily called as instance functions, using the qApp helper. This patch replaces many occurencies of qApp with the according Q*Application classname. Change-Id: I6099a419fa7bf969891269c37ed7a9e817ef5124 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -136,9 +136,9 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
const QString &trFile = QLatin1String("assistant_") + locale;
|
||||
const QString &helpTrFile = QLatin1String("qt_help_") + locale;
|
||||
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||
qApp->installTranslator(qtr);
|
||||
QCoreApplication::installTranslator(qtr);
|
||||
if (qhelptr->load(helpTrFile, qtTrPath) || qhelptr->load(helpTrFile, creatorTrPath))
|
||||
qApp->installTranslator(qhelptr);
|
||||
QCoreApplication::installTranslator(qhelptr);
|
||||
}
|
||||
|
||||
m_helpManager = new LocalHelpManager(this);
|
||||
@@ -448,9 +448,9 @@ void HelpPlugin::modeChanged(Core::Id mode, Core::Id old)
|
||||
{
|
||||
Q_UNUSED(old)
|
||||
if (mode == m_mode->id()) {
|
||||
qApp->setOverrideCursor(Qt::WaitCursor);
|
||||
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
doSetupIfNeeded();
|
||||
qApp->restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QUrl>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QGuiApplication>
|
||||
#include <QDesktopServices>
|
||||
#include <QMouseEvent>
|
||||
|
||||
@@ -156,12 +156,12 @@ void HelpViewer::home()
|
||||
|
||||
void HelpViewer::slotLoadStarted()
|
||||
{
|
||||
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
}
|
||||
|
||||
void HelpViewer::slotLoadFinished()
|
||||
{
|
||||
qApp->restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
emit sourceChanged(source());
|
||||
emit loadFinished();
|
||||
}
|
||||
|
||||
@@ -184,13 +184,13 @@ void SearchWidget::search() const
|
||||
|
||||
void SearchWidget::searchingStarted()
|
||||
{
|
||||
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
}
|
||||
|
||||
void SearchWidget::searchingFinished(int hits)
|
||||
{
|
||||
Q_UNUSED(hits)
|
||||
qApp->restoreOverrideCursor();
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void SearchWidget::indexingStarted()
|
||||
|
||||
Reference in New Issue
Block a user