QDockAreaLayoutInfo: fix QDebug stream operator
The existing implementation as a member function QDALI::op<<(QDebug) cannot possibly work, as the implicit `this` argument comes first in this case, while for streaming operators, the QDebug object must come first. Rewrite as a hidden friend and apply QT_NO_DEBUG_STREAM protection as a drive-by. Amends faec937756810bbc478da677efb0dca4531a6222. Task-number: QTBUG-114542 Task-number: QTBUG-112491 Change-Id: Ida400d335491896ec49f2c0f9601a8430eebcd4d Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 46aa713c34c7bc90f3981b3d723591149572203c) Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
22dc39a8d7
commit
82005725c2
@ -171,20 +171,22 @@ QDockAreaLayoutItem
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDebug QDockAreaLayoutItem::operator<<(QDebug dbg)
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
QDebug operator<<(QDebug dbg, const QDockAreaLayoutItem &item)
|
||||||
{
|
{
|
||||||
QDebugStateSaver saver(dbg);
|
QDebugStateSaver saver(dbg);
|
||||||
dbg.nospace();
|
dbg.nospace();
|
||||||
dbg << "QDockAreaLayoutItem(" << static_cast<void *>(this) << "->";
|
dbg << "QDockAreaLayoutItem(" << static_cast<const void *>(&item) << "->";
|
||||||
if (widgetItem)
|
if (item.widgetItem)
|
||||||
dbg << "widgetItem(" << widgetItem->widget() << ")";
|
dbg << "widgetItem(" << item.widgetItem->widget() << ")";
|
||||||
else if (subinfo)
|
else if (item.subinfo)
|
||||||
dbg << "subInfo(" << subinfo << ")";
|
dbg << "subInfo(" << item.subinfo << ")";
|
||||||
else if (placeHolderItem)
|
else if (item.placeHolderItem)
|
||||||
dbg << "placeHolderItem(" << placeHolderItem << ")";
|
dbg << "placeHolderItem(" << item.placeHolderItem << ")";
|
||||||
dbg << ")";
|
dbg << ")";
|
||||||
return dbg;
|
return dbg;
|
||||||
}
|
}
|
||||||
|
#endif // QT_NO_DEBUG_STREAM
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
** QDockAreaLayoutInfo
|
** QDockAreaLayoutInfo
|
||||||
|
@ -73,7 +73,9 @@ struct Q_AUTOTEST_EXPORT QDockAreaLayoutItem
|
|||||||
int pos;
|
int pos;
|
||||||
int size;
|
int size;
|
||||||
uint flags;
|
uint flags;
|
||||||
QDebug operator<<(QDebug dbg);
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
friend Q_AUTOTEST_EXPORT QDebug operator<<(QDebug dbg, const QDockAreaLayoutItem &item);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_AUTOTEST_EXPORT QPlaceHolderItem
|
class Q_AUTOTEST_EXPORT QPlaceHolderItem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user