aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/view.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/view.qml')
-rw-r--r--examples/declarative/view.qml30
1 files changed, 20 insertions, 10 deletions
diff --git a/examples/declarative/view.qml b/examples/declarative/view.qml
index ec5597d..caf2dc1 100644
--- a/examples/declarative/view.qml
+++ b/examples/declarative/view.qml
@@ -1,10 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
+** This file is part of the PySide examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -18,10 +17,10 @@
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
-** * Neither the name of Nokia Corporation 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.
+** * 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
@@ -34,11 +33,12 @@
** 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 Qt 4.7
+import QtQuick 2.0
ListView {
width: 100
@@ -49,7 +49,17 @@ ListView {
Rectangle {
height: 25
width: 100
- Text { text: modelData }
+ Text {
+ function displayText() {
+ var result = ""
+ if (typeof display !== "undefined")
+ result = display + ": "
+ result += modelData
+ return result
+ }
+
+ text: displayText()
+ }
}
}
}