diff options
author | Alberto Mardegan <mardy@users.sourceforge.net> | 2015-11-12 01:56:30 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-04-13 20:15:18 +0000 |
commit | 10f0ae7c571b7e0de41d5fdc5627db6a1ddeb926 (patch) | |
tree | 622ecd0110a02a3b2cdc5d52f1b8aeb08639f1f2 /tests/auto/dialogs/data/DialogImplicitSize.qml | |
parent | 726b6ee9b43652ef198a7df590b08e641dd69377 (diff) | |
download | qtquickcontrols-10f0ae7c571b7e0de41d5fdc5627db6a1ddeb926.tar.gz |
Dialog: allow proper resize and default size for content
Currently Dialog use implicitly positioned items as content. This makes
impossible to use item, that can be properly resized with change of
dialog window size and has proper default size (set implicit width and
height).
This change made it use implicit size if there is one item or fallback
to previous algorithm, that use childrenRect for explicitly sized and
positioned items, so it won't break behavior of the existing
applications.
[ChangeLog][Dialog] Proper resize and default size for content
Task-number: QTBUG-49058
Change-Id: I7fa4da7d5fd39d47f60ba9f43c88f78e75739b0a
Initial-patch-by: Nikita Krupenko <krnekit@gmail.com>
Reviewed-by: Nikita Krupenko <krnekit@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'tests/auto/dialogs/data/DialogImplicitSize.qml')
-rw-r--r-- | tests/auto/dialogs/data/DialogImplicitSize.qml | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/auto/dialogs/data/DialogImplicitSize.qml b/tests/auto/dialogs/data/DialogImplicitSize.qml new file mode 100644 index 00000000..8239c451 --- /dev/null +++ b/tests/auto/dialogs/data/DialogImplicitSize.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.3 +import QtQuick.Controls 1.2 +import QtQuick.Dialogs 1.2 + +Dialog { + visible: true + title: "Blue sky dialog" + standardButtons: buttonsFromTest + + Rectangle { + color: "lightskyblue" + implicitWidth: 400 + implicitHeight: 150 + Text { + text: "Hello blue sky!" + color: "navy" + anchors.centerIn: parent + } + } +} |