Update documentation snippets related to QDebug.
Use QDebugStateSaver to store the formatting state and fix the return statement to return the unmodified stream. Change-Id: I476d13c5487a89f263dcc11334fc67c85d9433f5 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
parent
7c2360b762
commit
f53621af05
@ -51,11 +51,12 @@ public:
|
||||
};
|
||||
|
||||
//! [0]
|
||||
QDebug operator<<(QDebug dbg, const Coordinate &c)
|
||||
QDebug operator<<(QDebug debug, const Coordinate &c)
|
||||
{
|
||||
dbg.nospace() << "(" << c.x() << ", " << c.y() << ")";
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace() << '(' << c.x() << ", " << c.y() << ')';
|
||||
|
||||
return dbg.space();
|
||||
return debug;
|
||||
}
|
||||
//! [0]
|
||||
|
||||
|
@ -59,10 +59,11 @@ struct UsbEntry {
|
||||
int classtype;
|
||||
};
|
||||
|
||||
QDebug operator<<(QDebug &dbg, const UsbEntry &entry)
|
||||
QDebug operator<<(QDebug &debug, const UsbEntry &entry)
|
||||
{
|
||||
dbg.nospace() << "" << entry.id << " (" << entry.classtype << ")";
|
||||
return dbg.space();
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace() << "" << entry.id << " (" << entry.classtype << ')';
|
||||
return debug;
|
||||
}
|
||||
|
||||
QList<UsbEntry> usbEntries() {
|
||||
|
Loading…
Reference in New Issue
Block a user