From ed1ec14b6aca705bfd4e08a8a846bf8d940edeb2 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 5 Jun 2020 13:41:16 +0200 Subject: QQuickStackView: deprecate Transition enum value bc86a96c56934d98d641844319a905753f56895a added a comment that this was deprecated, but didn't document it as deprecated or have any mention of it being deprecated besides that one comment. As we are dynamically evaluating the JS arguments in C++, we don't need to have a "default" enum value; we can detect omission of the argument and act accordingly. It's now too late to deprecate it for Qt 5, but we can do it for Qt 6. [ChangeLog][Controls][StackView] The StackView.Transition enum value was deprecated. The operation argument can be omitted in order to use the default transition for any given operation. Task-number: QTBUG-84715 Change-Id: I530235beb2ebf56deb6f82ab54e269322e92a0a5 Reviewed-by: Richard Moe Gustavsen --- src/quicktemplates2/qquickstackview.cpp | 13 ++++++++----- src/quicktemplates2/qquickstackview_p.h | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp index e5e2c39b..83f99843 100644 --- a/src/quicktemplates2/qquickstackview.cpp +++ b/src/quicktemplates2/qquickstackview.cpp @@ -498,7 +498,7 @@ QQuickItem *QQuickStackView::find(const QJSValue &callback, LoadBehavior behavio /*! \qmlmethod Item QtQuick.Controls::StackView::push(item, properties, operation) - Pushes an \a item onto the stack using the specified \a operation, and + Pushes an \a item onto the stack using an optional \a operation, and optionally applies a set of \a properties on the item. The item can be an \l Item, \l Component, or a \l [QML] url. Returns the item that became current. @@ -545,12 +545,13 @@ QQuickItem *QQuickStackView::find(const QJSValue &callback, LoadBehavior behavio An \a operation can be optionally specified as the last argument. Supported operations: - \value StackView.Transition An operation with default transitions (default). \value StackView.Immediate An immediate operation without transitions. \value StackView.PushTransition An operation with push transitions (since QtQuick.Controls 2.1). \value StackView.ReplaceTransition An operation with replace transitions (since QtQuick.Controls 2.1). \value StackView.PopTransition An operation with pop transitions (since QtQuick.Controls 2.1). + If no operation is provided, \c PushTransition will be used. + \note Items that already exist in the stack are not pushed. \sa initialItem, {Pushing Items} @@ -639,12 +640,13 @@ void QQuickStackView::push(QQmlV4Function *args) An \a operation can be optionally specified as the last argument. Supported operations: - \value StackView.Transition An operation with default transitions (default). \value StackView.Immediate An immediate operation without transitions. \value StackView.PushTransition An operation with push transitions (since QtQuick.Controls 2.1). \value StackView.ReplaceTransition An operation with replace transitions (since QtQuick.Controls 2.1). \value StackView.PopTransition An operation with pop transitions (since QtQuick.Controls 2.1). + If no operation is provided, \c PopTransition will be used. + Examples: \code stackView.pop() @@ -733,7 +735,7 @@ void QQuickStackView::pop(QQmlV4Function *args) \qmlmethod Item QtQuick.Controls::StackView::replace(target, item, properties, operation) Replaces one or more items on the stack with the specified \a item and - \a operation, and optionally applies a set of \a properties on the + optional \a operation, and optionally applies a set of \a properties on the item. The item can be an \l Item, \l Component, or a \l [QML] url. Returns the item that became current. @@ -782,12 +784,13 @@ void QQuickStackView::pop(QQmlV4Function *args) An \a operation can be optionally specified as the last argument. Supported operations: - \value StackView.Transition An operation with default transitions (default). \value StackView.Immediate An immediate operation without transitions. \value StackView.PushTransition An operation with push transitions (since QtQuick.Controls 2.1). \value StackView.ReplaceTransition An operation with replace transitions (since QtQuick.Controls 2.1). \value StackView.PopTransition An operation with pop transitions (since QtQuick.Controls 2.1). + If no operation is provided, \c ReplaceTransition will be used. + The following example illustrates the use of push and pop transitions with replace(). \code diff --git a/src/quicktemplates2/qquickstackview_p.h b/src/quicktemplates2/qquickstackview_p.h index 9bb9c8f4..f551f027 100644 --- a/src/quicktemplates2/qquickstackview_p.h +++ b/src/quicktemplates2/qquickstackview_p.h @@ -124,7 +124,7 @@ public: Q_INVOKABLE QQuickItem *find(const QJSValue &callback, LoadBehavior behavior = DontLoad); enum Operation { - Transition = -1, // deprecated + Transition = -1, // ### Deprecated in Qt 6; remove in Qt 7. Immediate = 0, PushTransition = 1, ReplaceTransition = 2, -- cgit v1.2.3