Reapply: Remove const/ref debug operator for QDockWidget

QObjects are usually passed by pointer, so we leave the override
taking a pointer.

This amends bbeff2a3350dd3396400865525d509b784c2d93e, and reverts
the previous revert in b148a362c36a9b34b0c21c60530353d6bf6b92cb.
Now that we have removed the incorrectly added operators from the
6.6 branches entirely, we can remove the unnecessary const/ref
operator from 6.7.

Task-number: QTBUG-119952
Change-Id: Id196367ddf3ffb443db44194002f850dcfec5d79
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4b64df56509dd770002ec083ee64f3ec23a8b682)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2024-02-02 13:31:31 +01:00 committed by Qt Cherry-pick Bot
parent 43362244a1
commit 78e2a49a48
2 changed files with 9 additions and 11 deletions

View File

@ -1826,17 +1826,16 @@ QDebug operator<<(QDebug dbg, const QDockWidget *dockWidget)
{ {
QDebugStateSaver saver(dbg); QDebugStateSaver saver(dbg);
dbg.nospace(); dbg.nospace();
return dockWidget ? dbg << *dockWidget : dbg << "QDockWidget(0x0)";
}
QDebug operator<<(QDebug dbg, const QDockWidget &dockWidget) if (!dockWidget) {
{ dbg << "QDockWidget(0x0)";
QDebugStateSaver saver(dbg); return dbg;
dbg.nospace(); }
dbg << "QDockWidget(" << static_cast<const void *>(&dockWidget);
dbg << "->(ObjectName=" << dockWidget.objectName(); dbg << "QDockWidget(" << static_cast<const void *>(dockWidget);
dbg << "; floating=" << dockWidget.isFloating(); dbg << "->(ObjectName=" << dockWidget->objectName();
dbg << "; features=" << dockWidget.features(); dbg << "; floating=" << dockWidget->isFloating();
dbg << "; features=" << dockWidget->features();
dbg << ";))"; dbg << ";))";
return dbg; return dbg;
} }

View File

@ -65,7 +65,6 @@ public:
{ return (allowedAreas() & area) == area; } { return (allowedAreas() & area) == area; }
#ifndef QT_NO_DEBUG_STREAM #ifndef QT_NO_DEBUG_STREAM
friend Q_WIDGETS_EXPORT QDebug operator<<(QDebug dbg, const QDockWidget &dockWidget);
friend Q_WIDGETS_EXPORT QDebug operator<<(QDebug dbg, const QDockWidget *dockWidget); friend Q_WIDGETS_EXPORT QDebug operator<<(QDebug dbg, const QDockWidget *dockWidget);
#endif #endif