summaryrefslogtreecommitdiffstats
path: root/tests/manual/diaglib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-02 15:57:44 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-02 15:57:44 +0100
commitd3e6e732c70ebc2340d6376d727b3c623be23810 (patch)
tree18d469f02ac36edd04b87a9bfa4886ceef0490f0 /tests/manual/diaglib
parentfdfd63053ae6b10af06553be3c1b15de274bebf7 (diff)
parentba8d3430029d8c4342e9a47c110ee8c9879818f4 (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')
-rw-r--r--tests/manual/diaglib/qwidgetdump.cpp31
-rw-r--r--tests/manual/diaglib/qwidgetdump.h4
-rw-r--r--tests/manual/diaglib/qwindowdump.cpp10
-rw-r--r--tests/manual/diaglib/qwindowdump.h3
4 files changed, 44 insertions, 4 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;
diff --git a/tests/manual/diaglib/qwidgetdump.h b/tests/manual/diaglib/qwidgetdump.h
index 961f26a2f5..f3eb1fda8d 100644
--- a/tests/manual/diaglib/qwidgetdump.h
+++ b/tests/manual/diaglib/qwidgetdump.h
@@ -31,9 +31,11 @@
#include "qwindowdump.h"
+QT_FORWARD_DECLARE_CLASS(QWidget)
+
namespace QtDiag {
-void dumpAllWidgets(FormatWindowOptions options = 0);
+void dumpAllWidgets(FormatWindowOptions options = 0, const QWidget *root = 0);
} // namespace QtDiag
diff --git a/tests/manual/diaglib/qwindowdump.cpp b/tests/manual/diaglib/qwindowdump.cpp
index 5e245bcdc7..19c9ca30e9 100644
--- a/tests/manual/diaglib/qwindowdump.cpp
+++ b/tests/manual/diaglib/qwindowdump.cpp
@@ -33,6 +33,7 @@
# include <QtGui/QScreen>
# include <QtGui/QWindow>
# include <qpa/qplatformwindow.h>
+# include <private/qwindow_p.h>
# if QT_VERSION >= 0x050600
# include <private/qhighdpiscaling_p.h>
# endif
@@ -146,6 +147,15 @@ void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions option
str << ' ';
formatWindowFlags(str, w->flags());
}
+ 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 maximumSize = w->maximumSize();
+ if (maximumSize.width() < QWINDOWSIZE_MAX || maximumSize.height() < QWINDOWSIZE_MAX)
+ str << "maximumSize=" << maximumSize.width() << 'x' << maximumSize.height() << ' ';
+ }
str << '\n';
}
diff --git a/tests/manual/diaglib/qwindowdump.h b/tests/manual/diaglib/qwindowdump.h
index 385f624f10..74f976567a 100644
--- a/tests/manual/diaglib/qwindowdump.h
+++ b/tests/manual/diaglib/qwindowdump.h
@@ -39,7 +39,8 @@ QT_FORWARD_DECLARE_CLASS(QTextStream)
namespace QtDiag {
enum FormatWindowOption {
- DontPrintWindowFlags = 0x001
+ DontPrintWindowFlags = 0x001,
+ PrintSizeConstraints = 0x002
};
Q_DECLARE_FLAGS(FormatWindowOptions, FormatWindowOption)