aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/tableview
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-03-10 15:09:37 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-12 15:03:03 +0100
commit26c5243491f495194f04b449128dae36118e28da (patch)
tree7fb14678a6fc9e44a10c9224d005e2cbdc6bcb63 /examples/quick/tableview
parent1c7d264e3b2e9a2f0021786ea6967185f8282af0 (diff)
parentc24c5baeda4101b0058689adf9200b77a722c3a2 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
Diffstat (limited to 'examples/quick/tableview')
-rw-r--r--examples/quick/tableview/gameoflife/main.qml8
-rw-r--r--examples/quick/tableview/pixelator/main.qml6
2 files changed, 10 insertions, 4 deletions
diff --git a/examples/quick/tableview/gameoflife/main.qml b/examples/quick/tableview/gameoflife/main.qml
index 90be69b9c0..fb3195892f 100644
--- a/examples/quick/tableview/gameoflife/main.qml
+++ b/examples/quick/tableview/gameoflife/main.qml
@@ -48,6 +48,7 @@
**
****************************************************************************/
+import QtQml 2.12
import QtQuick 2.12
import QtQuick.Window 2.3
import QtQuick.Controls 2.2
@@ -81,11 +82,14 @@ ApplicationWindow {
implicitWidth: 15
implicitHeight: 15
- color: model.value ? "#f3f3f4" : "#b5b7bf"
+ required property var model
+ required property bool value
+
+ color: value ? "#f3f3f4" : "#b5b7bf"
MouseArea {
anchors.fill: parent
- onClicked: model.value = !model.value
+ onClicked: parent.model.value = !parent.value
}
}
//! [tableview]
diff --git a/examples/quick/tableview/pixelator/main.qml b/examples/quick/tableview/pixelator/main.qml
index 38a25f439f..a5edefae90 100644
--- a/examples/quick/tableview/pixelator/main.qml
+++ b/examples/quick/tableview/pixelator/main.qml
@@ -65,7 +65,9 @@ Window {
id: pixelDelegate
Item {
- readonly property real gray: model.display / 255.0
+ required property real display
+
+ readonly property real gray: display / 255.0
readonly property real size: 16
implicitWidth: size
@@ -77,7 +79,7 @@ Window {
id: rect
anchors.centerIn: parent
color: "#09102b"
- radius: size - gray * size
+ radius: parent.size - parent.gray * parent.size
implicitWidth: radius
implicitHeight: radius
//! [rectshape]