diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-02 15:57:44 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-02 15:57:44 +0100 |
commit | d3e6e732c70ebc2340d6376d727b3c623be23810 (patch) | |
tree | 18d469f02ac36edd04b87a9bfa4886ceef0490f0 /tests/manual/diaglib/qwidgetdump.cpp | |
parent | fdfd63053ae6b10af06553be3c1b15de274bebf7 (diff) | |
parent | ba8d3430029d8c4342e9a47c110ee8c9879818f4 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
config.tests/unix/compile.test
src/plugins/platforms/cocoa/qcocoahelpers.mm
src/tools/qlalr/cppgenerator.cpp
Change-Id: I0103ca076a9aca7118b2fd99f0fdaf81055998c3
Diffstat (limited to 'tests/manual/diaglib/qwidgetdump.cpp')
-rw-r--r-- | tests/manual/diaglib/qwidgetdump.cpp | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/tests/manual/diaglib/qwidgetdump.cpp b/tests/manual/diaglib/qwidgetdump.cpp index 4b5b2342e6..0ccf109ebb 100644 --- a/tests/manual/diaglib/qwidgetdump.cpp +++ b/tests/manual/diaglib/qwidgetdump.cpp @@ -56,10 +56,32 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w, if (const int states = w->windowState()) str << "windowState=" << hex << showbase << states << dec << noshowbase << ' '; formatRect(str, w->geometry()); + if (w->isWindow()) { + const QRect normalGeometry = w->normalGeometry(); + if (normalGeometry.isValid() && !normalGeometry.isEmpty() && normalGeometry != w->geometry()) { + str << " normal="; + formatRect(str, w->normalGeometry()); + } + } if (!(options & DontPrintWindowFlags)) { str << ' '; formatWindowFlags(str, w->windowFlags()); } + if (options & PrintSizeConstraints) { + str << ' '; + const QSize minimumSize = w->minimumSize(); + if (minimumSize.width() > 0 || minimumSize.height() > 0) + str << "minimumSize=" << minimumSize.width() << 'x' << minimumSize.height() << ' '; + const QSize sizeHint = w->sizeHint(); + const QSize minimumSizeHint = w->minimumSizeHint(); + if (minimumSizeHint.isValid() && !(sizeHint.isValid() && minimumSizeHint == sizeHint)) + str << "minimumSizeHint=" << minimumSizeHint.width() << 'x' << minimumSizeHint.height() << ' '; + if (sizeHint.isValid()) + str << "sizeHint=" << sizeHint.width() << 'x' << sizeHint.height() << ' '; + const QSize maximumSize = w->maximumSize(); + if (maximumSize.width() < QWIDGETSIZE_MAX || maximumSize.height() < QWIDGETSIZE_MAX) + str << "maximumSize=" << maximumSize.width() << 'x' << maximumSize.height() << ' '; + } str << '\n'; #if QT_VERSION > 0x050000 if (const QWindow *win = w->windowHandle()) { @@ -74,12 +96,17 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w, } } -void dumpAllWidgets(FormatWindowOptions options) +void dumpAllWidgets(FormatWindowOptions options, const QWidget *root) { QString d; QTextStream str(&d); str << "### QWidgets:\n"; - foreach (QWidget *tw, QApplication::topLevelWidgets()) + QWidgetList topLevels; + if (root) + topLevels.append(const_cast<QWidget *>(root)); + else + topLevels = QApplication::topLevelWidgets(); + foreach (QWidget *tw, topLevels) dumpWidgetRecursion(str, tw, options); #if QT_VERSION >= 0x050400 qDebug().noquote() << d; |