| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickstate_p_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | - | |||||||
| 7 | class QQuickSimpleAction | - | ||||||
| 8 | { | - | ||||||
| 9 | public: | - | ||||||
| 10 | enum State { StartState, EndState }; | - | ||||||
| 11 | QQuickSimpleAction(const QQuickStateAction &a, State state = StartState) | - | ||||||
| 12 | { | - | ||||||
| 13 | m_property = a.property; | - | ||||||
| 14 | m_specifiedObject = a.specifiedObject; | - | ||||||
| 15 | m_specifiedProperty = a.specifiedProperty; | - | ||||||
| 16 | m_event = a.event; | - | ||||||
| 17 | if (state == StartState
| 12-876 | ||||||
| 18 | m_value = a.fromValue; | - | ||||||
| 19 | if (QQmlPropertyPrivate::binding(m_property)
| 34-842 | ||||||
| 20 | m_binding = QQmlPropertyPrivate::binding(m_property); | - | ||||||
| 21 | } executed 34 times by 6 tests: end of blockExecuted by:
| 34 | ||||||
| 22 | m_reverseEvent = true; | - | ||||||
| 23 | } executed 876 times by 18 tests: else {end of blockExecuted by:
| 876 | ||||||
| 24 | m_value = a.toValue; | - | ||||||
| 25 | m_binding = a.toBinding; | - | ||||||
| 26 | m_reverseEvent = false; | - | ||||||
| 27 | } executed 12 times by 3 tests: end of blockExecuted by:
| 12 | ||||||
| 28 | } | - | ||||||
| 29 | - | |||||||
| 30 | ~QQuickSimpleAction() | - | ||||||
| 31 | { | - | ||||||
| 32 | } | - | ||||||
| 33 | - | |||||||
| 34 | QQuickSimpleAction(const QQuickSimpleAction &other) | - | ||||||
| 35 | : m_property(other.m_property), | - | ||||||
| 36 | m_value(other.m_value), | - | ||||||
| 37 | m_binding(other.binding()), | - | ||||||
| 38 | m_specifiedObject(other.m_specifiedObject), | - | ||||||
| 39 | m_specifiedProperty(other.m_specifiedProperty), | - | ||||||
| 40 | m_event(other.m_event), | - | ||||||
| 41 | m_reverseEvent(other.m_reverseEvent) | - | ||||||
| 42 | { | - | ||||||
| 43 | } executed 978 times by 19 tests: end of blockExecuted by:
| 978 | ||||||
| 44 | - | |||||||
| 45 | QQuickSimpleAction &operator =(const QQuickSimpleAction &other) | - | ||||||
| 46 | { | - | ||||||
| 47 | m_property = other.m_property; | - | ||||||
| 48 | m_value = other.m_value; | - | ||||||
| 49 | m_binding = other.binding(); | - | ||||||
| 50 | m_specifiedObject = other.m_specifiedObject; | - | ||||||
| 51 | m_specifiedProperty = other.m_specifiedProperty; | - | ||||||
| 52 | m_event = other.m_event; | - | ||||||
| 53 | m_reverseEvent = other.m_reverseEvent; | - | ||||||
| 54 | - | |||||||
| 55 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||
| 56 | } | - | ||||||
| 57 | - | |||||||
| 58 | void setProperty(const QQmlProperty &property) | - | ||||||
| 59 | { | - | ||||||
| 60 | m_property = property; | - | ||||||
| 61 | } never executed: end of block | 0 | ||||||
| 62 | - | |||||||
| 63 | const QQmlProperty &property() const | - | ||||||
| 64 | { | - | ||||||
| 65 | return executed 754 times by 13 tests: m_property;return m_property;Executed by:
executed 754 times by 13 tests: return m_property;Executed by:
| 754 | ||||||
| 66 | } | - | ||||||
| 67 | - | |||||||
| 68 | void setValue(const QVariant &value) | - | ||||||
| 69 | { | - | ||||||
| 70 | m_value = value; | - | ||||||
| 71 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||
| 72 | - | |||||||
| 73 | const QVariant &value() const | - | ||||||
| 74 | { | - | ||||||
| 75 | return executed 180 times by 13 tests: m_value;return m_value;Executed by:
executed 180 times by 13 tests: return m_value;Executed by:
| 180 | ||||||
| 76 | } | - | ||||||
| 77 | - | |||||||
| 78 | void setBinding(QQmlAbstractBinding *binding) | - | ||||||
| 79 | { | - | ||||||
| 80 | m_binding = binding; | - | ||||||
| 81 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||
| 82 | - | |||||||
| 83 | QQmlAbstractBinding *binding() const | - | ||||||
| 84 | { | - | ||||||
| 85 | return executed 1194 times by 19 tests: m_binding.data();return m_binding.data();Executed by:
executed 1194 times by 19 tests: return m_binding.data();Executed by:
| 1194 | ||||||
| 86 | } | - | ||||||
| 87 | - | |||||||
| 88 | QObject *specifiedObject() const | - | ||||||
| 89 | { | - | ||||||
| 90 | return executed 188 times by 12 tests: m_specifiedObject;return m_specifiedObject;Executed by:
executed 188 times by 12 tests: return m_specifiedObject;Executed by:
| 188 | ||||||
| 91 | } | - | ||||||
| 92 | - | |||||||
| 93 | const QString &specifiedProperty() const | - | ||||||
| 94 | { | - | ||||||
| 95 | return executed 188 times by 12 tests: m_specifiedProperty;return m_specifiedProperty;Executed by:
executed 188 times by 12 tests: return m_specifiedProperty;Executed by:
| 188 | ||||||
| 96 | } | - | ||||||
| 97 | - | |||||||
| 98 | QQuickStateActionEvent *event() const | - | ||||||
| 99 | { | - | ||||||
| 100 | return executed 482 times by 12 tests: m_event;return m_event;Executed by:
executed 482 times by 12 tests: return m_event;Executed by:
| 482 | ||||||
| 101 | } | - | ||||||
| 102 | - | |||||||
| 103 | bool reverseEvent() const | - | ||||||
| 104 | { | - | ||||||
| 105 | return executed 162 times by 12 tests: m_reverseEvent;return m_reverseEvent;Executed by:
executed 162 times by 12 tests: return m_reverseEvent;Executed by:
| 162 | ||||||
| 106 | } | - | ||||||
| 107 | - | |||||||
| 108 | private: | - | ||||||
| 109 | QQmlProperty m_property; | - | ||||||
| 110 | QVariant m_value; | - | ||||||
| 111 | QQmlAbstractBinding::Ptr m_binding; | - | ||||||
| 112 | QObject *m_specifiedObject; | - | ||||||
| 113 | QString m_specifiedProperty; | - | ||||||
| 114 | QQuickStateActionEvent *m_event; | - | ||||||
| 115 | bool m_reverseEvent; | - | ||||||
| 116 | }; | - | ||||||
| 117 | - | |||||||
| 118 | class QQuickRevertAction | - | ||||||
| 119 | { | - | ||||||
| 120 | public: | - | ||||||
| 121 | QQuickRevertAction() : event(nullptr) {} never executed: end of block | 0 | ||||||
| 122 | QQuickRevertAction(const QQmlProperty &prop) : property(prop), event(nullptr) {} executed 122 times by 11 tests: end of blockExecuted by:
| 122 | ||||||
| 123 | QQuickRevertAction(QQuickStateActionEvent *e) : event(e) {} executed 40 times by 3 tests: end of blockExecuted by:
| 40 | ||||||
| 124 | QQmlProperty property; | - | ||||||
| 125 | QQuickStateActionEvent *event; | - | ||||||
| 126 | }; | - | ||||||
| 127 | - | |||||||
| 128 | class QQuickStateOperationPrivate : public QObjectPrivate | - | ||||||
| 129 | { | - | ||||||
| 130 | inline QQuickStateOperation* q_func() { return static_cast<QQuickStateOperation *>(q_ptr); } inline const QQuickStateOperation* q_func() const { return static_cast<const QQuickStateOperation *>(q_ptr); } friend class QQuickStateOperation; | - | ||||||
| 131 | - | |||||||
| 132 | public: | - | ||||||
| 133 | - | |||||||
| 134 | QQuickStateOperationPrivate() | - | ||||||
| 135 | : m_state(nullptr) {} executed 624 times by 18 tests: end of blockExecuted by:
| 624 | ||||||
| 136 | - | |||||||
| 137 | QQuickState *m_state; | - | ||||||
| 138 | }; | - | ||||||
| 139 | - | |||||||
| 140 | class QQuickStatePrivate : public QObjectPrivate | - | ||||||
| 141 | { | - | ||||||
| 142 | inline QQuickState* q_func() { return static_cast<QQuickState *>(q_ptr); } inline const QQuickState* q_func() const { return static_cast<const QQuickState *>(q_ptr); } friend class QQuickState; | - | ||||||
| 143 | - | |||||||
| 144 | public: | - | ||||||
| 145 | QQuickStatePrivate() | - | ||||||
| 146 | : named(false), inState(false), group(nullptr) {} executed 1522 times by 20 tests: end of blockExecuted by:
| 1522 | ||||||
| 147 | - | |||||||
| 148 | typedef QList<QQuickSimpleAction> SimpleActionList; | - | ||||||
| 149 | - | |||||||
| 150 | QString name; | - | ||||||
| 151 | QQmlBinding::Ptr when; | - | ||||||
| 152 | bool named; | - | ||||||
| 153 | - | |||||||
| 154 | struct OperationGuard : public QQmlGuard<QQuickStateOperation> | - | ||||||
| 155 | { | - | ||||||
| 156 | OperationGuard(QObject *obj, QList<OperationGuard> *l) : list(l) { | - | ||||||
| 157 | setObject(static_cast<QQuickStateOperation *>(obj)); | - | ||||||
| 158 | } executed 622 times by 18 tests: end of blockExecuted by:
| 622 | ||||||
| 159 | QList<OperationGuard> *list; | - | ||||||
| 160 | void objectDestroyed(QQuickStateOperation *) override { | - | ||||||
| 161 | - | |||||||
| 162 | list->removeOne(*this); | - | ||||||
| 163 | } executed 496 times by 18 tests: end of blockExecuted by:
| 496 | ||||||
| 164 | }; | - | ||||||
| 165 | QList<OperationGuard> operations; | - | ||||||
| 166 | - | |||||||
| 167 | static void operations_append(QQmlListProperty<QQuickStateOperation> *prop, QQuickStateOperation *op) { | - | ||||||
| 168 | QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); | - | ||||||
| 169 | op->setState(qobject_cast<QQuickState*>(prop->object)); | - | ||||||
| 170 | list->append(OperationGuard(op, list)); | - | ||||||
| 171 | } executed 622 times by 18 tests: end of blockExecuted by:
| 622 | ||||||
| 172 | static void operations_clear(QQmlListProperty<QQuickStateOperation> *prop) { | - | ||||||
| 173 | QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); | - | ||||||
| 174 | QMutableListIterator<OperationGuard> listIterator(*list); | - | ||||||
| 175 | while(listIterator.hasNext()
| 0 | ||||||
| 176 | listIterator.next()->setState(nullptr); never executed: listIterator.next()->setState(nullptr); | 0 | ||||||
| 177 | list->clear(); | - | ||||||
| 178 | } never executed: end of block | 0 | ||||||
| 179 | static int operations_count(QQmlListProperty<QQuickStateOperation> *prop) { | - | ||||||
| 180 | QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); | - | ||||||
| 181 | return never executed: list->count();return list->count();never executed: return list->count(); | 0 | ||||||
| 182 | } | - | ||||||
| 183 | static QQuickStateOperation *operations_at(QQmlListProperty<QQuickStateOperation> *prop, int index) { | - | ||||||
| 184 | QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); | - | ||||||
| 185 | return never executed: list->at(index);return list->at(index);never executed: return list->at(index); | 0 | ||||||
| 186 | } | - | ||||||
| 187 | - | |||||||
| 188 | QQuickTransitionManager transitionManager; | - | ||||||
| 189 | - | |||||||
| 190 | SimpleActionList revertList; | - | ||||||
| 191 | QList<QQuickRevertAction> reverting; | - | ||||||
| 192 | QString extends; | - | ||||||
| 193 | mutable bool inState; | - | ||||||
| 194 | QQuickStateGroup *group; | - | ||||||
| 195 | - | |||||||
| 196 | QQuickStateOperation::ActionList generateActionList() const; | - | ||||||
| 197 | void complete(); | - | ||||||
| 198 | }; | - | ||||||
| 199 | - | |||||||
| 200 | - | |||||||
| Switch to Source code | Preprocessed file |