From 0c65ffef9b021555c03081e4e60e91a268d46c98 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 5 Jan 2017 21:07:35 +0100 Subject: QtQuickControls2: Use the newly-introduced qmlWarning instead of qmlInfo qmlInfo will shortly be returning info-level messages (as the name hints), rather than warning level messages. Change-Id: I94123464b12b30a4ba085cfb7b606bc26df9b76e Reviewed-by: Simon Hausmann --- src/quicktemplates2/qquickpopup.cpp | 2 +- src/quicktemplates2/qquickscrollbar.cpp | 2 +- src/quicktemplates2/qquickscrollindicator.cpp | 2 +- src/quicktemplates2/qquickspinbox.cpp | 4 ++-- src/quicktemplates2/qquickstackelement.cpp | 2 +- src/quicktemplates2/qquickstackview.cpp | 14 +++++++------- src/quicktemplates2/qquickswipedelegate.cpp | 12 ++++++------ src/quicktemplates2/qquickswipeview.cpp | 4 ++-- src/quicktemplates2/qquicktextarea.cpp | 2 +- src/quicktemplates2/qquicktooltip.cpp | 2 +- src/quicktemplates2/qquicktumbler.cpp | 2 +- 11 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/quicktemplates2') diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 6690fac1..06a3c34e 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -279,7 +279,7 @@ bool QQuickPopupPrivate::prepareEnterTransition() { Q_Q(QQuickPopup); if (!window) { - qmlInfo(q) << "cannot find any window to open popup in."; + qmlWarning(q) << "cannot find any window to open popup in."; return false; } diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp index e8c523f2..d8729637 100644 --- a/src/quicktemplates2/qquickscrollbar.cpp +++ b/src/quicktemplates2/qquickscrollbar.cpp @@ -274,7 +274,7 @@ QQuickScrollBarAttached *QQuickScrollBar::qmlAttachedProperties(QObject *object) { QQuickFlickable *flickable = qobject_cast(object); if (!flickable) - qmlInfo(object) << "ScrollBar must be attached to a Flickable"; + qmlWarning(object) << "ScrollBar must be attached to a Flickable"; return new QQuickScrollBarAttached(flickable); } diff --git a/src/quicktemplates2/qquickscrollindicator.cpp b/src/quicktemplates2/qquickscrollindicator.cpp index e858e7c1..e9cadcc7 100644 --- a/src/quicktemplates2/qquickscrollindicator.cpp +++ b/src/quicktemplates2/qquickscrollindicator.cpp @@ -173,7 +173,7 @@ QQuickScrollIndicatorAttached *QQuickScrollIndicator::qmlAttachedProperties(QObj { QQuickFlickable *flickable = qobject_cast(object); if (!flickable) - qmlInfo(object) << "ScrollIndicator must be attached to a Flickable"; + qmlWarning(object) << "ScrollIndicator must be attached to a Flickable"; return new QQuickScrollIndicatorAttached(flickable); } diff --git a/src/quicktemplates2/qquickspinbox.cpp b/src/quicktemplates2/qquickspinbox.cpp index 54e2fa43..50fd778e 100644 --- a/src/quicktemplates2/qquickspinbox.cpp +++ b/src/quicktemplates2/qquickspinbox.cpp @@ -521,7 +521,7 @@ void QQuickSpinBox::setTextFromValue(const QJSValue &callback) { Q_D(QQuickSpinBox); if (!callback.isCallable()) { - qmlInfo(this) << "textFromValue must be a callable function"; + qmlWarning(this) << "textFromValue must be a callable function"; return; } d->textFromValue = callback; @@ -569,7 +569,7 @@ void QQuickSpinBox::setValueFromText(const QJSValue &callback) { Q_D(QQuickSpinBox); if (!callback.isCallable()) { - qmlInfo(this) << "valueFromText must be a callable function"; + qmlWarning(this) << "valueFromText must be a callable function"; return; } d->valueFromText = callback; diff --git a/src/quicktemplates2/qquickstackelement.cpp b/src/quicktemplates2/qquickstackelement.cpp index 7bd6efc9..6dcd5e75 100644 --- a/src/quicktemplates2/qquickstackelement.cpp +++ b/src/quicktemplates2/qquickstackelement.cpp @@ -274,7 +274,7 @@ bool QQuickStackElement::prepareTransition(QQuickItemViewTransitioner *transitio QQuickAnchors *anchors = QQuickItemPrivate::get(item)->_anchors; // TODO: expose QQuickAnchorLine so we can test for other conflicting anchors if (anchors && (anchors->fill() || anchors->centerIn())) - qmlInfo(item) << "StackView has detected conflicting anchors. Transitions may not execute properly."; + qmlWarning(item) << "StackView has detected conflicting anchors. Transitions may not execute properly."; } // TODO: add force argument to QQuickItemViewTransitionableItem::prepareTransition()? diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp index 4fb153ab..e68f2028 100644 --- a/src/quicktemplates2/qquickstackview.cpp +++ b/src/quicktemplates2/qquickstackview.cpp @@ -474,7 +474,7 @@ void QQuickStackView::push(QQmlV4Function *args) { Q_D(QQuickStackView); if (args->length() <= 0) { - qmlInfo(this) << "push: missing arguments"; + qmlWarning(this) << "push: missing arguments"; args->setReturnValue(QV4::Encode::null()); return; } @@ -498,7 +498,7 @@ void QQuickStackView::push(QQmlV4Function *args) } if (elements.isEmpty()) { - qmlInfo(this) << "push: nothing to push"; + qmlWarning(this) << "push: nothing to push"; args->setReturnValue(QV4::Encode::null()); return; } @@ -559,7 +559,7 @@ void QQuickStackView::pop(QQmlV4Function *args) int argc = args->length(); if (d->elements.count() <= 1 || argc > 2) { if (argc > 2) - qmlInfo(this) << "pop: too many arguments"; + qmlWarning(this) << "pop: too many arguments"; args->setReturnValue(QV4::Encode::null()); return; } @@ -579,7 +579,7 @@ void QQuickStackView::pop(QQmlV4Function *args) enter = d->findElement(item); if (!enter) { if (item != d->currentItem) - qmlInfo(this) << "pop: unknown argument: " << value->toQString(); // TODO: safe? + qmlWarning(this) << "pop: unknown argument: " << value->toQString(); // TODO: safe? args->setReturnValue(QV4::Encode::null()); d->elements.push(exit); // restore return; @@ -707,7 +707,7 @@ void QQuickStackView::replace(QQmlV4Function *args) { Q_D(QQuickStackView); if (args->length() <= 0) { - qmlInfo(this) << "replace: missing arguments"; + qmlWarning(this) << "replace: missing arguments"; args->setReturnValue(QV4::Encode::null()); return; } @@ -729,7 +729,7 @@ void QQuickStackView::replace(QQmlV4Function *args) QList elements = d->parseElements(args, target ? 1 : 0); if (elements.isEmpty()) { - qmlInfo(this) << "replace: nothing to push"; + qmlWarning(this) << "replace: nothing to push"; args->setReturnValue(QV4::Encode::null()); return; } @@ -1043,7 +1043,7 @@ QQuickStackViewAttached::QQuickStackViewAttached(QObject *parent) : QQuickItemPrivate::get(item)->addItemChangeListener(d, QQuickItemPrivate::Parent); d->itemParentChanged(item, item->parentItem()); } else if (parent) { - qmlInfo(parent) << "StackView must be attached to an Item"; + qmlWarning(parent) << "StackView must be attached to an Item"; } } diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp index f8b2496c..3ee08d1c 100644 --- a/src/quicktemplates2/qquickswipedelegate.cpp +++ b/src/quicktemplates2/qquickswipedelegate.cpp @@ -339,7 +339,7 @@ void QQuickSwipePrivate::createLeftItem() Q_Q(QQuickSwipe); q->setLeftItem(createDelegateItem(left)); if (!leftItem) - qmlInfo(control) << "Failed to create left item:" << left->errors(); + qmlWarning(control) << "Failed to create left item:" << left->errors(); } } @@ -349,7 +349,7 @@ void QQuickSwipePrivate::createBehindItem() Q_Q(QQuickSwipe); q->setBehindItem(createDelegateItem(behind)); if (!behindItem) - qmlInfo(control) << "Failed to create behind item:" << behind->errors(); + qmlWarning(control) << "Failed to create behind item:" << behind->errors(); } } @@ -359,7 +359,7 @@ void QQuickSwipePrivate::createRightItem() Q_Q(QQuickSwipe); q->setRightItem(createDelegateItem(right)); if (!rightItem) - qmlInfo(control) << "Failed to create right item:" << right->errors(); + qmlWarning(control) << "Failed to create right item:" << right->errors(); } } @@ -397,12 +397,12 @@ void QQuickSwipePrivate::createAndShowRightItem() void QQuickSwipePrivate::warnAboutMixingDelegates() { - qmlInfo(control) << "cannot set both behind and left/right properties"; + qmlWarning(control) << "cannot set both behind and left/right properties"; } void QQuickSwipePrivate::warnAboutSettingDelegatesWhileVisible() { - qmlInfo(control) << "left/right/behind properties may only be set when swipe.position is 0"; + qmlWarning(control) << "left/right/behind properties may only be set when swipe.position is 0"; } bool QQuickSwipePrivate::hasDelegates() const @@ -929,7 +929,7 @@ static void warnIfHorizontallyAnchored(QQuickItem *item, const QString &itemName QQuickAnchors *anchors = QQuickItemPrivate::get(item)->_anchors; if (anchors && (anchors->fill() || anchors->centerIn() || anchors->left().item || anchors->right().item) && !item->property("_q_QQuickSwipeDelegate_warned").toBool()) { - qmlInfo(item) << QString::fromLatin1("SwipeDelegate: cannot use horizontal anchors with %1; unable to layout the item.").arg(itemName); + qmlWarning(item) << QString::fromLatin1("SwipeDelegate: cannot use horizontal anchors with %1; unable to layout the item.").arg(itemName); item->setProperty("_q_QQuickSwipeDelegate_warned", true); } } diff --git a/src/quicktemplates2/qquickswipeview.cpp b/src/quicktemplates2/qquickswipeview.cpp index b2075e80..c447e5e0 100644 --- a/src/quicktemplates2/qquickswipeview.cpp +++ b/src/quicktemplates2/qquickswipeview.cpp @@ -127,7 +127,7 @@ void QQuickSwipeViewPrivate::resizeItems() QQuickAnchors *anchors = QQuickItemPrivate::get(item)->_anchors; // TODO: expose QQuickAnchorLine so we can test for other conflicting anchors if (anchors && (anchors->fill() || anchors->centerIn()) && !item->property("_q_QQuickSwipeView_warned").toBool()) { - qmlInfo(item) << "SwipeView has detected conflicting anchors. Unable to layout the item."; + qmlWarning(item) << "SwipeView has detected conflicting anchors. Unable to layout the item."; item->setProperty("_q_QQuickSwipeView_warned", true); } @@ -439,7 +439,7 @@ QQuickSwipeViewAttached::QQuickSwipeViewAttached(QObject *parent) : QQuickItemPrivate *p = QQuickItemPrivate::get(d->item); p->addItemChangeListener(d, QQuickItemPrivate::Parent | QQuickItemPrivate::Destroyed); } else if (parent) { - qmlInfo(parent) << "SwipeView: attached properties must be accessed from within a child item"; + qmlWarning(parent) << "SwipeView: attached properties must be accessed from within a child item"; } } diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index cf6b4274..c0758876 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -770,7 +770,7 @@ void QQuickTextAreaAttached::setFlickable(QQuickTextArea *control) Q_D(QQuickTextAreaAttached); QQuickFlickable *flickable = qobject_cast(parent()); if (!flickable) { - qmlInfo(parent()) << "TextArea must be attached to a Flickable"; + qmlWarning(parent()) << "TextArea must be attached to a Flickable"; return; } diff --git a/src/quicktemplates2/qquicktooltip.cpp b/src/quicktemplates2/qquicktooltip.cpp index 7a98ea58..d638a3c2 100644 --- a/src/quicktemplates2/qquicktooltip.cpp +++ b/src/quicktemplates2/qquicktooltip.cpp @@ -265,7 +265,7 @@ QQuickToolTipAttached *QQuickToolTip::qmlAttachedProperties(QObject *object) { QQuickItem *item = qobject_cast(object); if (!item) - qmlInfo(object) << "ToolTip must be attached to an Item"; + qmlWarning(object) << "ToolTip must be attached to an Item"; return new QQuickToolTipAttached(object); } diff --git a/src/quicktemplates2/qquicktumbler.cpp b/src/quicktemplates2/qquicktumbler.cpp index 7bf2c66f..d70b0932 100644 --- a/src/quicktemplates2/qquicktumbler.cpp +++ b/src/quicktemplates2/qquicktumbler.cpp @@ -817,7 +817,7 @@ QQuickTumblerAttached::QQuickTumblerAttached(QObject *parent) : if (delegateItem) d->init(delegateItem); else if (parent) - qmlInfo(parent) << "Tumbler: attached properties of Tumbler must be accessed through a delegate item"; + qmlWarning(parent) << "Tumbler: attached properties of Tumbler must be accessed through a delegate item"; if (d->tumbler) { // When the Tumbler is completed, wrapChanged() is emitted to let QQuickTumblerView -- cgit v1.2.3