summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-10-22 11:31:31 +0300
committerJuha Vuolle <juha.vuolle@insta.fi>2021-10-25 09:50:31 +0300
commitf1977883ad561b034ad95c801049a90915e81bc8 (patch)
tree01b7dbd88e8254db5309961b8f4512f691279acc
parentda125c6e12132a582008cd36080cd76815de8a6d (diff)
Fix 'width' of 'null' QML warnings in lowenergyscanner example
As per Qt documentation in https://doc.qt.io/qt-5/qml-qtquick-listview.html#example-usage the parent of a delegate can change and be 'null' at times. This commit refers explicitly to the containing view instead. Change-Id: I9c9a8c907daba2b6de52a246ae71cfde0c27e55b Fixes: QTBUG-97691 Pick-to: 6.2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
-rw-r--r--examples/bluetooth/lowenergyscanner/assets/Characteristics.qml2
-rw-r--r--examples/bluetooth/lowenergyscanner/assets/Services.qml2
-rw-r--r--examples/bluetooth/lowenergyscanner/assets/main.qml2
3 files changed, 3 insertions, 3 deletions
diff --git a/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml b/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml
index 1f892061..84c9c646 100644
--- a/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml
+++ b/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml
@@ -98,7 +98,7 @@ Rectangle {
delegate: Rectangle {
id: characteristicbox
height:300
- width: parent.width
+ width: characteristicview.width
color: "lightsteelblue"
border.width: 2
border.color: "black"
diff --git a/examples/bluetooth/lowenergyscanner/assets/Services.qml b/examples/bluetooth/lowenergyscanner/assets/Services.qml
index a86d9ffb..38144123 100644
--- a/examples/bluetooth/lowenergyscanner/assets/Services.qml
+++ b/examples/bluetooth/lowenergyscanner/assets/Services.qml
@@ -107,7 +107,7 @@ Rectangle {
border.width: 2
border.color: "black"
radius: 5
- width: parent.width
+ width: servicesview.width
Component.onCompleted: {
info.visible = false
}
diff --git a/examples/bluetooth/lowenergyscanner/assets/main.qml b/examples/bluetooth/lowenergyscanner/assets/main.qml
index ea3214e2..0a924de1 100644
--- a/examples/bluetooth/lowenergyscanner/assets/main.qml
+++ b/examples/bluetooth/lowenergyscanner/assets/main.qml
@@ -85,7 +85,7 @@ Rectangle {
delegate: Rectangle {
id: box
height:100
- width: parent.width
+ width: theListView.width
color: "lightsteelblue"
border.width: 2
border.color: "black"