aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/views/delegatemodel
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/views/delegatemodel')
-rw-r--r--examples/quick/views/delegatemodel/dragselection.qml5
-rw-r--r--examples/quick/views/delegatemodel/flipable.pro9
-rw-r--r--examples/quick/views/delegatemodel/flipable.qrc9
-rw-r--r--examples/quick/views/delegatemodel/main.cpp51
-rw-r--r--examples/quick/views/delegatemodel/slideshow.qml4
5 files changed, 76 insertions, 2 deletions
diff --git a/examples/quick/views/delegatemodel/dragselection.qml b/examples/quick/views/delegatemodel/dragselection.qml
index 15fd2654c2..f9a0d37311 100644
--- a/examples/quick/views/delegatemodel/dragselection.qml
+++ b/examples/quick/views/delegatemodel/dragselection.qml
@@ -48,6 +48,7 @@
**
****************************************************************************/
+import QtQml 2.0
import QtQuick 2.0
import QtQml.Models 2.1
@@ -64,6 +65,8 @@ Item {
Package {
id: packageRoot
+ required property var modelData
+
MouseArea {
id: visibleContainer
Package.name: "visible"
@@ -130,7 +133,7 @@ Item {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: "white"
- text: modelData
+ text: packageRoot.modelData
font.pixelSize: 18
}
diff --git a/examples/quick/views/delegatemodel/flipable.pro b/examples/quick/views/delegatemodel/flipable.pro
new file mode 100644
index 0000000000..ba00bf792c
--- /dev/null
+++ b/examples/quick/views/delegatemodel/flipable.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+
+QT += quick qml
+SOURCES += main.cpp
+
+RESOURCES += flipable.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/flipable
+INSTALLS += target
diff --git a/examples/quick/views/delegatemodel/flipable.qrc b/examples/quick/views/delegatemodel/flipable.qrc
new file mode 100644
index 0000000000..7918ccf00e
--- /dev/null
+++ b/examples/quick/views/delegatemodel/flipable.qrc
@@ -0,0 +1,9 @@
+<RCC>
+ <qresource prefix="/">
+ <file>flipable.qml</file>
+ <file>content/5_heart.png</file>
+ <file>content/9_club.png</file>
+ <file>content/back.png</file>
+ <file>content/Card.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/quick/views/delegatemodel/main.cpp b/examples/quick/views/delegatemodel/main.cpp
new file mode 100644
index 0000000000..a0f0d67d45
--- /dev/null
+++ b/examples/quick/views/delegatemodel/main.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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$
+**
+****************************************************************************/
+#include "../../shared/shared.h"
+DECLARATIVE_EXAMPLE_MAIN(flipable)
diff --git a/examples/quick/views/delegatemodel/slideshow.qml b/examples/quick/views/delegatemodel/slideshow.qml
index b252519bbf..638c8bf10f 100644
--- a/examples/quick/views/delegatemodel/slideshow.qml
+++ b/examples/quick/views/delegatemodel/slideshow.qml
@@ -74,6 +74,8 @@ Rectangle {
width: 76; height: 76
+ required property string thumbnail
+
Rectangle {
id: image
x: 0; y: 0; width: 76; height: 76
@@ -86,7 +88,7 @@ Rectangle {
anchors.leftMargin: 1
anchors.topMargin: 1
- source: thumbnail
+ source: delegateItem.thumbnail
fillMode: Image.PreserveAspectFit
}