From e8c619517ba1f75224c61334f67ae165d704b184 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 12 Sep 2018 08:42:40 +0200 Subject: QQuickStackView: Fix deprecated function call warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/quicktemplates2/qquickstackview_p.cpp | 8 ++++---- 1 file 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 QQuickStackViewPrivate::parseElements(int from, QQml for (int i = from; i < argc; ++i) { QV4::ScopedValue arg(scope, (*args)[i]); if (QV4::ArrayObject *array = arg->as()) { - 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; } -- cgit v1.2.3