aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickstate_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/util/qquickstate_p.h')
-rw-r--r--src/quick/util/qquickstate_p.h74
1 files changed, 21 insertions, 53 deletions
diff --git a/src/quick/util/qquickstate_p.h b/src/quick/util/qquickstate_p.h
index 79874ee78e..66d0303162 100644
--- a/src/quick/util/qquickstate_p.h
+++ b/src/quick/util/qquickstate_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQuick module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QQUICKSTATE_H
#define QQUICKSTATE_H
@@ -57,14 +21,19 @@
#include <QtCore/qsharedpointer.h>
#include <private/qtquickglobal_p.h>
#include <private/qqmlabstractbinding_p.h>
+#include <private/qqmlanybinding_p.h>
+
+#include <QtCore/private/qproperty_p.h>
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(lcStates)
+
class QQuickStateActionEvent;
class QQmlBinding;
class QQmlExpression;
-class Q_QUICK_PRIVATE_EXPORT QQuickStateAction
+class Q_QUICK_EXPORT QQuickStateAction
{
public:
QQuickStateAction();
@@ -81,8 +50,8 @@ public:
QVariant fromValue;
QVariant toValue;
- QQmlAbstractBinding::Ptr fromBinding;
- QQmlAbstractBinding::Ptr toBinding;
+ QQmlAnyBinding fromBinding;
+ QQmlAnyBinding toBinding;
QQuickStateActionEvent *event;
//strictly for matching
@@ -122,9 +91,11 @@ public:
class QQuickStateGroup;
class QQuickState;
class QQuickStateOperationPrivate;
-class Q_QUICK_PRIVATE_EXPORT QQuickStateOperation : public QObject
+class Q_QUICK_EXPORT QQuickStateOperation : public QObject
{
Q_OBJECT
+ QML_ANONYMOUS
+ QML_ADDED_IN_VERSION(2, 0)
public:
QQuickStateOperation(QObject *parent = nullptr)
: QObject(parent) {}
@@ -147,16 +118,18 @@ typedef QQuickStateOperation::ActionList QQuickStateActions;
class QQuickTransition;
class QQuickStatePrivate;
-class Q_QUICK_PRIVATE_EXPORT QQuickState : public QObject
+class Q_QUICK_EXPORT QQuickState : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(QQmlBinding *when READ when WRITE setWhen)
+ Q_PROPERTY(bool when READ when WRITE setWhen)
Q_PROPERTY(QString extend READ extends WRITE setExtends)
Q_PROPERTY(QQmlListProperty<QQuickStateOperation> changes READ changes)
Q_CLASSINFO("DefaultProperty", "changes")
Q_CLASSINFO("DeferredPropertyNames", "changes")
+ QML_NAMED_ELEMENT(State)
+ QML_ADDED_IN_VERSION(2, 0)
public:
QQuickState(QObject *parent=nullptr);
@@ -166,11 +139,9 @@ public:
void setName(const QString &);
bool isNamed() const;
- /*'when' is a QQmlBinding to limit state changes oscillation
- due to the unpredictable order of evaluation of bound expressions*/
bool isWhenKnown() const;
- QQmlBinding *when() const;
- void setWhen(QQmlBinding *);
+ bool when() const;
+ void setWhen(bool);
QString extends() const;
void setExtends(const QString &);
@@ -189,13 +160,13 @@ public:
bool containsPropertyInRevertList(QObject *target, const QString &name) const;
bool changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue);
- bool changeBindingInRevertList(QObject *target, const QString &name, QQmlAbstractBinding *binding);
+ bool changeBindingInRevertList(QObject *target, const QString &name, QQmlAnyBinding binding);
bool removeEntryFromRevertList(QObject *target, const QString &name);
void addEntryToRevertList(const QQuickStateAction &action);
void removeAllEntriesFromRevertList(QObject *target);
void addEntriesToRevertList(const QList<QQuickStateAction> &actions);
QVariant valueInRevertList(QObject *target, const QString &name) const;
- QQmlAbstractBinding *bindingInRevertList(QObject *target, const QString &name) const;
+ QQmlAnyBinding bindingInRevertList(QObject *target, const QString &name) const;
bool isStateActive() const;
@@ -209,7 +180,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickStateOperation)
-QML_DECLARE_TYPE(QQuickState)
-
#endif // QQUICKSTATE_H