Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
6.2.3
-
None
Description
When I run qmlint it catches an error when trying to access a property or id outside of a delegate.
For the modelData I added the required property.
But it is not possible to set a required property for the id "page". Any object I try to access from outside results in "unqualified"
import QtQuick import QtQuick.Controls import Rask.BluScan import App Page { id: page required property StackView stackView required property BluetoothController bluetoothController ListView { id: listViewDevices anchors.fill: parent property string test model: page.bluetoothController.devices delegate: ItemDevice { required property BluetoothDevice modelData device: modelData // When trying to access the id page the following error appears: DeviceDiscoveryPage.qml:24:24: Unqualified access onClicked: page.stackView.push(Qt.resolvedUrl("DevicePage.qml"), { "device": modelData, "stackView": page.stackView }) } } footer: FooterBar { width: parent.width height: startDiscoveryButton.height + 10 Button { id: startDiscoveryButton enabled: !page.bluetoothController.discovering text: page.bluetoothController.discovering ? "Discovering..." : "Start discovery" icon.name: enabled ? "bluetooth" : "bluetooth-searching" highlighted: true anchors.centerIn: parent onClicked: page.bluetoothController.startDiscovering() } } }
Attachments
Issue Links
- relates to
-
QTBUG-102806 qmllint: access properties outside delegate without qmllint warnings
-
- Closed
-