1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the test suite of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
47 property string testtext: ""
50 id: imageelementcontainer
51 height: 100; width: 100; clip: true
52 anchors.centerIn: parent
53 Behavior on height { NumberAnimation { duration: 1000 } }
54 Behavior on width { NumberAnimation { duration: 1000 } }
58 source: "pics/nokialogo.gif"; sourceSize.width: 60; sourceSize.height: 80
62 SystemTestHelp { id: helpbubble; visible: statenum != 0
63 anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 }
65 BugPanel { id: bugpanel }
68 State { name: "start"; when: statenum == 1
69 PropertyChanges { target: imageelementtest
70 testtext: "This is an Image element. It should be small and be showing the Nokia logo, but slightly stretched.\n"+
71 "Next, it should animatedly increase to twice its size" }
73 State { name: "large"; when: statenum == 2
74 PropertyChanges { target: imageelementcontainer; height: 200; width: 200 }
75 PropertyChanges { target: imageelementtest
76 testtext: "It should be large and still showing the slightly stretched Nokia logo.\n"+
77 "Next, it will change to preserve its aspect ratio" }
79 State { name: "largefit"; when: statenum == 3
80 PropertyChanges { target: imageelementcontainer; height: 200; width: 200 }
81 PropertyChanges { target: imageelement; fillMode: Image.PreserveAspectFit }
82 PropertyChanges { target: imageelementtest
83 testtext: "It should be large and now showing the Nokia logo normally (longer horizontally).\n"+
84 "Next, it will change its aspect ratio to fit, but cropping the sides" }
86 State { name: "largecrop"; when: statenum == 4
87 PropertyChanges { target: imageelementcontainer; height: 200; width: 200 }
88 PropertyChanges { target: imageelement; fillMode: Image.PreserveAspectCrop }
89 PropertyChanges { target: imageelementtest
90 testtext: "It should be large and now showing the Nokia logo with the sides removed.\n"+
91 "Next, let's change the image to tile the square" }
93 State { name: "largetile"; when: statenum == 5
94 PropertyChanges { target: imageelementcontainer; height: 200; width: 200 }
95 PropertyChanges { target: imageelement; fillMode: Image.Tile; }
96 PropertyChanges { target: imageelementtest
97 testtext: "The image should be repeated both horizontally and vertically.\n"+
98 "Next, let's change the image to tile the square vertically" }
100 State { name: "largetilevertical"; when: statenum == 6
101 PropertyChanges { target: imageelementcontainer; height: 200; width: 200 }
102 PropertyChanges { target: imageelement; fillMode: Image.TileVertically; }
103 PropertyChanges { target: imageelementtest
104 testtext: "The image should be repeated only vertically.\n"+
105 "Next, let's change the image to tile the square horizontally" }
107 State { name: "largetilehorizontal"; when: statenum == 7
108 PropertyChanges { target: imageelementcontainer; height: 200; width: 200 }
109 PropertyChanges { target: imageelement; fillMode: Image.TileHorizontally; }
110 PropertyChanges { target: imageelementtest
111 testtext: "The image should be repeated only horizontally.\n"+
112 "The next step will return the image to a small, stretched state" }