Fix debug operators for QPageSize/QPageLayout.
Remove placeholder formatting and add noquote. Change-Id: I4a89f88778caf007ce42bbf57edfb514fe76bcdb Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
parent
807240a883
commit
62e0a98282
@ -943,40 +943,37 @@ QRect QPageLayout::paintRectPixels(int resolution) const
|
||||
QDebug operator<<(QDebug dbg, const QPageLayout &layout)
|
||||
{
|
||||
QDebugStateSaver saver(dbg);
|
||||
dbg.nospace();
|
||||
dbg.noquote();
|
||||
dbg << "QPageLayout(";
|
||||
if (layout.isValid()) {
|
||||
QString output = QStringLiteral("QPageLayout(%1, %2, l:%3 r:%4 t:%5 b:%6 %7)");
|
||||
QString units;
|
||||
const QMarginsF margins = layout.margins();
|
||||
dbg << '"' << layout.pageSize().name() << "\", "
|
||||
<< (layout.orientation() == QPageLayout::Portrait ? "Portrait" : "Landscape")
|
||||
<< ", l:" << margins.left() << " r:" << margins.right() << " t:"
|
||||
<< margins.top() << " b:" << margins.bottom() << ' ';
|
||||
switch (layout.units()) {
|
||||
case QPageLayout::Millimeter:
|
||||
units = QStringLiteral("mm");
|
||||
dbg << "mm";
|
||||
break;
|
||||
case QPageLayout::Point:
|
||||
units = QStringLiteral("pt");
|
||||
dbg << "pt";
|
||||
break;
|
||||
case QPageLayout::Inch:
|
||||
units = QStringLiteral("in");
|
||||
dbg << "in";
|
||||
break;
|
||||
case QPageLayout::Pica:
|
||||
units = QStringLiteral("pc");
|
||||
dbg << "pc";
|
||||
break;
|
||||
case QPageLayout::Didot:
|
||||
units = QStringLiteral("DD");
|
||||
dbg << "DD";
|
||||
break;
|
||||
case QPageLayout::Cicero:
|
||||
units = QStringLiteral("CC");
|
||||
dbg << "CC";
|
||||
break;
|
||||
}
|
||||
output = output.arg(layout.pageSize().name())
|
||||
.arg(layout.orientation() == QPageLayout::Portrait ? QStringLiteral("Portrait") : QStringLiteral("Landscape"))
|
||||
.arg(layout.margins().left())
|
||||
.arg(layout.margins().right())
|
||||
.arg(layout.margins().top())
|
||||
.arg(layout.margins().bottom())
|
||||
.arg(units);
|
||||
dbg.nospace() << output;
|
||||
} else {
|
||||
dbg.nospace() << "QPageLayout()";
|
||||
}
|
||||
dbg << ')';
|
||||
return dbg;
|
||||
}
|
||||
#endif
|
||||
|
@ -1855,17 +1855,17 @@ QSize QPageSize::sizePixels(PageSizeId pageSizeId, int resolution)
|
||||
QDebug operator<<(QDebug dbg, const QPageSize &pageSize)
|
||||
{
|
||||
QDebugStateSaver saver(dbg);
|
||||
dbg.nospace();
|
||||
dbg.noquote();
|
||||
dbg << "QPageSize(";
|
||||
if (pageSize.isValid()) {
|
||||
QString output = QStringLiteral("QPageSize(\"%1\", \"%2\", %3x%4pt, %5)");
|
||||
output = output.arg(pageSize.name())
|
||||
.arg(pageSize.key())
|
||||
.arg(pageSize.sizePoints().width())
|
||||
.arg(pageSize.sizePoints().height())
|
||||
.arg(pageSize.id());
|
||||
dbg.nospace() << output;
|
||||
dbg << '"' << pageSize.name() << "\", key=\"" << pageSize.key()
|
||||
<< "\", " << pageSize.sizePoints().width() << 'x'
|
||||
<< pageSize.sizePoints().height() << "pt, id=" << pageSize.id();
|
||||
} else {
|
||||
dbg.nospace() << "QPageSize()";
|
||||
}
|
||||
dbg << ')';
|
||||
return dbg;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user