From 6007120aa4391fa53acd774a451530c6561a1658 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 20 Jun 2019 09:47:38 +0200 Subject: QtWidgets: Fix static method invocations Apply fixits by Creator and results of manual search focusing on QCore/Gui/Applicaton(Private) methods and variables to prepare for splitting out some classes. Task-number: QTBUG-69478 Task-number: QTBUG-76497 Task-number: QTBUG-76493 Change-Id: Iaf468166793e0cabb514b51c827b30317bf45a2d Reviewed-by: Oliver Wolff --- src/widgets/itemviews/qabstractitemview.cpp | 18 +++++++++--------- src/widgets/itemviews/qdirmodel.cpp | 4 ++-- src/widgets/itemviews/qheaderview.cpp | 2 +- src/widgets/itemviews/qlistview.cpp | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/widgets/itemviews') diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 1d1c144bb8..6ff0fe8132 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -180,7 +180,7 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index QString statustip = model->data(index, Qt::StatusTipRole).toString(); if (parent && (shouldClearStatusTip || !statustip.isEmpty())) { QStatusTipEvent tip(statustip); - QApplication::sendEvent(parent, &tip); + QCoreApplication::sendEvent(parent, &tip); shouldClearStatusTip = !statustip.isEmpty(); } #endif @@ -189,7 +189,7 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index if (parent && shouldClearStatusTip) { QString emptyString; QStatusTipEvent tip( emptyString ); - QApplication::sendEvent(parent, &tip); + QCoreApplication::sendEvent(parent, &tip); } #endif emit q->viewportEntered(); @@ -521,7 +521,7 @@ void QAbstractItemViewPrivate::_q_scrollerStateChanged() the mouse was pressed on is specified by \a index. The signal is only emitted when the index is valid. - Use the QApplication::mouseButtons() function to get the state + Use the QGuiApplication::mouseButtons() function to get the state of the mouse buttons. \sa activated(), clicked(), doubleClicked(), entered() @@ -1713,7 +1713,7 @@ bool QAbstractItemView::viewportEvent(QEvent *event) if (d->shouldClearStatusTip && d->parent) { QString empty; QStatusTipEvent tip(empty); - QApplication::sendEvent(d->parent, &tip); + QCoreApplication::sendEvent(d->parent, &tip); d->shouldClearStatusTip = false; } #endif @@ -2338,7 +2338,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) if (d->model) variant = d->model->data(currentIndex(), Qt::DisplayRole); if (variant.type() == QVariant::String) - QApplication::clipboard()->setText(variant.toString()); + QGuiApplication::clipboard()->setText(variant.toString()); event->accept(); } #endif @@ -2845,7 +2845,7 @@ void QAbstractItemView::closeEditor(QWidget *editor, QAbstractItemDelegate::EndE } QPointer ed = editor; - QApplication::sendPostedEvents(editor, 0); + QCoreApplication::sendPostedEvents(editor, 0); editor = ed; if (!isPersistent && editor) @@ -3957,7 +3957,7 @@ QItemSelectionModel::SelectionFlags QAbstractItemView::selectionCommand(const QM keyModifiers = (static_cast(event))->modifiers(); break; default: - keyModifiers = QApplication::keyboardModifiers(); + keyModifiers = QGuiApplication::keyboardModifiers(); } } switch (d->selectionMode) { @@ -4015,7 +4015,7 @@ QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::multiSelectionComm QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionCommand( const QModelIndex &index, const QEvent *event) const { - Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers(); + Qt::KeyboardModifiers modifiers = QGuiApplication::keyboardModifiers(); if (event) { switch (event->type()) { case QEvent::MouseMove: { @@ -4425,7 +4425,7 @@ bool QAbstractItemViewPrivate::openEditor(const QModelIndex &index, QEvent *even w->setFocus(); if (event) - QApplication::sendEvent(w->focusProxy() ? w->focusProxy() : w, event); + QCoreApplication::sendEvent(w->focusProxy() ? w->focusProxy() : w, event); return true; } diff --git a/src/widgets/itemviews/qdirmodel.cpp b/src/widgets/itemviews/qdirmodel.cpp index b94c31fb42..13a1bbd8eb 100644 --- a/src/widgets/itemviews/qdirmodel.cpp +++ b/src/widgets/itemviews/qdirmodel.cpp @@ -1086,7 +1086,7 @@ QString QDirModel::filePath(const QModelIndex &index) const if (d->indexValid(index)) { QFileInfo fi = fileInfo(index); if (d->resolveSymlinks && fi.isSymLink()) - fi = d->resolvedInfo(fi); + fi = QDirModelPrivate::resolvedInfo(fi); return QDir::cleanPath(fi.absoluteFilePath()); } return QString(); // root path @@ -1108,7 +1108,7 @@ QString QDirModel::fileName(const QModelIndex &index) const if (QFileSystemEntry::isRootPath(path)) return path; if (d->resolveSymlinks && info.isSymLink()) - info = d->resolvedInfo(info); + info = QDirModelPrivate::resolvedInfo(info); return info.fileName(); } diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 1fcd5bdef2..be80843b07 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -2896,7 +2896,7 @@ bool QHeaderView::viewportEvent(QEvent *e) case QEvent::Wheel: { QAbstractScrollArea *asa = qobject_cast(parentWidget()); if (asa) - return QApplication::sendEvent(asa->viewport(), e); + return QCoreApplication::sendEvent(asa->viewport(), e); break; } default: break; diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index 641b15f85b..25facd1484 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -821,13 +821,13 @@ void QListView::wheelEvent(QWheelEvent *e) if (e->spontaneous()) qt_sendSpontaneousEvent(d->hbar, &hwe); else - QApplication::sendEvent(d->hbar, &hwe); + QCoreApplication::sendEvent(d->hbar, &hwe); e->setAccepted(hwe.isAccepted()); } else { - QApplication::sendEvent(d->vbar, e); + QCoreApplication::sendEvent(d->vbar, e); } } else { - QApplication::sendEvent(d->hbar, e); + QCoreApplication::sendEvent(d->hbar, e); } } #endif // QT_CONFIG(wheelevent) -- cgit v1.2.3