aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2025-03-14 15:23:52 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2025-03-17 13:08:13 +0000
commit704ce91ebdc39650da97f73e6540c0629006333e (patch)
tree588fc150253d8d61c42c0ef9d17af34144bcac8e /examples
parent4f473739f751973e2a070fa63d2e2974fe61016a (diff)
VectorImage example: Fix qmllint warnings
Use required properties where needed, and properly qualify lookups. Use ComponentBehavior: Bound so that the delegates can safely refer to the ids in the same file. This does not fix the unqualified warning in Heart.qml, as that file is auto-generated, and the generator would need the fix instead. Task-number: QTBUG-134589 Pick-to: 6.8 6.9 Change-Id: I6ef213004e0bb3e905a831749e9f0c2c5ca92518 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/vectorimage/Main.qml7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/quick/vectorimage/Main.qml b/examples/quick/vectorimage/Main.qml
index 44faf9d370..712908f6e8 100644
--- a/examples/quick/vectorimage/Main.qml
+++ b/examples/quick/vectorimage/Main.qml
@@ -1,5 +1,6 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
@@ -85,6 +86,8 @@ ApplicationWindow {
property int count: grid.columns
model: grid.columns * count
Item {
+ id: repeaterDelegate
+ required property int index
property int margin: 10
Layout.preferredHeight: ((grid.height - label.height - margin) / repeater.count)
Layout.preferredWidth: ((grid.height - label.height - margin) / repeater.count)
@@ -99,12 +102,12 @@ ApplicationWindow {
}
Item {
- property int row: index / grid.columns
+ property int row: repeaterDelegate.index / grid.columns
transformOrigin: Item.Center
anchors.fill: parent
Loader {
id: loader
- property int column: index % grid.columns
+ property int column: repeaterDelegate.index % grid.columns
anchors.centerIn: parent
sourceComponent: {