summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_applicationwindow.qml
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-10-16 14:02:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-25 15:07:33 +0200
commit3fdea4f160cbcf9a5c906c8ee05e8361f111a7ec (patch)
tree4d8720a54b73c7e4e8b2688c0a0e2e89cf69473e /tests/auto/controls/data/tst_applicationwindow.qml
parent2f77a972eafacebcc5a44204dbf577258de1c4a1 (diff)
downloadqtquickcontrols-3fdea4f160cbcf9a5c906c8ee05e8361f111a7ec.tar.gz
Adjust height if the ToolBar or StatusBar is dynamically hidden
Triggered by a manual test I'm working on Change-Id: I8d49a7d19ac7daebda388df8e2d8595607fdd52c Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_applicationwindow.qml')
-rw-r--r--tests/auto/controls/data/tst_applicationwindow.qml98
1 files changed, 98 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_applicationwindow.qml b/tests/auto/controls/data/tst_applicationwindow.qml
new file mode 100644
index 00000000..e424cc2d
--- /dev/null
+++ b/tests/auto/controls/data/tst_applicationwindow.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module 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 Digia Plc and its Subsidiary(-ies) 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.1
+import QtTest 1.0
+import QtQuickControlsTests 1.0
+
+Item {
+ id: container
+ width: 400
+ height: 400
+
+TestCase {
+ id: testCase
+ name: "Tests_ApplicationWindow"
+ when:windowShown
+ width:400
+ height:400
+
+ function test_minimumHeight() {
+ var test_control = 'import QtQuick 2.1; \
+ import QtQuick.Controls 1.1; \
+ ApplicationWindow { \
+ width: 100; height: 100; \
+ property alias contentArea: rect; \
+ statusBar: StatusBar { \
+ visible: false; \
+ Label { \
+ text: "Ready"; \
+ } \
+ } \
+ \
+ toolBar: ToolBar { \
+ visible: false; \
+ ToolButton { \
+ text: "One"; \
+ } \
+ } \
+ Rectangle { \
+ id: rect; \
+ anchors.fill: parent; \
+ } \
+ } '
+
+ var window = Qt.createQmlObject(test_control, container, '')
+ wait(0)
+ var contentArea = window.contentArea
+ var oldHeight = contentArea.height
+ compare(contentArea.height, 100)
+ window.statusBar.visible = true
+ wait(0)
+ verify(contentArea.height < oldHeight)
+
+ oldHeight = contentArea.height;
+ window.toolBar.visible = true
+ wait(0)
+ verify(contentArea.height < oldHeight)
+ window.destroy()
+ }
+}
+}