summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-09-12 08:42:40 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-09-12 08:45:41 +0000
commite8c619517ba1f75224c61334f67ae165d704b184 (patch)
tree30caa0fa28280bae7225dbdde09631597f1956a6
parent9f44550333c0e29b03ab6fbbca161ab954a3706f (diff)
QQuickStackView: Fix deprecated function call warningv5.12.0-alpha1
QV4::Object::getIndexed(uint) is deprecated in favor of get(uint). On this occasion, fix signedness warnings by changing j and len to be of type uint. Fixes: qquickstackview_p.cpp:103:66: warning: ‘QV4::ReturnedValue QV4::Object::getIndexed(uint, bool*) const’ is deprecated [-Wdeprecated-declarations] QV4::ScopedValue value(scope, array->getIndexed(j)); QT_DEPRECATED inline ReturnedValue getIndexed(uint idx, bool *hasProperty = nullptr) const qquickstackview_p.cpp:107:78: warning: ‘QV4::ReturnedValue QV4::Object::getIndexed(uint, bool*) const’ is deprecated [-Wdeprecated-declarations] QV4::ScopedValue props(scope, array->getIndexed(j + 1)); QT_DEPRECATED inline ReturnedValue getIndexed(uint idx, bool *hasProperty = nullptr) const Change-Id: I6c0b0d54dd4119a2531f847788c531daf92e6954 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quicktemplates2/qquickstackview_p.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickstackview_p.cpp b/src/quicktemplates2/qquickstackview_p.cpp
index 3d6afa9f..7cb943a3 100644
--- a/src/quicktemplates2/qquickstackview_p.cpp
+++ b/src/quicktemplates2/qquickstackview_p.cpp
@@ -97,14 +97,14 @@ QList<QQuickStackElement *> QQuickStackViewPrivate::parseElements(int from, QQml
for (int i = from; i < argc; ++i) {
QV4::ScopedValue arg(scope, (*args)[i]);
if (QV4::ArrayObject *array = arg->as<QV4::ArrayObject>()) {
- int len = array->getLength();
- for (int j = 0; j < len; ++j) {
+ const uint len = uint(array->getLength());
+ for (uint j = 0; j < len; ++j) {
QString error;
- QV4::ScopedValue value(scope, array->getIndexed(j));
+ QV4::ScopedValue value(scope, array->get(j));
QQuickStackElement *element = createElement(value, context, &error);
if (element) {
if (j < len - 1) {
- QV4::ScopedValue props(scope, array->getIndexed(j + 1));
+ QV4::ScopedValue props(scope, array->get(j + 1));
if (initProperties(element, props, args))
++j;
}