diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-13 11:15:36 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-13 11:25:05 +0100 |
commit | 63c972ad9e15b673779147c4c263ed2ac5312a28 (patch) | |
tree | aa5e8470cd16f038cc5d47b429921f6481589fc5 | |
parent | 36276fc529529e795df62dae8278013bb4493c25 (diff) |
sensor_explorer: Fix warnings about deprecated QQmlListProperty APIv5.15.0-beta1
Pass the list by pointer, fixing:
sensors/sensor_explorer/import/explorer.cpp:120:64: warning: ‘QQmlListProperty<T>::QQmlListProperty(QObject*, QList<T*>&) [with T = QSensorItem]’ is deprecated
sensors/sensor_explorer/import/sensoritem.cpp:328:62: warning: ‘QQmlListProperty<T>::QQmlListProperty(QObject*, QList<T*>&) [with T = QPropertyInfo]’ is deprecated:
Use constructor taking QList pointer, and gain improved performance [-Wdeprecated-declarations]
Change-Id: I0652e806354d3ba43c551e4a3733bafd73f0ddfe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | examples/sensors/sensor_explorer/import/explorer.cpp | 2 | ||||
-rw-r--r-- | examples/sensors/sensor_explorer/import/sensoritem.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/sensors/sensor_explorer/import/explorer.cpp b/examples/sensors/sensor_explorer/import/explorer.cpp index 4773ee18..0665a98f 100644 --- a/examples/sensors/sensor_explorer/import/explorer.cpp +++ b/examples/sensors/sensor_explorer/import/explorer.cpp @@ -117,7 +117,7 @@ void QSensorExplorer::loadSensors() */ QQmlListProperty<QSensorItem> QSensorExplorer::availableSensors() { - return QQmlListProperty<QSensorItem>(this,_availableSensors); + return QQmlListProperty<QSensorItem>(this, &_availableSensors); } /* diff --git a/examples/sensors/sensor_explorer/import/sensoritem.cpp b/examples/sensors/sensor_explorer/import/sensoritem.cpp index 88b5fa7c..f268db3a 100644 --- a/examples/sensors/sensor_explorer/import/sensoritem.cpp +++ b/examples/sensors/sensor_explorer/import/sensoritem.cpp @@ -325,7 +325,7 @@ QQmlListProperty<QPropertyInfo> QSensorItem::properties() _properties.clear(); _properties.append(_sensorProperties); _properties.append(_readerProperties); - return QQmlListProperty<QPropertyInfo> (this, _properties); + return QQmlListProperty<QPropertyInfo> (this, &_properties); } QT_END_NAMESPACE |