Fix debug stream operators.
- Use QDebugStateSaver to restore space setting in stream operators instead of returning dbg.space() which breaks formatting on streams that already have nospace() set. - Fix some single character string constants. Change-Id: I0fe86bb1adbdd4a76ab6d2f8c19e063b45ddcf3b Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
parent
8299e408df
commit
85f9478227
@ -1713,6 +1713,7 @@ bool operator==(const QAccessible::State &first, const QAccessible::State &secon
|
|||||||
/*! \internal */
|
/*! \internal */
|
||||||
Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
|
Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
|
||||||
{
|
{
|
||||||
|
QDebugStateSaver saver(d);
|
||||||
if (!iface) {
|
if (!iface) {
|
||||||
d << "QAccessibleInterface(null)";
|
d << "QAccessibleInterface(null)";
|
||||||
return d;
|
return d;
|
||||||
@ -1720,10 +1721,10 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
|
|||||||
d.nospace();
|
d.nospace();
|
||||||
d << "QAccessibleInterface(" << hex << (const void *) iface << dec;
|
d << "QAccessibleInterface(" << hex << (const void *) iface << dec;
|
||||||
if (iface->isValid()) {
|
if (iface->isValid()) {
|
||||||
d << " name=" << iface->text(QAccessible::Name) << " ";
|
d << " name=" << iface->text(QAccessible::Name) << ' ';
|
||||||
d << "role=" << qAccessibleRoleString(iface->role()) << " ";
|
d << "role=" << qAccessibleRoleString(iface->role()) << ' ';
|
||||||
if (iface->childCount())
|
if (iface->childCount())
|
||||||
d << "childc=" << iface->childCount() << " ";
|
d << "childc=" << iface->childCount() << ' ';
|
||||||
if (iface->object()) {
|
if (iface->object()) {
|
||||||
d << "obj=" << iface->object();
|
d << "obj=" << iface->object();
|
||||||
}
|
}
|
||||||
@ -1747,13 +1748,14 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
|
|||||||
} else {
|
} else {
|
||||||
d << " invalid";
|
d << " invalid";
|
||||||
}
|
}
|
||||||
d << ")";
|
d << ')';
|
||||||
return d.space();
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \internal */
|
/*! \internal */
|
||||||
QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
|
QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
|
||||||
{
|
{
|
||||||
|
QDebugStateSaver saver(d);
|
||||||
d.nospace() << "QAccessibleEvent(";
|
d.nospace() << "QAccessibleEvent(";
|
||||||
if (ev.object()) {
|
if (ev.object()) {
|
||||||
d.nospace() << "object=" << hex << ev.object() << dec;
|
d.nospace() << "object=" << hex << ev.object() << dec;
|
||||||
@ -1806,8 +1808,8 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
|
|||||||
if (changed.supportsAutoCompletion) d << "supportsAutoCompletion";
|
if (changed.supportsAutoCompletion) d << "supportsAutoCompletion";
|
||||||
|
|
||||||
}
|
}
|
||||||
d.nospace() << ")";
|
d << ')';
|
||||||
return d.space();
|
return d;
|
||||||
}
|
}
|
||||||
#endif // QT_NO_DEBUGSTREAM
|
#endif // QT_NO_DEBUGSTREAM
|
||||||
|
|
||||||
|
@ -1039,10 +1039,11 @@ bool QOpenGLDebugMessage::operator==(const QOpenGLDebugMessage &debugMessage) co
|
|||||||
*/
|
*/
|
||||||
QDebug operator<<(QDebug debug, QOpenGLDebugMessage::Source source)
|
QDebug operator<<(QDebug debug, QOpenGLDebugMessage::Source source)
|
||||||
{
|
{
|
||||||
|
QDebugStateSaver saver(debug);
|
||||||
debug.nospace() << "QOpenGLDebugMessage::Source("
|
debug.nospace() << "QOpenGLDebugMessage::Source("
|
||||||
<< qt_messageSourceToString(source)
|
<< qt_messageSourceToString(source)
|
||||||
<< ")";
|
<< ')';
|
||||||
return debug.space();
|
return debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1053,10 +1054,11 @@ QDebug operator<<(QDebug debug, QOpenGLDebugMessage::Source source)
|
|||||||
*/
|
*/
|
||||||
QDebug operator<<(QDebug debug, QOpenGLDebugMessage::Type type)
|
QDebug operator<<(QDebug debug, QOpenGLDebugMessage::Type type)
|
||||||
{
|
{
|
||||||
|
QDebugStateSaver saver(debug);
|
||||||
debug.nospace() << "QOpenGLDebugMessage::Type("
|
debug.nospace() << "QOpenGLDebugMessage::Type("
|
||||||
<< qt_messageTypeToString(type)
|
<< qt_messageTypeToString(type)
|
||||||
<< ")";
|
<< ')';
|
||||||
return debug.space();
|
return debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1067,10 +1069,11 @@ QDebug operator<<(QDebug debug, QOpenGLDebugMessage::Type type)
|
|||||||
*/
|
*/
|
||||||
QDebug operator<<(QDebug debug, QOpenGLDebugMessage::Severity severity)
|
QDebug operator<<(QDebug debug, QOpenGLDebugMessage::Severity severity)
|
||||||
{
|
{
|
||||||
|
QDebugStateSaver saver(debug);
|
||||||
debug.nospace() << "QOpenGLDebugMessage::Severity("
|
debug.nospace() << "QOpenGLDebugMessage::Severity("
|
||||||
<< qt_messageSeverityToString(severity)
|
<< qt_messageSeverityToString(severity)
|
||||||
<< ")";
|
<< ')';
|
||||||
return debug.space();
|
return debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1081,13 +1084,14 @@ QDebug operator<<(QDebug debug, QOpenGLDebugMessage::Severity severity)
|
|||||||
*/
|
*/
|
||||||
QDebug operator<<(QDebug debug, const QOpenGLDebugMessage &message)
|
QDebug operator<<(QDebug debug, const QOpenGLDebugMessage &message)
|
||||||
{
|
{
|
||||||
|
QDebugStateSaver saver(debug);
|
||||||
debug.nospace() << "QOpenGLDebugMessage("
|
debug.nospace() << "QOpenGLDebugMessage("
|
||||||
<< qt_messageSourceToString(message.source()) << ", "
|
<< qt_messageSourceToString(message.source()) << ", "
|
||||||
<< message.id() << ", "
|
<< message.id() << ", "
|
||||||
<< message.message() << ", "
|
<< message.message() << ", "
|
||||||
<< qt_messageSeverityToString(message.severity()) << ", "
|
<< qt_messageSeverityToString(message.severity()) << ", "
|
||||||
<< qt_messageTypeToString(message.type()) << ")";
|
<< qt_messageTypeToString(message.type()) << ')';
|
||||||
return debug.space();
|
return debug;
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif // QT_NO_DEBUG_STREAM
|
#endif // QT_NO_DEBUG_STREAM
|
||||||
|
@ -850,9 +850,10 @@ int QWidgetItemV2::heightForWidth(int width) const
|
|||||||
#ifndef QT_NO_DEBUG_STREAM
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
QDebug operator<<(QDebug dbg, const QSizePolicy &p)
|
QDebug operator<<(QDebug dbg, const QSizePolicy &p)
|
||||||
{
|
{
|
||||||
|
QDebugStateSaver saver(dbg);
|
||||||
dbg.nospace() << "QSizePolicy(horizontalPolicy = " << p.horizontalPolicy()
|
dbg.nospace() << "QSizePolicy(horizontalPolicy = " << p.horizontalPolicy()
|
||||||
<< ", verticalPolicy = " << p.verticalPolicy() << ')';
|
<< ", verticalPolicy = " << p.verticalPolicy() << ')';
|
||||||
return dbg.space();
|
return dbg;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user