Diaglib: Output DPI and scale factors
Also pass options to formatWindow(). Change-Id: Ifa506331ea010087bfd7ab8bd3f7dda531f142a8 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
parent
c33ee0fe15
commit
a9383ef99a
@ -96,6 +96,12 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w,
|
||||
str << "windowState=" << hex << showbase << states << dec << noshowbase << ' ';
|
||||
formatRect(str, w->geometry());
|
||||
if (w->isWindow()) {
|
||||
str << ' ' << w->logicalDpiX() << "DPI";
|
||||
#if QT_VERSION > 0x050600
|
||||
const qreal dpr = w->devicePixelRatioF();
|
||||
if (!qFuzzyCompare(dpr, qreal(1)))
|
||||
str << " dpr=" << dpr;
|
||||
#endif // Qt 5.6
|
||||
const QRect normalGeometry = w->normalGeometry();
|
||||
if (normalGeometry.isValid() && !normalGeometry.isEmpty() && normalGeometry != w->geometry()) {
|
||||
str << " normal=";
|
||||
|
@ -138,7 +138,7 @@ void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions option
|
||||
str << " \"" << w->screen()->name() << "\" ";
|
||||
#if QT_VERSION >= 0x050600
|
||||
if (QHighDpiScaling::isActive())
|
||||
str << "factor=" << QHighDpiScaling::factor(w) << ' ';
|
||||
str << "factor=" << QHighDpiScaling::factor(w) << " dpr=" << w->devicePixelRatio();
|
||||
#endif
|
||||
}
|
||||
if (!(options & DontPrintWindowFlags)) {
|
||||
@ -161,7 +161,7 @@ static void dumpWindowRecursion(QTextStream &str, const QWindow *w,
|
||||
FormatWindowOptions options = 0, int depth = 0)
|
||||
{
|
||||
indentStream(str, 2 * depth);
|
||||
formatWindow(str, w);
|
||||
formatWindow(str, w, options);
|
||||
foreach (const QObject *co, w->children()) {
|
||||
if (co->isWindowType())
|
||||
dumpWindowRecursion(str, static_cast<const QWindow *>(co), options, depth + 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user