10#include <private/qqmlglobal_p.h>
12#include <QtCore/qdebug.h>
19: restore(true), actionDone(
false), reverseEvent(
false), deletableToBinding(
false), fromBinding(
nullptr),
event(
nullptr),
20 specifiedObject(
nullptr)
26: restore(true), actionDone(
false), reverseEvent(
false), deletableToBinding(
false),
29 specifiedObject(
target), specifiedProperty(propertyName)
36: restore(true), actionDone(
false), reverseEvent(
false), deletableToBinding(
false),
39 specifiedObject(
target), specifiedProperty(propertyName)
121 d->transitionManager.setState(
this);
128 d->group->removeState(
this);
198 d->group->updateAutoState();
246 return d->operations.size();
252 return d->operations.at(
index);
280 group->stateAboutToComplete();
298 for (
int ii = 0; ii <
states.size(); ++ii)
306 applyList << op->actions();
327 d->transitionManager.cancel();
346 if (simpleAction.specifiedObject() ==
target && simpleAction.specifiedProperty() ==
name)
360 if (simpleAction.specifiedObject() ==
target && simpleAction.specifiedProperty() ==
name) {
361 simpleAction.setValue(revertValue);
376 if (simpleAction.specifiedObject() ==
target && simpleAction.specifiedProperty() ==
name) {
377 simpleAction.setBinding(binding);
391 for (
auto it =
d->revertList.begin(),
end =
d->revertList.end();
it !=
end; ++
it) {
397 if (
auto binding = simpleAction.
binding(); binding) {
399 binding.installOn(prop);
402 d->revertList.erase(
it);
417 d->revertList.append(simpleAction);
426 if (simpleAction.property().object() ==
target) {
428 simpleAction.property().write(simpleAction.value());
429 if (
auto binding = simpleAction.binding()) {
431 binding.installOn(prop);
439 d->revertList.erase(std::remove_if(
d->revertList.begin(),
d->revertList.end(),
440 actionMatchesTarget),
441 d->revertList.end());
454 action.property.write(action.toValue);
455 if (
auto binding = action.toBinding; binding)
456 binding.installOn(action.property);
458 simpleActionList.
append(simpleAction);
461 d->revertList.append(simpleActionList);
471 if (simpleAction.specifiedObject() ==
target && simpleAction.specifiedProperty() ==
name)
472 return simpleAction.value();
485 if (simpleAction.specifiedObject() ==
target && simpleAction.specifiedProperty() ==
name)
486 return simpleAction.binding();
507 d->revertList.clear();
508 d->reverting.clear();
523 for (
int ii = 0; ii < applyList.
size(); ++ii) {
530 for (
int jj = 0; jj <
d->revertList.size(); ++jj) {
540 additionalReverts <<
r;
541 d->revertList.removeAt(jj);
555 additionalReverts <<
r;
561 for (
int jj = 0; jj <
d->revertList.size(); ++jj) {
562 if (
d->revertList.at(jj).property() == action.
property) {
564 if (
d->revertList.at(jj).binding() != action.
fromBinding) {
578 additionalReverts <<
r;
586 for (
int ii = 0; ii <
d->revertList.size(); ++ii) {
588 if (
d->revertList.at(ii).event()) {
590 if (!
event->isReversable())
592 for (
int jj = 0; !found && jj < applyList.
size(); ++jj) {
600 for (
int jj = 0; !found && jj < applyList.
size(); ++jj) {
602 if (action.
property ==
d->revertList.at(ii).property())
609 if (
d->revertList.at(ii).binding() && !
d->revertList.at(ii).property().object()) {
612 QVariant cur =
d->revertList.at(ii).property().read();
617 a.property =
d->revertList.at(ii).property();
619 a.toValue =
d->revertList.at(ii).value();
620 a.toBinding =
d->revertList.at(ii).binding();
621 a.specifiedObject =
d->revertList.at(ii).specifiedObject();
622 a.specifiedProperty =
d->revertList.at(ii).specifiedProperty();
623 a.event =
d->revertList.at(ii).event();
624 a.reverseEvent =
d->revertList.at(ii).reverseEvent();
625 if (
a.event &&
a.event->isRewindable())
626 a.event->saveCurrentValues();
630 d->reverting <<
a.event;
632 d->reverting <<
a.property;
636 d->revertList << additionalReverts;
638 if (lcStates().isDebugEnabled()) {
641 qCDebug(lcStates) <<
"QQuickStateAction event:" << action.event->type();
643 qCDebug(lcStates) <<
"QQuickStateAction on" << action.property.object()
644 << action.property.name() <<
"from:" << action.fromValue
645 <<
"to:" << action.toValue;
649 d->transitionManager.transition(applyList, trans);
671#include "moc_qquickstate_p.cpp"
qsizetype size() const noexcept
void removeAt(qsizetype i)
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
QQmlAnyBinding is an abstraction over the various bindings in QML.
static void removeBindingFrom(QQmlProperty &prop)
bool isAbstractPropertyBinding() const
static QQmlAnyBinding ofProperty(const QQmlProperty &prop)
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
static void removeBinding(const QQmlProperty &that)
The QQmlProperty class abstracts accessing properties on objects created from QML.
bool isValid() const
Returns true if the QQmlProperty refers to a valid property, otherwise false.
QMetaProperty property() const
Returns the \l{QMetaProperty} {Qt property} associated with this QML property.
QML_ANONYMOUSQObject * object
bool write(const QVariant &) const
Sets the property value to value.
QQuickStateActionEvent * event
const QVariant & value() const
QQuickStateActionEvent * event() const
const QQmlProperty & property() const
QQmlAnyBinding binding() const
virtual void saveOriginals()
virtual void saveCurrentValues()
virtual bool isReversable()
virtual ~QQuickStateActionEvent()
virtual void clearBindings()
virtual bool changesBindings()
virtual bool isRewindable()
virtual bool mayOverride(QQuickStateActionEvent *other)
virtual EventType type() const =0
virtual void copyOriginals(QQuickStateActionEvent *)
QQmlAnyBinding fromBinding
QQuickStateActionEvent * event
QQuickState * state() const
QQuickStateOperation(QObject *parent=nullptr)
QList< QQuickStateAction > ActionList
virtual ActionList actions()
void setState(QQuickState *state)
SimpleActionList revertList
static void operations_append(QQmlListProperty< QQuickStateOperation > *prop, QQuickStateOperation *op)
static qsizetype operations_count(QQmlListProperty< QQuickStateOperation > *prop)
static void operations_clear(QQmlListProperty< QQuickStateOperation > *prop)
static QQuickStateOperation * operations_at(QQmlListProperty< QQuickStateOperation > *prop, qsizetype index)
QList< QQuickRevertAction > reverting
static void operations_removeLast(QQmlListProperty< QQuickStateOperation > *prop)
QQuickStateOperation::ActionList generateActionList() const
QList< OperationGuard > operations
static void operations_replace(QQmlListProperty< QQuickStateOperation > *prop, qsizetype index, QQuickStateOperation *op)
QString extends() const
\qmlproperty string QtQuick::State::extend This property holds the state that this state extends.
QQuickState & operator<<(QQuickStateOperation *)
bool containsPropertyInRevertList(QObject *target, const QString &name) const
QQuickStateGroup * stateGroup() const
void setExtends(const QString &)
bool isStateActive() const
QVariant valueInRevertList(QObject *target, const QString &name) const
void setName(const QString &)
int operationCount() const
QQmlListProperty< QQuickStateOperation > changes
\qmlproperty list<Change> QtQuick::State::changes This property holds the changes to apply for this s...
QQuickState(QObject *parent=nullptr)
\qmltype State \instantiates QQuickState \inqmlmodule QtQuick
void removeAllEntriesFromRevertList(QObject *target)
bool removeEntryFromRevertList(QObject *target, const QString &name)
void addEntryToRevertList(const QQuickStateAction &action)
void apply(QQuickTransition *, QQuickState *revert)
void addEntriesToRevertList(const QList< QQuickStateAction > &actions)
QQmlAnyBinding bindingInRevertList(QObject *target, const QString &name) const
void setStateGroup(QQuickStateGroup *)
QQuickStateOperation * operationAt(int) const
bool changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue)
bool changeBindingInRevertList(QObject *target, const QString &name, QQmlAnyBinding binding)
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
GLboolean GLboolean GLboolean GLboolean a
[7]
GLdouble GLdouble GLdouble GLdouble q
void qmlExecuteDeferred(QObject *object)
QQmlEngine * qmlEngine(const QObject *obj)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent