diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-02 17:07:04 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-08 21:58:41 +0200 |
commit | 6dab2577bfa57e242e9568047c976f5e509c03f4 (patch) | |
tree | 2ea9d2b004d9d1b59cbc3043f83b6ca23e1365dc /src/widgets/graphicsview | |
parent | 6693befcbbb575ed5dc8826c17c31bd703c2340a (diff) |
Constify parameter in QGraphicsItem/Object debug streaming operator
Address FIXME comment.
Change-Id: I55b6e458f2aead9baac8ab3bba7009ad993863e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 8 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.h | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index af4443fa00..09c49a239f 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -11354,8 +11354,7 @@ static void formatGraphicsItemHelper(QDebug debug, const QGraphicsItem *item) debug << ", flags=" << item->flags(); } -// FIXME: Qt 6: Make this QDebug operator<<(QDebug debug, const QGraphicsItem *item) -QDebug operator<<(QDebug debug, QGraphicsItem *item) +QDebug operator<<(QDebug debug, const QGraphicsItem *item) { QDebugStateSaver saver(debug); debug.nospace(); @@ -11365,7 +11364,7 @@ QDebug operator<<(QDebug debug, QGraphicsItem *item) return debug; } - if (QGraphicsObject *o = item->toGraphicsObject()) + if (const QGraphicsObject *o = item->toGraphicsObject()) debug << o->metaObject()->className(); else debug << "QGraphicsItem"; @@ -11386,8 +11385,7 @@ QDebug operator<<(QDebug debug, QGraphicsItem *item) return debug; } -// FIXME: Qt 6: Make this QDebug operator<<(QDebug debug, const QGraphicsObject *item) -QDebug operator<<(QDebug debug, QGraphicsObject *item) +QDebug operator<<(QDebug debug, const QGraphicsObject *item) { QDebugStateSaver saver(debug); debug.nospace(); diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h index c78d31bbd4..0fb46fc9a8 100644 --- a/src/widgets/graphicsview/qgraphicsitem.h +++ b/src/widgets/graphicsview/qgraphicsitem.h @@ -1032,8 +1032,8 @@ template <class T> inline T qgraphicsitem_cast(const QGraphicsItem *item) } #ifndef QT_NO_DEBUG_STREAM -Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, QGraphicsItem *item); -Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, QGraphicsObject *item); +Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, const QGraphicsItem *item); +Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, const QGraphicsObject *item); Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemChange change); Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag); Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlags flags); |