diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-20 09:47:38 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-28 00:24:25 +0200 |
commit | 6007120aa4391fa53acd774a451530c6561a1658 (patch) | |
tree | d64b6fed3f74d90a7ae266b6db3b90bd540bbb74 /src/widgets/graphicsview/qgraphicswidget.cpp | |
parent | fb244259ae749f33cb4d870552c41c886fbe3f2b (diff) |
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 <oliver.wolff@qt.io>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicswidget.cpp')
-rw-r--r-- | src/widgets/graphicsview/qgraphicswidget.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index cd647a5db1..643f073085 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/graphicsview/qgraphicswidget.cpp @@ -390,7 +390,7 @@ void QGraphicsWidget::setGeometry(const QRectF &rect) QGraphicsSceneMoveEvent event; event.setOldPos(oldPos); event.setNewPos(pos()); - QApplication::sendEvent(this, &event); + QCoreApplication::sendEvent(this, &event); if (wd->inSetPos) { //set the new pos d->geom.moveTopLeft(pos()); @@ -413,10 +413,10 @@ void QGraphicsWidget::setGeometry(const QRectF &rect) QGraphicsLayout *lay = wd->layout; if (QGraphicsLayout::instantInvalidatePropagation()) { if (!lay || lay->isActivated()) { - QApplication::sendEvent(this, &re); + QCoreApplication::sendEvent(this, &re); } } else { - QApplication::sendEvent(this, &re); + QCoreApplication::sendEvent(this, &re); } } } @@ -427,7 +427,7 @@ relayoutChildrenAndReturn: if (QGraphicsLayout *lay = wd->layout) { if (!lay->isActivated()) { QEvent layoutRequest(QEvent::LayoutRequest); - QApplication::sendEvent(this, &layoutRequest); + QCoreApplication::sendEvent(this, &layoutRequest); } } } @@ -507,7 +507,7 @@ void QGraphicsWidget::setContentsMargins(QMarginsF margins) updateGeometry(); QEvent e(QEvent::ContentsRectChange); - QApplication::sendEvent(this, &e); + QCoreApplication::sendEvent(this, &e); } /*! @@ -963,7 +963,7 @@ void QGraphicsWidget::setStyle(QStyle *style) // Deliver StyleChange to the widget itself (doesn't propagate). QEvent event(QEvent::StyleChange); - QApplication::sendEvent(this, &event); + QCoreApplication::sendEvent(this, &event); } /*! @@ -1028,7 +1028,7 @@ void QGraphicsWidget::setFont(const QFont &font) By default, this property contains the application's default palette. - \sa QApplication::palette(), QGraphicsScene::palette, QPalette::resolve() + \sa QGuiApplication::palette(), QGraphicsScene::palette, QPalette::resolve() */ QPalette QGraphicsWidget::palette() const { @@ -1100,7 +1100,7 @@ void QGraphicsWidget::updateGeometry() // This is for custom layouting QGraphicsWidget *parentWid = parentWidget(); //### if (parentWid->isVisible()) - QApplication::postEvent(parentWid, new QEvent(QEvent::LayoutRequest)); + QCoreApplication::postEvent(parentWid, new QEvent(QEvent::LayoutRequest)); } else { /** * If this is the topmost widget, post a LayoutRequest event to the widget. @@ -1108,7 +1108,7 @@ void QGraphicsWidget::updateGeometry() * widgets in one go. This will make a relayout flicker-free. */ if (QGraphicsLayout::instantInvalidatePropagation()) - QApplication::postEvent(static_cast<QGraphicsWidget *>(this), new QEvent(QEvent::LayoutRequest)); + QCoreApplication::postEvent(static_cast<QGraphicsWidget *>(this), new QEvent(QEvent::LayoutRequest)); } if (!QGraphicsLayout::instantInvalidatePropagation()) { bool wasResized = testAttribute(Qt::WA_Resized); @@ -1145,14 +1145,14 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant & case ItemEnabledHasChanged: { // Send EnabledChange after the enabled state has changed. QEvent event(QEvent::EnabledChange); - QApplication::sendEvent(this, &event); + QCoreApplication::sendEvent(this, &event); break; } case ItemVisibleChange: if (value.toBool()) { // Send Show event before the item has been shown. QShowEvent event; - QApplication::sendEvent(this, &event); + QCoreApplication::sendEvent(this, &event); bool resized = testAttribute(Qt::WA_Resized); if (!resized) { adjustSize(); @@ -1168,7 +1168,7 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant & if (!value.toBool()) { // Send Hide event after the item has been hidden. QHideEvent event; - QApplication::sendEvent(this, &event); + QCoreApplication::sendEvent(this, &event); } break; case ItemPositionHasChanged: @@ -1177,25 +1177,25 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant & case ItemParentChange: { // Deliver ParentAboutToChange. QEvent event(QEvent::ParentAboutToChange); - QApplication::sendEvent(this, &event); + QCoreApplication::sendEvent(this, &event); break; } case ItemParentHasChanged: { // Deliver ParentChange. QEvent event(QEvent::ParentChange); - QApplication::sendEvent(this, &event); + QCoreApplication::sendEvent(this, &event); break; } case ItemCursorHasChanged: { // Deliver CursorChange. QEvent event(QEvent::CursorChange); - QApplication::sendEvent(this, &event); + QCoreApplication::sendEvent(this, &event); break; } case ItemToolTipHasChanged: { // Deliver ToolTipChange. QEvent event(QEvent::ToolTipChange); - QApplication::sendEvent(this, &event); + QCoreApplication::sendEvent(this, &event); break; } default: @@ -1930,7 +1930,7 @@ int QGraphicsWidget::grabShortcut(const QKeySequence &sequence, Qt::ShortcutCont if (sequence.isEmpty()) return 0; // ### setAttribute(Qt::WA_GrabbedShortcut); - return qApp->d_func()->shortcutMap.addShortcut(this, sequence, context, qWidgetShortcutContextMatcher); + return QGuiApplicationPrivate::instance()->shortcutMap.addShortcut(this, sequence, context, qWidgetShortcutContextMatcher); } /*! @@ -1954,7 +1954,7 @@ void QGraphicsWidget::releaseShortcut(int id) { Q_ASSERT(qApp); if (id) - qApp->d_func()->shortcutMap.removeShortcut(id, this, 0); + QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(id, this, 0); } /*! @@ -1975,7 +1975,7 @@ void QGraphicsWidget::setShortcutEnabled(int id, bool enabled) { Q_ASSERT(qApp); if (id) - qApp->d_func()->shortcutMap.setShortcutEnabled(enabled, id, this, 0); + QGuiApplicationPrivate::instance()->shortcutMap.setShortcutEnabled(enabled, id, this, 0); } /*! @@ -1990,7 +1990,7 @@ void QGraphicsWidget::setShortcutAutoRepeat(int id, bool enabled) { Q_ASSERT(qApp); if (id) - qApp->d_func()->shortcutMap.setShortcutAutoRepeat(enabled, id, this, 0); + QGuiApplicationPrivate::instance()->shortcutMap.setShortcutAutoRepeat(enabled, id, this, 0); } #endif @@ -2068,7 +2068,7 @@ void QGraphicsWidget::insertAction(QAction *before, QAction *action) } QActionEvent e(QEvent::ActionAdded, action, before); - QApplication::sendEvent(this, &e); + QCoreApplication::sendEvent(this, &e); } /*! @@ -2111,7 +2111,7 @@ void QGraphicsWidget::removeAction(QAction *action) if (d->actions.removeAll(action)) { QActionEvent e(QEvent::ActionRemoved, action); - QApplication::sendEvent(this, &e); + QCoreApplication::sendEvent(this, &e); } } @@ -2404,7 +2404,7 @@ QPainterPath QGraphicsWidget::shape() const bool QGraphicsWidget::close() { QCloseEvent closeEvent; - QApplication::sendEvent(this, &closeEvent); + QCoreApplication::sendEvent(this, &closeEvent); if (!closeEvent.isAccepted()) { return false; } |