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 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);