diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2012-12-28 17:35:54 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-08 13:54:04 +0100 |
commit | 54fd35b134af8d2a17c9c4ece531ddd2ee7258e2 (patch) | |
tree | 07353890fc345ff69920df14bb3a31a2bfe30b7e /tests/auto/widgets/kernel/qboxlayout | |
parent | 41acb58f23c78133657d3fb7d126b6df67e8846f (diff) |
Fix warnings about not being able to set Window geometry on Windows.
Fully decorated windows cannot be smaller than 160x30 (Large fonts).
Enlarge Windows or remove Window frame to get rid of decorations.
Task-number: QTBUG-28611
Change-Id: Idb6ee94fb8d0760d5f97042b3084557f11e9fdf9
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto/widgets/kernel/qboxlayout')
-rw-r--r-- | tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp index 4f1615a48e..f1e2c94966 100644 --- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp +++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp @@ -44,6 +44,14 @@ #include <QtGui> #include <QtWidgets> +static inline void setFrameless(QWidget *w) +{ + Qt::WindowFlags flags = w->windowFlags(); + flags |= Qt::FramelessWindowHint; + flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); + w->setWindowFlags(flags); +} + class tst_QBoxLayout : public QObject { Q_OBJECT @@ -198,6 +206,7 @@ void tst_QBoxLayout::sizeConstraints() void tst_QBoxLayout::setGeometry() { QWidget toplevel; + setFrameless(&toplevel); QWidget w(&toplevel); QVBoxLayout *lay = new QVBoxLayout; lay->setMargin(0); |