summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-10-22 11:31:31 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-25 09:37:58 +0000
commit31a722365a55cc64115795442ab5869c980503d4 (patch)
tree43b20c1b8252ad0c7052aa549aee50d3cf8643ca
parente104b3d20ac71284517b92b922b79b79289469bb (diff)
downloadqtconnectivity-31a722365a55cc64115795442ab5869c980503d4.tar.gz
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 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit f1977883ad561b034ad95c801049a90915e81bc8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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"