diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-04-07 17:49:43 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-04-21 20:35:29 +0200 |
commit | 1c80d056e4f45b4ee7c4863cd792e83c889513c5 (patch) | |
tree | fce424d5dcc18710bd88a479ec48c443209a1115 /src/widgets/graphicsview | |
parent | fbb7c98e91ec9a0a253864d7621ee7ec73b1a480 (diff) |
Port QT_NO_TOOLTIP to QT_CONFIG(tooltip)
We remove the QT_NO_TOOLTIP check from qstandarditemmodel.h, because as
the 'tooltip' feature is in QtWidgets, we cannot use it properly in
QtGui. Also this affects just two non-virtual inline methods, i.e. it
has no effect on library size.
Task-number: QTBUG-82785
Change-Id: Ic166f14fb1cf3e9dd789573a6b9db6a87fb50e10
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@kdab.com>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 4 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.h | 2 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsproxywidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.cpp | 6 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsview.cpp | 2 |
5 files changed, 10 insertions, 8 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 12ee1713a9..42f997b104 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -2239,7 +2239,7 @@ bool QGraphicsItem::isBlockedByModalPanel(QGraphicsItem **blockingPanel) const return false; } -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) /*! Returns the item's tool tip, or an empty QString if no tool tip has been set. @@ -2263,7 +2263,7 @@ void QGraphicsItem::setToolTip(const QString &toolTip) d_ptr->setExtra(QGraphicsItemPrivate::ExtraToolTip, toolTipVariant.toString()); itemChange(ItemToolTipHasChanged, toolTipVariant); } -#endif // QT_NO_TOOLTIP +#endif // QT_CONFIG(tooltip) #ifndef QT_NO_CURSOR /*! diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h index 5989c428f1..dda61fbe65 100644 --- a/src/widgets/graphicsview/qgraphicsitem.h +++ b/src/widgets/graphicsview/qgraphicsitem.h @@ -191,7 +191,7 @@ public: void setPanelModality(PanelModality panelModality); bool isBlockedByModalPanel(QGraphicsItem **blockingPanel = nullptr) const; -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) QString toolTip() const; void setToolTip(const QString &toolTip); #endif diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index 13b4638299..42211c7ccf 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -890,7 +890,7 @@ bool QGraphicsProxyWidget::event(QEvent *event) } break; } -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) case QEvent::GraphicsSceneHelp: { // Propagate the help event (for tooltip) to the widget under mouse if (d->lastWidgetUnderMouse) { @@ -981,7 +981,7 @@ bool QGraphicsProxyWidget::eventFilter(QObject *object, QEvent *event) d->styleChangeMode = QGraphicsProxyWidgetPrivate::NoMode; } break; -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) case QEvent::ToolTipChange: // Propagate tooltip change to the proxy. if (!d->tooltipChangeMode) { diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index 7c677f7d9c..d5ab1afd92 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -238,7 +238,9 @@ #include <QtGui/qpolygon.h> #include <QtGui/qtouchdevice.h> #include <QtWidgets/qstyleoption.h> +#if QT_CONFIG(tooltip) #include <QtWidgets/qtooltip.h> +#endif #include <QtGui/qtransform.h> #include <QtGui/qinputmethod.h> #include <private/qapplication_p.h> @@ -3729,7 +3731,7 @@ void QGraphicsScene::focusOutEvent(QFocusEvent *focusEvent) */ void QGraphicsScene::helpEvent(QGraphicsSceneHelpEvent *helpEvent) { -#ifdef QT_NO_TOOLTIP +#if !QT_CONFIG(tooltip) Q_UNUSED(helpEvent); #else // Find the first item that does tooltips @@ -3860,7 +3862,7 @@ bool QGraphicsScenePrivate::dispatchHoverEvent(QGraphicsSceneHoverEvent *hoverEv */ void QGraphicsScenePrivate::leaveScene(QWidget *viewport) { -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) QToolTip::hideText(); #endif QGraphicsView *view = qobject_cast<QGraphicsView *>(viewport->parent()); diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index 9c8042ba1a..ca14e03a72 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -2888,7 +2888,7 @@ bool QGraphicsView::viewportEvent(QEvent *event) QCoreApplication::sendEvent(d->scene, event); break; } -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) case QEvent::ToolTip: { QHelpEvent *toolTip = static_cast<QHelpEvent *>(event); QGraphicsSceneHelpEvent helpEvent(QEvent::GraphicsSceneHelp); |