| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickstateoperations.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | class QQuickParentChangePrivate : public QQuickStateOperationPrivate | - | ||||||||||||||||||||||||
| 7 | { | - | ||||||||||||||||||||||||
| 8 | inline QQuickParentChange* q_func() { return static_cast<QQuickParentChange *>(q_ptr); } inline const QQuickParentChange* q_func() const { return static_cast<const QQuickParentChange *>(q_ptr); } friend class QQuickParentChange; | - | ||||||||||||||||||||||||
| 9 | public: | - | ||||||||||||||||||||||||
| 10 | QQuickParentChangePrivate() : target(nullptr), parent(nullptr), origParent(nullptr), origStackBefore(nullptr), | - | ||||||||||||||||||||||||
| 11 | rewindParent(nullptr), rewindStackBefore(nullptr) {} executed 124 times by 5 tests: end of blockExecuted by:
| 124 | ||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | QQuickItem *target; | - | ||||||||||||||||||||||||
| 14 | QPointer<QQuickItem> parent; | - | ||||||||||||||||||||||||
| 15 | QPointer<QQuickItem> origParent; | - | ||||||||||||||||||||||||
| 16 | QPointer<QQuickItem> origStackBefore; | - | ||||||||||||||||||||||||
| 17 | QQuickItem *rewindParent; | - | ||||||||||||||||||||||||
| 18 | QQuickItem *rewindStackBefore; | - | ||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||
| 20 | QQmlNullableValue<QQmlScriptString> xString; | - | ||||||||||||||||||||||||
| 21 | QQmlNullableValue<QQmlScriptString> yString; | - | ||||||||||||||||||||||||
| 22 | QQmlNullableValue<QQmlScriptString> widthString; | - | ||||||||||||||||||||||||
| 23 | QQmlNullableValue<QQmlScriptString> heightString; | - | ||||||||||||||||||||||||
| 24 | QQmlNullableValue<QQmlScriptString> scaleString; | - | ||||||||||||||||||||||||
| 25 | QQmlNullableValue<QQmlScriptString> rotationString; | - | ||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||
| 27 | void doChange(QQuickItem *targetParent, QQuickItem *stackBefore = nullptr); | - | ||||||||||||||||||||||||
| 28 | }; | - | ||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||
| 30 | void QQuickParentChangePrivate::doChange(QQuickItem *targetParent, QQuickItem *stackBefore) | - | ||||||||||||||||||||||||
| 31 | { | - | ||||||||||||||||||||||||
| 32 | if (targetParent
| 0-136 | ||||||||||||||||||||||||
| 33 | QQuickParentChange * const q = q_func(); | - | ||||||||||||||||||||||||
| 34 | bool ok; | - | ||||||||||||||||||||||||
| 35 | const QTransform &transform = target->parentItem()->itemTransform(targetParent, &ok); | - | ||||||||||||||||||||||||
| 36 | if (transform.type() >= QTransform::TxShear
| 0-102 | ||||||||||||||||||||||||
| 37 | qmlWarning(q) << QQuickParentChange::tr("Unable to preserve appearance under complex transform"); | - | ||||||||||||||||||||||||
| 38 | ok = false; | - | ||||||||||||||||||||||||
| 39 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||
| 41 | qreal scale = 1; | - | ||||||||||||||||||||||||
| 42 | qreal rotation = 0; | - | ||||||||||||||||||||||||
| 43 | bool isRotate = (
| 2-94 | ||||||||||||||||||||||||
| 44 | if (ok
| 2-102 | ||||||||||||||||||||||||
| 45 | if (transform.m11() == transform.m22()
| 2-88 | ||||||||||||||||||||||||
| 46 | scale = transform.m11(); executed 88 times by 3 tests: scale = transform.m11();Executed by:
| 88 | ||||||||||||||||||||||||
| 47 | else { | - | ||||||||||||||||||||||||
| 48 | qmlWarning(q) << QQuickParentChange::tr("Unable to preserve appearance under non-uniform scale"); | - | ||||||||||||||||||||||||
| 49 | ok = false; | - | ||||||||||||||||||||||||
| 50 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 51 | } else if (ok
| 0-12 | ||||||||||||||||||||||||
| 52 | if (transform.m11() == transform.m22()
| 0-12 | ||||||||||||||||||||||||
| 53 | scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12()); executed 12 times by 2 tests: scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());Executed by:
| 12 | ||||||||||||||||||||||||
| 54 | else { | - | ||||||||||||||||||||||||
| 55 | qmlWarning(q) << QQuickParentChange::tr("Unable to preserve appearance under non-uniform scale"); | - | ||||||||||||||||||||||||
| 56 | ok = false; | - | ||||||||||||||||||||||||
| 57 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||
| 59 | if (scale != 0
| 0-12 | ||||||||||||||||||||||||
| 60 | rotation = qRadiansToDegrees(qAtan2(transform.m12() / scale, transform.m11() / scale)); executed 12 times by 2 tests: rotation = qRadiansToDegrees(qAtan2(transform.m12() / scale, transform.m11() / scale));Executed by:
| 12 | ||||||||||||||||||||||||
| 61 | else { | - | ||||||||||||||||||||||||
| 62 | qmlWarning(q) << QQuickParentChange::tr("Unable to preserve appearance under scale of 0"); | - | ||||||||||||||||||||||||
| 63 | ok = false; | - | ||||||||||||||||||||||||
| 64 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 65 | } | - | ||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||
| 67 | const QPointF &point = transform.map(QPointF(target->x(),target->y())); | - | ||||||||||||||||||||||||
| 68 | qreal x = point.x(); | - | ||||||||||||||||||||||||
| 69 | qreal y = point.y(); | - | ||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | target->setParentItem(targetParent); | - | ||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | if (ok
| 0-100 | ||||||||||||||||||||||||
| 75 | qreal tempxt = target->transformOriginPoint().x(); | - | ||||||||||||||||||||||||
| 76 | qreal tempyt = target->transformOriginPoint().y(); | - | ||||||||||||||||||||||||
| 77 | QTransform t; | - | ||||||||||||||||||||||||
| 78 | t.translate(-tempxt, -tempyt); | - | ||||||||||||||||||||||||
| 79 | t.rotate(rotation); | - | ||||||||||||||||||||||||
| 80 | t.scale(scale, scale); | - | ||||||||||||||||||||||||
| 81 | t.translate(tempxt, tempyt); | - | ||||||||||||||||||||||||
| 82 | const QPointF &offset = t.map(QPointF(0,0)); | - | ||||||||||||||||||||||||
| 83 | x += offset.x(); | - | ||||||||||||||||||||||||
| 84 | y += offset.y(); | - | ||||||||||||||||||||||||
| 85 | } executed 100 times by 4 tests: end of blockExecuted by:
| 100 | ||||||||||||||||||||||||
| 86 | - | |||||||||||||||||||||||||
| 87 | if (ok
| 4-100 | ||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||
| 89 | target->setPosition(QPointF(x, y)); | - | ||||||||||||||||||||||||
| 90 | target->setRotation(target->rotation() + rotation); | - | ||||||||||||||||||||||||
| 91 | target->setScale(target->scale() * scale); | - | ||||||||||||||||||||||||
| 92 | } executed 100 times by 4 tests: end of blockExecuted by:
| 100 | ||||||||||||||||||||||||
| 93 | } executed 104 times by 4 tests: else if (targetend of blockExecuted by:
| 0-104 | ||||||||||||||||||||||||
| 94 | target->setParentItem(targetParent); | - | ||||||||||||||||||||||||
| 95 | } executed 32 times by 2 tests: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||
| 99 | if (target
| 0-136 | ||||||||||||||||||||||||
| 100 | target->stackBefore(stackBefore); never executed: target->stackBefore(stackBefore); | 0 | ||||||||||||||||||||||||
| 101 | } executed 136 times by 5 tests: end of blockExecuted by:
| 136 | ||||||||||||||||||||||||
| 102 | QQuickParentChange::QQuickParentChange(QObject *parent) | - | ||||||||||||||||||||||||
| 103 | : QQuickStateOperation(*(new QQuickParentChangePrivate), parent) | - | ||||||||||||||||||||||||
| 104 | { | - | ||||||||||||||||||||||||
| 105 | } executed 124 times by 5 tests: end of blockExecuted by:
| 124 | ||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||
| 107 | QQuickParentChange::~QQuickParentChange() | - | ||||||||||||||||||||||||
| 108 | { | - | ||||||||||||||||||||||||
| 109 | } | - | ||||||||||||||||||||||||
| 110 | QQmlScriptString QQuickParentChange::x() const | - | ||||||||||||||||||||||||
| 111 | { | - | ||||||||||||||||||||||||
| 112 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 113 | return never executed: d->xString.value;return d->xString.value;never executed: return d->xString.value; | 0 | ||||||||||||||||||||||||
| 114 | } | - | ||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||
| 116 | void QQuickParentChange::setX(QQmlScriptString x) | - | ||||||||||||||||||||||||
| 117 | { | - | ||||||||||||||||||||||||
| 118 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 119 | d->xString = x; | - | ||||||||||||||||||||||||
| 120 | } executed 90 times by 4 tests: end of blockExecuted by:
| 90 | ||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||
| 122 | bool QQuickParentChange::xIsSet() const | - | ||||||||||||||||||||||||
| 123 | { | - | ||||||||||||||||||||||||
| 124 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 125 | return executed 2 times by 1 test: d->xString.isValid();return d->xString.isValid();Executed by:
executed 2 times by 1 test: return d->xString.isValid();Executed by:
| 2 | ||||||||||||||||||||||||
| 126 | } | - | ||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||
| 128 | QQmlScriptString QQuickParentChange::y() const | - | ||||||||||||||||||||||||
| 129 | { | - | ||||||||||||||||||||||||
| 130 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 131 | return never executed: d->yString.value;return d->yString.value;never executed: return d->yString.value; | 0 | ||||||||||||||||||||||||
| 132 | } | - | ||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||
| 134 | void QQuickParentChange::setY(QQmlScriptString y) | - | ||||||||||||||||||||||||
| 135 | { | - | ||||||||||||||||||||||||
| 136 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 137 | d->yString = y; | - | ||||||||||||||||||||||||
| 138 | } executed 90 times by 4 tests: end of blockExecuted by:
| 90 | ||||||||||||||||||||||||
| 139 | - | |||||||||||||||||||||||||
| 140 | bool QQuickParentChange::yIsSet() const | - | ||||||||||||||||||||||||
| 141 | { | - | ||||||||||||||||||||||||
| 142 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 143 | return executed 2 times by 1 test: d->yString.isValid();return d->yString.isValid();Executed by:
executed 2 times by 1 test: return d->yString.isValid();Executed by:
| 2 | ||||||||||||||||||||||||
| 144 | } | - | ||||||||||||||||||||||||
| 145 | - | |||||||||||||||||||||||||
| 146 | QQmlScriptString QQuickParentChange::width() const | - | ||||||||||||||||||||||||
| 147 | { | - | ||||||||||||||||||||||||
| 148 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 149 | return never executed: d->widthString.value;return d->widthString.value;never executed: return d->widthString.value; | 0 | ||||||||||||||||||||||||
| 150 | } | - | ||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | void QQuickParentChange::setWidth(QQmlScriptString width) | - | ||||||||||||||||||||||||
| 153 | { | - | ||||||||||||||||||||||||
| 154 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 155 | d->widthString = width; | - | ||||||||||||||||||||||||
| 156 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||
| 158 | bool QQuickParentChange::widthIsSet() const | - | ||||||||||||||||||||||||
| 159 | { | - | ||||||||||||||||||||||||
| 160 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 161 | return executed 2 times by 1 test: d->widthString.isValid();return d->widthString.isValid();Executed by:
executed 2 times by 1 test: return d->widthString.isValid();Executed by:
| 2 | ||||||||||||||||||||||||
| 162 | } | - | ||||||||||||||||||||||||
| 163 | - | |||||||||||||||||||||||||
| 164 | QQmlScriptString QQuickParentChange::height() const | - | ||||||||||||||||||||||||
| 165 | { | - | ||||||||||||||||||||||||
| 166 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 167 | return never executed: d->heightString.value;return d->heightString.value;never executed: return d->heightString.value; | 0 | ||||||||||||||||||||||||
| 168 | } | - | ||||||||||||||||||||||||
| 169 | - | |||||||||||||||||||||||||
| 170 | void QQuickParentChange::setHeight(QQmlScriptString height) | - | ||||||||||||||||||||||||
| 171 | { | - | ||||||||||||||||||||||||
| 172 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 173 | d->heightString = height; | - | ||||||||||||||||||||||||
| 174 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 175 | - | |||||||||||||||||||||||||
| 176 | bool QQuickParentChange::heightIsSet() const | - | ||||||||||||||||||||||||
| 177 | { | - | ||||||||||||||||||||||||
| 178 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 179 | return executed 2 times by 1 test: d->heightString.isValid();return d->heightString.isValid();Executed by:
executed 2 times by 1 test: return d->heightString.isValid();Executed by:
| 2 | ||||||||||||||||||||||||
| 180 | } | - | ||||||||||||||||||||||||
| 181 | - | |||||||||||||||||||||||||
| 182 | QQmlScriptString QQuickParentChange::scale() const | - | ||||||||||||||||||||||||
| 183 | { | - | ||||||||||||||||||||||||
| 184 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 185 | return never executed: d->scaleString.value;return d->scaleString.value;never executed: return d->scaleString.value; | 0 | ||||||||||||||||||||||||
| 186 | } | - | ||||||||||||||||||||||||
| 187 | - | |||||||||||||||||||||||||
| 188 | void QQuickParentChange::setScale(QQmlScriptString scale) | - | ||||||||||||||||||||||||
| 189 | { | - | ||||||||||||||||||||||||
| 190 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 191 | d->scaleString = scale; | - | ||||||||||||||||||||||||
| 192 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||
| 194 | bool QQuickParentChange::scaleIsSet() const | - | ||||||||||||||||||||||||
| 195 | { | - | ||||||||||||||||||||||||
| 196 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 197 | return executed 2 times by 1 test: d->scaleString.isValid();return d->scaleString.isValid();Executed by:
executed 2 times by 1 test: return d->scaleString.isValid();Executed by:
| 2 | ||||||||||||||||||||||||
| 198 | } | - | ||||||||||||||||||||||||
| 199 | - | |||||||||||||||||||||||||
| 200 | QQmlScriptString QQuickParentChange::rotation() const | - | ||||||||||||||||||||||||
| 201 | { | - | ||||||||||||||||||||||||
| 202 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 203 | return never executed: d->rotationString.value;return d->rotationString.value;never executed: return d->rotationString.value; | 0 | ||||||||||||||||||||||||
| 204 | } | - | ||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||
| 206 | void QQuickParentChange::setRotation(QQmlScriptString rotation) | - | ||||||||||||||||||||||||
| 207 | { | - | ||||||||||||||||||||||||
| 208 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 209 | d->rotationString = rotation; | - | ||||||||||||||||||||||||
| 210 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 211 | - | |||||||||||||||||||||||||
| 212 | bool QQuickParentChange::rotationIsSet() const | - | ||||||||||||||||||||||||
| 213 | { | - | ||||||||||||||||||||||||
| 214 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 215 | return executed 2 times by 1 test: d->rotationString.isValid();return d->rotationString.isValid();Executed by:
executed 2 times by 1 test: return d->rotationString.isValid();Executed by:
| 2 | ||||||||||||||||||||||||
| 216 | } | - | ||||||||||||||||||||||||
| 217 | - | |||||||||||||||||||||||||
| 218 | QQuickItem *QQuickParentChange::originalParent() const | - | ||||||||||||||||||||||||
| 219 | { | - | ||||||||||||||||||||||||
| 220 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 221 | return never executed: d->origParent;return d->origParent;never executed: return d->origParent; | 0 | ||||||||||||||||||||||||
| 222 | } | - | ||||||||||||||||||||||||
| 223 | - | |||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | - | |||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||
| 228 | QQuickItem *QQuickParentChange::object() const | - | ||||||||||||||||||||||||
| 229 | { | - | ||||||||||||||||||||||||
| 230 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 231 | return executed 6 times by 1 test: d->target;return d->target;Executed by:
executed 6 times by 1 test: return d->target;Executed by:
| 6 | ||||||||||||||||||||||||
| 232 | } | - | ||||||||||||||||||||||||
| 233 | - | |||||||||||||||||||||||||
| 234 | void QQuickParentChange::setObject(QQuickItem *target) | - | ||||||||||||||||||||||||
| 235 | { | - | ||||||||||||||||||||||||
| 236 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 237 | d->target = target; | - | ||||||||||||||||||||||||
| 238 | } executed 126 times by 5 tests: end of blockExecuted by:
| 126 | ||||||||||||||||||||||||
| 239 | - | |||||||||||||||||||||||||
| 240 | - | |||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||
| 243 | - | |||||||||||||||||||||||||
| 244 | QQuickItem *QQuickParentChange::parent() const | - | ||||||||||||||||||||||||
| 245 | { | - | ||||||||||||||||||||||||
| 246 | const QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 247 | return executed 4 times by 2 tests: d->parent;return d->parent;Executed by:
executed 4 times by 2 tests: return d->parent;Executed by:
| 4 | ||||||||||||||||||||||||
| 248 | } | - | ||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||
| 250 | void QQuickParentChange::setParent(QQuickItem *parent) | - | ||||||||||||||||||||||||
| 251 | { | - | ||||||||||||||||||||||||
| 252 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 253 | d->parent = parent; | - | ||||||||||||||||||||||||
| 254 | } executed 124 times by 5 tests: end of blockExecuted by:
| 124 | ||||||||||||||||||||||||
| 255 | - | |||||||||||||||||||||||||
| 256 | QQuickStateOperation::ActionList QQuickParentChange::actions() | - | ||||||||||||||||||||||||
| 257 | { | - | ||||||||||||||||||||||||
| 258 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 259 | if (!d->target
| 0-124 | ||||||||||||||||||||||||
| 260 | return never executed: ActionList();return ActionList();never executed: return ActionList(); | 0 | ||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||
| 262 | ActionList actions; | - | ||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||
| 264 | QQuickStateAction a; | - | ||||||||||||||||||||||||
| 265 | a.event = this; | - | ||||||||||||||||||||||||
| 266 | actions << a; | - | ||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||
| 268 | if (d->xString.isValid()
| 32-92 | ||||||||||||||||||||||||
| 269 | bool ok = false; | - | ||||||||||||||||||||||||
| 270 | qreal x = d->xString.value.numberLiteral(&ok); | - | ||||||||||||||||||||||||
| 271 | if (ok
| 0-92 | ||||||||||||||||||||||||
| 272 | QQuickStateAction xa(d->target, QLatin1String("x"), x); | - | ||||||||||||||||||||||||
| 273 | actions << xa; | - | ||||||||||||||||||||||||
| 274 | } executed 92 times by 4 tests: else {end of blockExecuted by:
| 92 | ||||||||||||||||||||||||
| 275 | QQmlProperty property(d->target, QLatin1String("x")); | - | ||||||||||||||||||||||||
| 276 | QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->xString.value, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 277 | newBinding->setTarget(property); | - | ||||||||||||||||||||||||
| 278 | QQuickStateAction xa; | - | ||||||||||||||||||||||||
| 279 | xa.property = property; | - | ||||||||||||||||||||||||
| 280 | xa.toBinding = newBinding; | - | ||||||||||||||||||||||||
| 281 | xa.fromValue = xa.property.read(); | - | ||||||||||||||||||||||||
| 282 | xa.deletableToBinding = true; | - | ||||||||||||||||||||||||
| 283 | actions << xa; | - | ||||||||||||||||||||||||
| 284 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 285 | } | - | ||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | if (d->yString.isValid()
| 32-92 | ||||||||||||||||||||||||
| 288 | bool ok = false; | - | ||||||||||||||||||||||||
| 289 | qreal y = d->yString.value.numberLiteral(&ok); | - | ||||||||||||||||||||||||
| 290 | if (ok
| 0-92 | ||||||||||||||||||||||||
| 291 | QQuickStateAction ya(d->target, QLatin1String("y"), y); | - | ||||||||||||||||||||||||
| 292 | actions << ya; | - | ||||||||||||||||||||||||
| 293 | } executed 92 times by 4 tests: else {end of blockExecuted by:
| 92 | ||||||||||||||||||||||||
| 294 | QQmlProperty property(d->target, QLatin1String("y")); | - | ||||||||||||||||||||||||
| 295 | QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->yString.value, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 296 | newBinding->setTarget(property); | - | ||||||||||||||||||||||||
| 297 | QQuickStateAction ya; | - | ||||||||||||||||||||||||
| 298 | ya.property = property; | - | ||||||||||||||||||||||||
| 299 | ya.toBinding = newBinding; | - | ||||||||||||||||||||||||
| 300 | ya.fromValue = ya.property.read(); | - | ||||||||||||||||||||||||
| 301 | ya.deletableToBinding = true; | - | ||||||||||||||||||||||||
| 302 | actions << ya; | - | ||||||||||||||||||||||||
| 303 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 304 | } | - | ||||||||||||||||||||||||
| 305 | - | |||||||||||||||||||||||||
| 306 | if (d->scaleString.isValid()
| 0-124 | ||||||||||||||||||||||||
| 307 | bool ok = false; | - | ||||||||||||||||||||||||
| 308 | qreal scale = d->scaleString.value.numberLiteral(&ok); | - | ||||||||||||||||||||||||
| 309 | if (ok
| 0 | ||||||||||||||||||||||||
| 310 | QQuickStateAction sa(d->target, QLatin1String("scale"), scale); | - | ||||||||||||||||||||||||
| 311 | actions << sa; | - | ||||||||||||||||||||||||
| 312 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 313 | QQmlProperty property(d->target, QLatin1String("scale")); | - | ||||||||||||||||||||||||
| 314 | QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->scaleString.value, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 315 | newBinding->setTarget(property); | - | ||||||||||||||||||||||||
| 316 | QQuickStateAction sa; | - | ||||||||||||||||||||||||
| 317 | sa.property = property; | - | ||||||||||||||||||||||||
| 318 | sa.toBinding = newBinding; | - | ||||||||||||||||||||||||
| 319 | sa.fromValue = sa.property.read(); | - | ||||||||||||||||||||||||
| 320 | sa.deletableToBinding = true; | - | ||||||||||||||||||||||||
| 321 | actions << sa; | - | ||||||||||||||||||||||||
| 322 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 323 | } | - | ||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||
| 325 | if (d->rotationString.isValid()
| 0-124 | ||||||||||||||||||||||||
| 326 | bool ok = false; | - | ||||||||||||||||||||||||
| 327 | qreal rotation = d->rotationString.value.numberLiteral(&ok); | - | ||||||||||||||||||||||||
| 328 | if (ok
| 0 | ||||||||||||||||||||||||
| 329 | QQuickStateAction ra(d->target, QLatin1String("rotation"), rotation); | - | ||||||||||||||||||||||||
| 330 | actions << ra; | - | ||||||||||||||||||||||||
| 331 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 332 | QQmlProperty property(d->target, QLatin1String("rotation")); | - | ||||||||||||||||||||||||
| 333 | QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->rotationString.value, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 334 | newBinding->setTarget(property); | - | ||||||||||||||||||||||||
| 335 | QQuickStateAction ra; | - | ||||||||||||||||||||||||
| 336 | ra.property = property; | - | ||||||||||||||||||||||||
| 337 | ra.toBinding = newBinding; | - | ||||||||||||||||||||||||
| 338 | ra.fromValue = ra.property.read(); | - | ||||||||||||||||||||||||
| 339 | ra.deletableToBinding = true; | - | ||||||||||||||||||||||||
| 340 | actions << ra; | - | ||||||||||||||||||||||||
| 341 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 342 | } | - | ||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||
| 344 | if (d->widthString.isValid()
| 2-122 | ||||||||||||||||||||||||
| 345 | bool ok = false; | - | ||||||||||||||||||||||||
| 346 | qreal width = d->widthString.value.numberLiteral(&ok); | - | ||||||||||||||||||||||||
| 347 | if (ok
| 0-2 | ||||||||||||||||||||||||
| 348 | QQuickStateAction wa(d->target, QLatin1String("width"), width); | - | ||||||||||||||||||||||||
| 349 | actions << wa; | - | ||||||||||||||||||||||||
| 350 | } executed 2 times by 1 test: else {end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 351 | QQmlProperty property(d->target, QLatin1String("width")); | - | ||||||||||||||||||||||||
| 352 | QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->widthString.value, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 353 | newBinding->setTarget(property); | - | ||||||||||||||||||||||||
| 354 | QQuickStateAction wa; | - | ||||||||||||||||||||||||
| 355 | wa.property = property; | - | ||||||||||||||||||||||||
| 356 | wa.toBinding = newBinding; | - | ||||||||||||||||||||||||
| 357 | wa.fromValue = wa.property.read(); | - | ||||||||||||||||||||||||
| 358 | wa.deletableToBinding = true; | - | ||||||||||||||||||||||||
| 359 | actions << wa; | - | ||||||||||||||||||||||||
| 360 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 361 | } | - | ||||||||||||||||||||||||
| 362 | - | |||||||||||||||||||||||||
| 363 | if (d->heightString.isValid()
| 0-124 | ||||||||||||||||||||||||
| 364 | bool ok = false; | - | ||||||||||||||||||||||||
| 365 | qreal height = d->heightString.value.numberLiteral(&ok); | - | ||||||||||||||||||||||||
| 366 | if (ok
| 0 | ||||||||||||||||||||||||
| 367 | QQuickStateAction ha(d->target, QLatin1String("height"), height); | - | ||||||||||||||||||||||||
| 368 | actions << ha; | - | ||||||||||||||||||||||||
| 369 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 370 | QQmlProperty property(d->target, QLatin1String("height")); | - | ||||||||||||||||||||||||
| 371 | QQmlBinding *newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, d->heightString.value, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 372 | newBinding->setTarget(property); | - | ||||||||||||||||||||||||
| 373 | QQuickStateAction ha; | - | ||||||||||||||||||||||||
| 374 | ha.property = property; | - | ||||||||||||||||||||||||
| 375 | ha.toBinding = newBinding; | - | ||||||||||||||||||||||||
| 376 | ha.fromValue = ha.property.read(); | - | ||||||||||||||||||||||||
| 377 | ha.deletableToBinding = true; | - | ||||||||||||||||||||||||
| 378 | actions << ha; | - | ||||||||||||||||||||||||
| 379 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 380 | } | - | ||||||||||||||||||||||||
| 381 | - | |||||||||||||||||||||||||
| 382 | return executed 124 times by 5 tests: actions;return actions;Executed by:
executed 124 times by 5 tests: return actions;Executed by:
| 124 | ||||||||||||||||||||||||
| 383 | } | - | ||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||
| 385 | void QQuickParentChange::saveOriginals() | - | ||||||||||||||||||||||||
| 386 | { | - | ||||||||||||||||||||||||
| 387 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 388 | saveCurrentValues(); | - | ||||||||||||||||||||||||
| 389 | d->origParent = d->rewindParent; | - | ||||||||||||||||||||||||
| 390 | d->origStackBefore = d->rewindStackBefore; | - | ||||||||||||||||||||||||
| 391 | } executed 124 times by 5 tests: end of blockExecuted by:
| 124 | ||||||||||||||||||||||||
| 392 | void QQuickParentChange::execute() | - | ||||||||||||||||||||||||
| 393 | { | - | ||||||||||||||||||||||||
| 394 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 395 | d->doChange(d->parent); | - | ||||||||||||||||||||||||
| 396 | } executed 126 times by 5 tests: end of blockExecuted by:
| 126 | ||||||||||||||||||||||||
| 397 | - | |||||||||||||||||||||||||
| 398 | bool QQuickParentChange::isReversable() | - | ||||||||||||||||||||||||
| 399 | { | - | ||||||||||||||||||||||||
| 400 | return executed 276 times by 5 tests: true;return true;Executed by:
executed 276 times by 5 tests: return true;Executed by:
| 276 | ||||||||||||||||||||||||
| 401 | } | - | ||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||
| 403 | void QQuickParentChange::reverse() | - | ||||||||||||||||||||||||
| 404 | { | - | ||||||||||||||||||||||||
| 405 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 406 | d->doChange(d->origParent, d->origStackBefore); | - | ||||||||||||||||||||||||
| 407 | } executed 10 times by 2 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 408 | - | |||||||||||||||||||||||||
| 409 | QQuickStateActionEvent::EventType QQuickParentChange::type() const | - | ||||||||||||||||||||||||
| 410 | { | - | ||||||||||||||||||||||||
| 411 | return executed 6 times by 2 tests: ParentChange;return ParentChange;Executed by:
executed 6 times by 2 tests: return ParentChange;Executed by:
| 6 | ||||||||||||||||||||||||
| 412 | } | - | ||||||||||||||||||||||||
| 413 | - | |||||||||||||||||||||||||
| 414 | bool QQuickParentChange::mayOverride(QQuickStateActionEvent*other) | - | ||||||||||||||||||||||||
| 415 | { | - | ||||||||||||||||||||||||
| 416 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 417 | if (other->type() != ParentChange
| 0 | ||||||||||||||||||||||||
| 418 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 419 | if (QQuickParentChange *otherPC = static_cast<QQuickParentChange*>(other)
| 0 | ||||||||||||||||||||||||
| 420 | return never executed: (d->target == otherPC->object());return (d->target == otherPC->object());never executed: return (d->target == otherPC->object()); | 0 | ||||||||||||||||||||||||
| 421 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 422 | } | - | ||||||||||||||||||||||||
| 423 | - | |||||||||||||||||||||||||
| 424 | void QQuickParentChange::saveCurrentValues() | - | ||||||||||||||||||||||||
| 425 | { | - | ||||||||||||||||||||||||
| 426 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 427 | if (!d->target
| 0-134 | ||||||||||||||||||||||||
| 428 | d->rewindParent = nullptr; | - | ||||||||||||||||||||||||
| 429 | d->rewindStackBefore = nullptr; | - | ||||||||||||||||||||||||
| 430 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 431 | } | - | ||||||||||||||||||||||||
| 432 | - | |||||||||||||||||||||||||
| 433 | d->rewindParent = d->target->parentItem(); | - | ||||||||||||||||||||||||
| 434 | d->rewindStackBefore = nullptr; | - | ||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||
| 436 | if (!d->rewindParent
| 32-102 | ||||||||||||||||||||||||
| 437 | return; executed 32 times by 2 tests: return;Executed by:
| 32 | ||||||||||||||||||||||||
| 438 | - | |||||||||||||||||||||||||
| 439 | QList<QQuickItem *> children = d->rewindParent->childItems(); | - | ||||||||||||||||||||||||
| 440 | for (int ii = 0; ii < children.count() - 1
| 94-156 | ||||||||||||||||||||||||
| 441 | if (children.at(ii) == d->target
| 8-148 | ||||||||||||||||||||||||
| 442 | d->rewindStackBefore = children.at(ii + 1); | - | ||||||||||||||||||||||||
| 443 | break; executed 8 times by 2 tests: break;Executed by:
| 8 | ||||||||||||||||||||||||
| 444 | } | - | ||||||||||||||||||||||||
| 445 | } executed 148 times by 2 tests: end of blockExecuted by:
| 148 | ||||||||||||||||||||||||
| 446 | } executed 102 times by 4 tests: end of blockExecuted by:
| 102 | ||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||
| 448 | void QQuickParentChange::rewind() | - | ||||||||||||||||||||||||
| 449 | { | - | ||||||||||||||||||||||||
| 450 | QQuickParentChangePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 451 | d->doChange(d->rewindParent, d->rewindStackBefore); | - | ||||||||||||||||||||||||
| 452 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 453 | class QQuickAnchorSetPrivate : public QObjectPrivate | - | ||||||||||||||||||||||||
| 454 | { | - | ||||||||||||||||||||||||
| 455 | inline QQuickAnchorSet* q_func() { return static_cast<QQuickAnchorSet *>(q_ptr); } inline const QQuickAnchorSet* q_func() const { return static_cast<const QQuickAnchorSet *>(q_ptr); } friend class QQuickAnchorSet; | - | ||||||||||||||||||||||||
| 456 | public: | - | ||||||||||||||||||||||||
| 457 | QQuickAnchorSetPrivate() | - | ||||||||||||||||||||||||
| 458 | : usedAnchors(nullptr), resetAnchors(nullptr) | - | ||||||||||||||||||||||||
| 459 | { | - | ||||||||||||||||||||||||
| 460 | } executed 36 times by 5 tests: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 461 | - | |||||||||||||||||||||||||
| 462 | QQuickAnchors::Anchors usedAnchors; | - | ||||||||||||||||||||||||
| 463 | QQuickAnchors::Anchors resetAnchors; | - | ||||||||||||||||||||||||
| 464 | - | |||||||||||||||||||||||||
| 465 | QQmlScriptString leftScript; | - | ||||||||||||||||||||||||
| 466 | QQmlScriptString rightScript; | - | ||||||||||||||||||||||||
| 467 | QQmlScriptString topScript; | - | ||||||||||||||||||||||||
| 468 | QQmlScriptString bottomScript; | - | ||||||||||||||||||||||||
| 469 | QQmlScriptString hCenterScript; | - | ||||||||||||||||||||||||
| 470 | QQmlScriptString vCenterScript; | - | ||||||||||||||||||||||||
| 471 | QQmlScriptString baselineScript; | - | ||||||||||||||||||||||||
| 472 | }; | - | ||||||||||||||||||||||||
| 473 | - | |||||||||||||||||||||||||
| 474 | QQuickAnchorSet::QQuickAnchorSet(QObject *parent) | - | ||||||||||||||||||||||||
| 475 | : QObject(*new QQuickAnchorSetPrivate, parent) | - | ||||||||||||||||||||||||
| 476 | { | - | ||||||||||||||||||||||||
| 477 | } executed 36 times by 5 tests: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 478 | - | |||||||||||||||||||||||||
| 479 | QQuickAnchorSet::~QQuickAnchorSet() | - | ||||||||||||||||||||||||
| 480 | { | - | ||||||||||||||||||||||||
| 481 | } | - | ||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||
| 483 | QQmlScriptString QQuickAnchorSet::top() const | - | ||||||||||||||||||||||||
| 484 | { | - | ||||||||||||||||||||||||
| 485 | const QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 486 | return executed 2 times by 1 test: d->topScript;return d->topScript;Executed by:
executed 2 times by 1 test: return d->topScript;Executed by:
| 2 | ||||||||||||||||||||||||
| 487 | } | - | ||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||
| 489 | void QQuickAnchorSet::setTop(const QQmlScriptString &edge) | - | ||||||||||||||||||||||||
| 490 | { | - | ||||||||||||||||||||||||
| 491 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 492 | d->usedAnchors |= QQuickAnchors::TopAnchor; | - | ||||||||||||||||||||||||
| 493 | d->topScript = edge; | - | ||||||||||||||||||||||||
| 494 | if (edge.isUndefinedLiteral()
| 4-10 | ||||||||||||||||||||||||
| 495 | resetTop(); executed 4 times by 1 test: resetTop();Executed by:
| 4 | ||||||||||||||||||||||||
| 496 | } executed 14 times by 3 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 497 | - | |||||||||||||||||||||||||
| 498 | void QQuickAnchorSet::resetTop() | - | ||||||||||||||||||||||||
| 499 | { | - | ||||||||||||||||||||||||
| 500 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 501 | d->usedAnchors &= ~QQuickAnchors::TopAnchor; | - | ||||||||||||||||||||||||
| 502 | d->resetAnchors |= QQuickAnchors::TopAnchor; | - | ||||||||||||||||||||||||
| 503 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 504 | - | |||||||||||||||||||||||||
| 505 | QQmlScriptString QQuickAnchorSet::bottom() const | - | ||||||||||||||||||||||||
| 506 | { | - | ||||||||||||||||||||||||
| 507 | const QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 508 | return executed 2 times by 1 test: d->bottomScript;return d->bottomScript;Executed by:
executed 2 times by 1 test: return d->bottomScript;Executed by:
| 2 | ||||||||||||||||||||||||
| 509 | } | - | ||||||||||||||||||||||||
| 510 | - | |||||||||||||||||||||||||
| 511 | void QQuickAnchorSet::setBottom(const QQmlScriptString &edge) | - | ||||||||||||||||||||||||
| 512 | { | - | ||||||||||||||||||||||||
| 513 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 514 | d->usedAnchors |= QQuickAnchors::BottomAnchor; | - | ||||||||||||||||||||||||
| 515 | d->bottomScript = edge; | - | ||||||||||||||||||||||||
| 516 | if (edge.isUndefinedLiteral()
| 0-10 | ||||||||||||||||||||||||
| 517 | resetBottom(); never executed: resetBottom(); | 0 | ||||||||||||||||||||||||
| 518 | } executed 10 times by 2 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||
| 520 | void QQuickAnchorSet::resetBottom() | - | ||||||||||||||||||||||||
| 521 | { | - | ||||||||||||||||||||||||
| 522 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 523 | d->usedAnchors &= ~QQuickAnchors::BottomAnchor; | - | ||||||||||||||||||||||||
| 524 | d->resetAnchors |= QQuickAnchors::BottomAnchor; | - | ||||||||||||||||||||||||
| 525 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||
| 527 | QQmlScriptString QQuickAnchorSet::verticalCenter() const | - | ||||||||||||||||||||||||
| 528 | { | - | ||||||||||||||||||||||||
| 529 | const QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 530 | return executed 2 times by 1 test: d->vCenterScript;return d->vCenterScript;Executed by:
executed 2 times by 1 test: return d->vCenterScript;Executed by:
| 2 | ||||||||||||||||||||||||
| 531 | } | - | ||||||||||||||||||||||||
| 532 | - | |||||||||||||||||||||||||
| 533 | void QQuickAnchorSet::setVerticalCenter(const QQmlScriptString &edge) | - | ||||||||||||||||||||||||
| 534 | { | - | ||||||||||||||||||||||||
| 535 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 536 | d->usedAnchors |= QQuickAnchors::VCenterAnchor; | - | ||||||||||||||||||||||||
| 537 | d->vCenterScript = edge; | - | ||||||||||||||||||||||||
| 538 | if (edge.isUndefinedLiteral()
| 4-6 | ||||||||||||||||||||||||
| 539 | resetVerticalCenter(); executed 4 times by 1 test: resetVerticalCenter();Executed by:
| 4 | ||||||||||||||||||||||||
| 540 | } executed 10 times by 3 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 541 | - | |||||||||||||||||||||||||
| 542 | void QQuickAnchorSet::resetVerticalCenter() | - | ||||||||||||||||||||||||
| 543 | { | - | ||||||||||||||||||||||||
| 544 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 545 | d->usedAnchors &= ~QQuickAnchors::VCenterAnchor; | - | ||||||||||||||||||||||||
| 546 | d->resetAnchors |= QQuickAnchors::VCenterAnchor; | - | ||||||||||||||||||||||||
| 547 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 548 | - | |||||||||||||||||||||||||
| 549 | QQmlScriptString QQuickAnchorSet::baseline() const | - | ||||||||||||||||||||||||
| 550 | { | - | ||||||||||||||||||||||||
| 551 | const QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 552 | return executed 2 times by 1 test: d->baselineScript;return d->baselineScript;Executed by:
executed 2 times by 1 test: return d->baselineScript;Executed by:
| 2 | ||||||||||||||||||||||||
| 553 | } | - | ||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||
| 555 | void QQuickAnchorSet::setBaseline(const QQmlScriptString &edge) | - | ||||||||||||||||||||||||
| 556 | { | - | ||||||||||||||||||||||||
| 557 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 558 | d->usedAnchors |= QQuickAnchors::BaselineAnchor; | - | ||||||||||||||||||||||||
| 559 | d->baselineScript = edge; | - | ||||||||||||||||||||||||
| 560 | if (edge.isUndefinedLiteral()
| 0-2 | ||||||||||||||||||||||||
| 561 | resetBaseline(); never executed: resetBaseline(); | 0 | ||||||||||||||||||||||||
| 562 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 563 | - | |||||||||||||||||||||||||
| 564 | void QQuickAnchorSet::resetBaseline() | - | ||||||||||||||||||||||||
| 565 | { | - | ||||||||||||||||||||||||
| 566 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 567 | d->usedAnchors &= ~QQuickAnchors::BaselineAnchor; | - | ||||||||||||||||||||||||
| 568 | d->resetAnchors |= QQuickAnchors::BaselineAnchor; | - | ||||||||||||||||||||||||
| 569 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||
| 571 | QQmlScriptString QQuickAnchorSet::left() const | - | ||||||||||||||||||||||||
| 572 | { | - | ||||||||||||||||||||||||
| 573 | const QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 574 | return executed 4 times by 1 test: d->leftScript;return d->leftScript;Executed by:
executed 4 times by 1 test: return d->leftScript;Executed by:
| 4 | ||||||||||||||||||||||||
| 575 | } | - | ||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||
| 577 | void QQuickAnchorSet::setLeft(const QQmlScriptString &edge) | - | ||||||||||||||||||||||||
| 578 | { | - | ||||||||||||||||||||||||
| 579 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 580 | d->usedAnchors |= QQuickAnchors::LeftAnchor; | - | ||||||||||||||||||||||||
| 581 | d->leftScript = edge; | - | ||||||||||||||||||||||||
| 582 | if (edge.isUndefinedLiteral()
| 12 | ||||||||||||||||||||||||
| 583 | resetLeft(); executed 12 times by 2 tests: resetLeft();Executed by:
| 12 | ||||||||||||||||||||||||
| 584 | } executed 24 times by 3 tests: end of blockExecuted by:
| 24 | ||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||
| 586 | void QQuickAnchorSet::resetLeft() | - | ||||||||||||||||||||||||
| 587 | { | - | ||||||||||||||||||||||||
| 588 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 589 | d->usedAnchors &= ~QQuickAnchors::LeftAnchor; | - | ||||||||||||||||||||||||
| 590 | d->resetAnchors |= QQuickAnchors::LeftAnchor; | - | ||||||||||||||||||||||||
| 591 | } executed 12 times by 2 tests: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 592 | - | |||||||||||||||||||||||||
| 593 | QQmlScriptString QQuickAnchorSet::right() const | - | ||||||||||||||||||||||||
| 594 | { | - | ||||||||||||||||||||||||
| 595 | const QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 596 | return executed 2 times by 1 test: d->rightScript;return d->rightScript;Executed by:
executed 2 times by 1 test: return d->rightScript;Executed by:
| 2 | ||||||||||||||||||||||||
| 597 | } | - | ||||||||||||||||||||||||
| 598 | - | |||||||||||||||||||||||||
| 599 | void QQuickAnchorSet::setRight(const QQmlScriptString &edge) | - | ||||||||||||||||||||||||
| 600 | { | - | ||||||||||||||||||||||||
| 601 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 602 | d->usedAnchors |= QQuickAnchors::RightAnchor; | - | ||||||||||||||||||||||||
| 603 | d->rightScript = edge; | - | ||||||||||||||||||||||||
| 604 | if (edge.isUndefinedLiteral()
| 2-20 | ||||||||||||||||||||||||
| 605 | resetRight(); executed 2 times by 1 test: resetRight();Executed by:
| 2 | ||||||||||||||||||||||||
| 606 | } executed 22 times by 3 tests: end of blockExecuted by:
| 22 | ||||||||||||||||||||||||
| 607 | - | |||||||||||||||||||||||||
| 608 | void QQuickAnchorSet::resetRight() | - | ||||||||||||||||||||||||
| 609 | { | - | ||||||||||||||||||||||||
| 610 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 611 | d->usedAnchors &= ~QQuickAnchors::RightAnchor; | - | ||||||||||||||||||||||||
| 612 | d->resetAnchors |= QQuickAnchors::RightAnchor; | - | ||||||||||||||||||||||||
| 613 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 614 | - | |||||||||||||||||||||||||
| 615 | QQmlScriptString QQuickAnchorSet::horizontalCenter() const | - | ||||||||||||||||||||||||
| 616 | { | - | ||||||||||||||||||||||||
| 617 | const QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 618 | return executed 2 times by 1 test: d->hCenterScript;return d->hCenterScript;Executed by:
executed 2 times by 1 test: return d->hCenterScript;Executed by:
| 2 | ||||||||||||||||||||||||
| 619 | } | - | ||||||||||||||||||||||||
| 620 | - | |||||||||||||||||||||||||
| 621 | void QQuickAnchorSet::setHorizontalCenter(const QQmlScriptString &edge) | - | ||||||||||||||||||||||||
| 622 | { | - | ||||||||||||||||||||||||
| 623 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 624 | d->usedAnchors |= QQuickAnchors::HCenterAnchor; | - | ||||||||||||||||||||||||
| 625 | d->hCenterScript = edge; | - | ||||||||||||||||||||||||
| 626 | if (edge.isUndefinedLiteral()
| 4-8 | ||||||||||||||||||||||||
| 627 | resetHorizontalCenter(); executed 8 times by 2 tests: resetHorizontalCenter();Executed by:
| 8 | ||||||||||||||||||||||||
| 628 | } executed 12 times by 3 tests: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 629 | - | |||||||||||||||||||||||||
| 630 | void QQuickAnchorSet::resetHorizontalCenter() | - | ||||||||||||||||||||||||
| 631 | { | - | ||||||||||||||||||||||||
| 632 | QQuickAnchorSetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 633 | d->usedAnchors &= ~QQuickAnchors::HCenterAnchor; | - | ||||||||||||||||||||||||
| 634 | d->resetAnchors |= QQuickAnchors::HCenterAnchor; | - | ||||||||||||||||||||||||
| 635 | } executed 8 times by 2 tests: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 636 | - | |||||||||||||||||||||||||
| 637 | class QQuickAnchorChangesPrivate : public QQuickStateOperationPrivate | - | ||||||||||||||||||||||||
| 638 | { | - | ||||||||||||||||||||||||
| 639 | public: | - | ||||||||||||||||||||||||
| 640 | QQuickAnchorChangesPrivate() | - | ||||||||||||||||||||||||
| 641 | : target(nullptr), anchorSet(new QQuickAnchorSet) | - | ||||||||||||||||||||||||
| 642 | { | - | ||||||||||||||||||||||||
| 643 | - | |||||||||||||||||||||||||
| 644 | } executed 36 times by 5 tests: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 645 | ~QQuickAnchorChangesPrivate() { delete anchorSet; } executed 36 times by 5 tests: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 646 | - | |||||||||||||||||||||||||
| 647 | QQuickItem *target; | - | ||||||||||||||||||||||||
| 648 | QQuickAnchorSet *anchorSet; | - | ||||||||||||||||||||||||
| 649 | - | |||||||||||||||||||||||||
| 650 | QExplicitlySharedDataPointer<QQmlBinding> leftBinding; | - | ||||||||||||||||||||||||
| 651 | QExplicitlySharedDataPointer<QQmlBinding> rightBinding; | - | ||||||||||||||||||||||||
| 652 | QExplicitlySharedDataPointer<QQmlBinding> hCenterBinding; | - | ||||||||||||||||||||||||
| 653 | QExplicitlySharedDataPointer<QQmlBinding> topBinding; | - | ||||||||||||||||||||||||
| 654 | QExplicitlySharedDataPointer<QQmlBinding> bottomBinding; | - | ||||||||||||||||||||||||
| 655 | QExplicitlySharedDataPointer<QQmlBinding> vCenterBinding; | - | ||||||||||||||||||||||||
| 656 | QExplicitlySharedDataPointer<QQmlBinding> baselineBinding; | - | ||||||||||||||||||||||||
| 657 | - | |||||||||||||||||||||||||
| 658 | QQmlAbstractBinding::Ptr origLeftBinding; | - | ||||||||||||||||||||||||
| 659 | QQmlAbstractBinding::Ptr origRightBinding; | - | ||||||||||||||||||||||||
| 660 | QQmlAbstractBinding::Ptr origHCenterBinding; | - | ||||||||||||||||||||||||
| 661 | QQmlAbstractBinding::Ptr origTopBinding; | - | ||||||||||||||||||||||||
| 662 | QQmlAbstractBinding::Ptr origBottomBinding; | - | ||||||||||||||||||||||||
| 663 | QQmlAbstractBinding::Ptr origVCenterBinding; | - | ||||||||||||||||||||||||
| 664 | QQmlAbstractBinding::Ptr origBaselineBinding; | - | ||||||||||||||||||||||||
| 665 | - | |||||||||||||||||||||||||
| 666 | QQuickAnchorLine rewindLeft; | - | ||||||||||||||||||||||||
| 667 | QQuickAnchorLine rewindRight; | - | ||||||||||||||||||||||||
| 668 | QQuickAnchorLine rewindHCenter; | - | ||||||||||||||||||||||||
| 669 | QQuickAnchorLine rewindTop; | - | ||||||||||||||||||||||||
| 670 | QQuickAnchorLine rewindBottom; | - | ||||||||||||||||||||||||
| 671 | QQuickAnchorLine rewindVCenter; | - | ||||||||||||||||||||||||
| 672 | QQuickAnchorLine rewindBaseline; | - | ||||||||||||||||||||||||
| 673 | - | |||||||||||||||||||||||||
| 674 | qreal fromX; | - | ||||||||||||||||||||||||
| 675 | qreal fromY; | - | ||||||||||||||||||||||||
| 676 | qreal fromWidth; | - | ||||||||||||||||||||||||
| 677 | qreal fromHeight; | - | ||||||||||||||||||||||||
| 678 | - | |||||||||||||||||||||||||
| 679 | qreal toX; | - | ||||||||||||||||||||||||
| 680 | qreal toY; | - | ||||||||||||||||||||||||
| 681 | qreal toWidth; | - | ||||||||||||||||||||||||
| 682 | qreal toHeight; | - | ||||||||||||||||||||||||
| 683 | - | |||||||||||||||||||||||||
| 684 | qreal rewindX; | - | ||||||||||||||||||||||||
| 685 | qreal rewindY; | - | ||||||||||||||||||||||||
| 686 | qreal rewindWidth; | - | ||||||||||||||||||||||||
| 687 | qreal rewindHeight; | - | ||||||||||||||||||||||||
| 688 | - | |||||||||||||||||||||||||
| 689 | bool applyOrigLeft; | - | ||||||||||||||||||||||||
| 690 | bool applyOrigRight; | - | ||||||||||||||||||||||||
| 691 | bool applyOrigHCenter; | - | ||||||||||||||||||||||||
| 692 | bool applyOrigTop; | - | ||||||||||||||||||||||||
| 693 | bool applyOrigBottom; | - | ||||||||||||||||||||||||
| 694 | bool applyOrigVCenter; | - | ||||||||||||||||||||||||
| 695 | bool applyOrigBaseline; | - | ||||||||||||||||||||||||
| 696 | - | |||||||||||||||||||||||||
| 697 | QQmlNullableValue<qreal> origWidth; | - | ||||||||||||||||||||||||
| 698 | QQmlNullableValue<qreal> origHeight; | - | ||||||||||||||||||||||||
| 699 | qreal origX; | - | ||||||||||||||||||||||||
| 700 | qreal origY; | - | ||||||||||||||||||||||||
| 701 | - | |||||||||||||||||||||||||
| 702 | QQmlProperty leftProp; | - | ||||||||||||||||||||||||
| 703 | QQmlProperty rightProp; | - | ||||||||||||||||||||||||
| 704 | QQmlProperty hCenterProp; | - | ||||||||||||||||||||||||
| 705 | QQmlProperty topProp; | - | ||||||||||||||||||||||||
| 706 | QQmlProperty bottomProp; | - | ||||||||||||||||||||||||
| 707 | QQmlProperty vCenterProp; | - | ||||||||||||||||||||||||
| 708 | QQmlProperty baselineProp; | - | ||||||||||||||||||||||||
| 709 | }; | - | ||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||
| 711 | QQuickAnchorChanges::QQuickAnchorChanges(QObject *parent) | - | ||||||||||||||||||||||||
| 712 | : QQuickStateOperation(*(new QQuickAnchorChangesPrivate), parent) | - | ||||||||||||||||||||||||
| 713 | { | - | ||||||||||||||||||||||||
| 714 | } executed 36 times by 5 tests: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 715 | - | |||||||||||||||||||||||||
| 716 | QQuickAnchorChanges::~QQuickAnchorChanges() | - | ||||||||||||||||||||||||
| 717 | { | - | ||||||||||||||||||||||||
| 718 | } | - | ||||||||||||||||||||||||
| 719 | - | |||||||||||||||||||||||||
| 720 | QQuickAnchorChanges::ActionList QQuickAnchorChanges::actions() | - | ||||||||||||||||||||||||
| 721 | { | - | ||||||||||||||||||||||||
| 722 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 723 | - | |||||||||||||||||||||||||
| 724 | d->leftBinding = d->rightBinding = d->hCenterBinding = d->topBinding | - | ||||||||||||||||||||||||
| 725 | = d->bottomBinding = d->vCenterBinding = d->baselineBinding = nullptr; | - | ||||||||||||||||||||||||
| 726 | - | |||||||||||||||||||||||||
| 727 | d->leftProp = QQmlProperty(d->target, QLatin1String("anchors.left")); | - | ||||||||||||||||||||||||
| 728 | d->rightProp = QQmlProperty(d->target, QLatin1String("anchors.right")); | - | ||||||||||||||||||||||||
| 729 | d->hCenterProp = QQmlProperty(d->target, QLatin1String("anchors.horizontalCenter")); | - | ||||||||||||||||||||||||
| 730 | d->topProp = QQmlProperty(d->target, QLatin1String("anchors.top")); | - | ||||||||||||||||||||||||
| 731 | d->bottomProp = QQmlProperty(d->target, QLatin1String("anchors.bottom")); | - | ||||||||||||||||||||||||
| 732 | d->vCenterProp = QQmlProperty(d->target, QLatin1String("anchors.verticalCenter")); | - | ||||||||||||||||||||||||
| 733 | d->baselineProp = QQmlProperty(d->target, QLatin1String("anchors.baseline")); | - | ||||||||||||||||||||||||
| 734 | - | |||||||||||||||||||||||||
| 735 | if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::LeftAnchor
| 14-26 | ||||||||||||||||||||||||
| 736 | d->leftBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->leftProp)->core, d->anchorSet->d_func()->leftScript, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 737 | d->leftBinding->setTarget(d->leftProp); | - | ||||||||||||||||||||||||
| 738 | } executed 14 times by 3 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 739 | if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::RightAnchor
| 18-22 | ||||||||||||||||||||||||
| 740 | d->rightBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->rightProp)->core, d->anchorSet->d_func()->rightScript, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 741 | d->rightBinding->setTarget(d->rightProp); | - | ||||||||||||||||||||||||
| 742 | } executed 22 times by 3 tests: end of blockExecuted by:
| 22 | ||||||||||||||||||||||||
| 743 | if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::HCenterAnchor
| 4-36 | ||||||||||||||||||||||||
| 744 | d->hCenterBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->hCenterProp)->core, d->anchorSet->d_func()->hCenterScript, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 745 | d->hCenterBinding->setTarget(d->hCenterProp); | - | ||||||||||||||||||||||||
| 746 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 747 | if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::TopAnchor
| 14-26 | ||||||||||||||||||||||||
| 748 | d->topBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->topProp)->core, d->anchorSet->d_func()->topScript, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 749 | d->topBinding->setTarget(d->topProp); | - | ||||||||||||||||||||||||
| 750 | } executed 14 times by 2 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 751 | if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::BottomAnchor
| 14-26 | ||||||||||||||||||||||||
| 752 | d->bottomBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->bottomProp)->core, d->anchorSet->d_func()->bottomScript, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 753 | d->bottomBinding->setTarget(d->bottomProp); | - | ||||||||||||||||||||||||
| 754 | } executed 14 times by 2 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 755 | if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::VCenterAnchor
| 6-34 | ||||||||||||||||||||||||
| 756 | d->vCenterBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->vCenterProp)->core, d->anchorSet->d_func()->vCenterScript, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 757 | d->vCenterBinding->setTarget(d->vCenterProp); | - | ||||||||||||||||||||||||
| 758 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 759 | if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::BaselineAnchor
| 2-38 | ||||||||||||||||||||||||
| 760 | d->baselineBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(d->baselineProp)->core, d->anchorSet->d_func()->baselineScript, d->target, qmlContext(this)); | - | ||||||||||||||||||||||||
| 761 | d->baselineBinding->setTarget(d->baselineProp); | - | ||||||||||||||||||||||||
| 762 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 763 | - | |||||||||||||||||||||||||
| 764 | QQuickStateAction a; | - | ||||||||||||||||||||||||
| 765 | a.event = this; | - | ||||||||||||||||||||||||
| 766 | return executed 40 times by 5 tests: ActionList() << a;return ActionList() << a;Executed by:
executed 40 times by 5 tests: return ActionList() << a;Executed by:
| 40 | ||||||||||||||||||||||||
| 767 | } | - | ||||||||||||||||||||||||
| 768 | - | |||||||||||||||||||||||||
| 769 | QQuickAnchorSet *QQuickAnchorChanges::anchors() const | - | ||||||||||||||||||||||||
| 770 | { | - | ||||||||||||||||||||||||
| 771 | const QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 772 | return executed 52 times by 5 tests: d->anchorSet;return d->anchorSet;Executed by:
executed 52 times by 5 tests: return d->anchorSet;Executed by:
| 52 | ||||||||||||||||||||||||
| 773 | } | - | ||||||||||||||||||||||||
| 774 | - | |||||||||||||||||||||||||
| 775 | - | |||||||||||||||||||||||||
| 776 | - | |||||||||||||||||||||||||
| 777 | - | |||||||||||||||||||||||||
| 778 | - | |||||||||||||||||||||||||
| 779 | QQuickItem *QQuickAnchorChanges::object() const | - | ||||||||||||||||||||||||
| 780 | { | - | ||||||||||||||||||||||||
| 781 | const QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 782 | return executed 80 times by 2 tests: d->target;return d->target;Executed by:
executed 80 times by 2 tests: return d->target;Executed by:
| 80 | ||||||||||||||||||||||||
| 783 | } | - | ||||||||||||||||||||||||
| 784 | - | |||||||||||||||||||||||||
| 785 | void QQuickAnchorChanges::setObject(QQuickItem *target) | - | ||||||||||||||||||||||||
| 786 | { | - | ||||||||||||||||||||||||
| 787 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 788 | d->target = target; | - | ||||||||||||||||||||||||
| 789 | } executed 34 times by 5 tests: end of blockExecuted by:
| 34 | ||||||||||||||||||||||||
| 790 | void QQuickAnchorChanges::execute() | - | ||||||||||||||||||||||||
| 791 | { | - | ||||||||||||||||||||||||
| 792 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 793 | if (!d->target
| 2-44 | ||||||||||||||||||||||||
| 794 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 795 | - | |||||||||||||||||||||||||
| 796 | QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target); | - | ||||||||||||||||||||||||
| 797 | - | |||||||||||||||||||||||||
| 798 | if (d->applyOrigLeft
| 8-36 | ||||||||||||||||||||||||
| 799 | if (!d->origLeftBinding
| 0-8 | ||||||||||||||||||||||||
| 800 | targetPrivate->anchors()->resetLeft(); never executed: targetPrivate->anchors()->resetLeft(); | 0 | ||||||||||||||||||||||||
| 801 | QQmlPropertyPrivate::setBinding(d->leftProp, d->origLeftBinding.data()); | - | ||||||||||||||||||||||||
| 802 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 803 | if (d->applyOrigRight
| 8-36 | ||||||||||||||||||||||||
| 804 | if (!d->origRightBinding
| 0-8 | ||||||||||||||||||||||||
| 805 | targetPrivate->anchors()->resetRight(); never executed: targetPrivate->anchors()->resetRight(); | 0 | ||||||||||||||||||||||||
| 806 | QQmlPropertyPrivate::setBinding(d->rightProp, d->origRightBinding.data()); | - | ||||||||||||||||||||||||
| 807 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 808 | if (d->applyOrigHCenter
| 0-44 | ||||||||||||||||||||||||
| 809 | if (!d->origHCenterBinding
| 0 | ||||||||||||||||||||||||
| 810 | targetPrivate->anchors()->resetHorizontalCenter(); never executed: targetPrivate->anchors()->resetHorizontalCenter(); | 0 | ||||||||||||||||||||||||
| 811 | QQmlPropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding.data()); | - | ||||||||||||||||||||||||
| 812 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 813 | if (d->applyOrigTop
| 8-36 | ||||||||||||||||||||||||
| 814 | if (!d->origTopBinding
| 0-8 | ||||||||||||||||||||||||
| 815 | targetPrivate->anchors()->resetTop(); never executed: targetPrivate->anchors()->resetTop(); | 0 | ||||||||||||||||||||||||
| 816 | QQmlPropertyPrivate::setBinding(d->topProp, d->origTopBinding.data()); | - | ||||||||||||||||||||||||
| 817 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 818 | if (d->applyOrigBottom
| 8-36 | ||||||||||||||||||||||||
| 819 | if (!d->origBottomBinding
| 0-8 | ||||||||||||||||||||||||
| 820 | targetPrivate->anchors()->resetBottom(); never executed: targetPrivate->anchors()->resetBottom(); | 0 | ||||||||||||||||||||||||
| 821 | QQmlPropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding.data()); | - | ||||||||||||||||||||||||
| 822 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 823 | if (d->applyOrigVCenter
| 0-44 | ||||||||||||||||||||||||
| 824 | if (!d->origVCenterBinding
| 0 | ||||||||||||||||||||||||
| 825 | targetPrivate->anchors()->resetVerticalCenter(); never executed: targetPrivate->anchors()->resetVerticalCenter(); | 0 | ||||||||||||||||||||||||
| 826 | QQmlPropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding.data()); | - | ||||||||||||||||||||||||
| 827 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 828 | if (d->applyOrigBaseline
| 0-44 | ||||||||||||||||||||||||
| 829 | if (!d->origBaselineBinding
| 0 | ||||||||||||||||||||||||
| 830 | targetPrivate->anchors()->resetBaseline(); never executed: targetPrivate->anchors()->resetBaseline(); | 0 | ||||||||||||||||||||||||
| 831 | QQmlPropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding.data()); | - | ||||||||||||||||||||||||
| 832 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||
| 834 | - | |||||||||||||||||||||||||
| 835 | if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::LeftAnchor
| 18-26 | ||||||||||||||||||||||||
| 836 | targetPrivate->anchors()->resetLeft(); | - | ||||||||||||||||||||||||
| 837 | QQmlPropertyPrivate::removeBinding(d->leftProp); | - | ||||||||||||||||||||||||
| 838 | } executed 18 times by 2 tests: end of blockExecuted by:
| 18 | ||||||||||||||||||||||||
| 839 | if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::RightAnchor
| 8-36 | ||||||||||||||||||||||||
| 840 | targetPrivate->anchors()->resetRight(); | - | ||||||||||||||||||||||||
| 841 | QQmlPropertyPrivate::removeBinding(d->rightProp); | - | ||||||||||||||||||||||||
| 842 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 843 | if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::HCenterAnchor
| 8-36 | ||||||||||||||||||||||||
| 844 | targetPrivate->anchors()->resetHorizontalCenter(); | - | ||||||||||||||||||||||||
| 845 | QQmlPropertyPrivate::removeBinding(d->hCenterProp); | - | ||||||||||||||||||||||||
| 846 | } executed 8 times by 2 tests: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 847 | if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::TopAnchor
| 4-40 | ||||||||||||||||||||||||
| 848 | targetPrivate->anchors()->resetTop(); | - | ||||||||||||||||||||||||
| 849 | QQmlPropertyPrivate::removeBinding(d->topProp); | - | ||||||||||||||||||||||||
| 850 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 851 | if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::BottomAnchor
| 0-44 | ||||||||||||||||||||||||
| 852 | targetPrivate->anchors()->resetBottom(); | - | ||||||||||||||||||||||||
| 853 | QQmlPropertyPrivate::removeBinding(d->bottomProp); | - | ||||||||||||||||||||||||
| 854 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 855 | if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::VCenterAnchor
| 4-40 | ||||||||||||||||||||||||
| 856 | targetPrivate->anchors()->resetVerticalCenter(); | - | ||||||||||||||||||||||||
| 857 | QQmlPropertyPrivate::removeBinding(d->vCenterProp); | - | ||||||||||||||||||||||||
| 858 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 859 | if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::BaselineAnchor
| 0-44 | ||||||||||||||||||||||||
| 860 | targetPrivate->anchors()->resetBaseline(); | - | ||||||||||||||||||||||||
| 861 | QQmlPropertyPrivate::removeBinding(d->baselineProp); | - | ||||||||||||||||||||||||
| 862 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 863 | - | |||||||||||||||||||||||||
| 864 | - | |||||||||||||||||||||||||
| 865 | if (d->leftBinding
| 16-28 | ||||||||||||||||||||||||
| 866 | QQmlPropertyPrivate::setBinding(d->leftBinding.data()); executed 16 times by 3 tests: QQmlPropertyPrivate::setBinding(d->leftBinding.data());Executed by:
| 16 | ||||||||||||||||||||||||
| 867 | if (d->rightBinding
| 20-24 | ||||||||||||||||||||||||
| 868 | QQmlPropertyPrivate::setBinding(d->rightBinding.data()); executed 24 times by 3 tests: QQmlPropertyPrivate::setBinding(d->rightBinding.data());Executed by:
| 24 | ||||||||||||||||||||||||
| 869 | if (d->hCenterBinding
| 4-40 | ||||||||||||||||||||||||
| 870 | QQmlPropertyPrivate::setBinding(d->hCenterBinding.data()); executed 4 times by 1 test: QQmlPropertyPrivate::setBinding(d->hCenterBinding.data());Executed by:
| 4 | ||||||||||||||||||||||||
| 871 | if (d->topBinding
| 18-26 | ||||||||||||||||||||||||
| 872 | QQmlPropertyPrivate::setBinding(d->topBinding.data()); executed 18 times by 2 tests: QQmlPropertyPrivate::setBinding(d->topBinding.data());Executed by:
| 18 | ||||||||||||||||||||||||
| 873 | if (d->bottomBinding
| 20-24 | ||||||||||||||||||||||||
| 874 | QQmlPropertyPrivate::setBinding(d->bottomBinding.data()); executed 20 times by 2 tests: QQmlPropertyPrivate::setBinding(d->bottomBinding.data());Executed by:
| 20 | ||||||||||||||||||||||||
| 875 | if (d->vCenterBinding
| 6-38 | ||||||||||||||||||||||||
| 876 | QQmlPropertyPrivate::setBinding(d->vCenterBinding.data()); executed 6 times by 2 tests: QQmlPropertyPrivate::setBinding(d->vCenterBinding.data());Executed by:
| 6 | ||||||||||||||||||||||||
| 877 | if (d->baselineBinding
| 2-42 | ||||||||||||||||||||||||
| 878 | QQmlPropertyPrivate::setBinding(d->baselineBinding.data()); executed 2 times by 1 test: QQmlPropertyPrivate::setBinding(d->baselineBinding.data());Executed by:
| 2 | ||||||||||||||||||||||||
| 879 | } executed 44 times by 5 tests: end of blockExecuted by:
| 44 | ||||||||||||||||||||||||
| 880 | - | |||||||||||||||||||||||||
| 881 | bool QQuickAnchorChanges::isReversable() | - | ||||||||||||||||||||||||
| 882 | { | - | ||||||||||||||||||||||||
| 883 | return executed 104 times by 5 tests: true;return true;Executed by:
executed 104 times by 5 tests: return true;Executed by:
| 104 | ||||||||||||||||||||||||
| 884 | } | - | ||||||||||||||||||||||||
| 885 | - | |||||||||||||||||||||||||
| 886 | void QQuickAnchorChanges::reverse() | - | ||||||||||||||||||||||||
| 887 | { | - | ||||||||||||||||||||||||
| 888 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 889 | if (!d->target
| 0-24 | ||||||||||||||||||||||||
| 890 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 891 | - | |||||||||||||||||||||||||
| 892 | QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target); | - | ||||||||||||||||||||||||
| 893 | - | |||||||||||||||||||||||||
| 894 | if (d->leftBinding
| 10-14 | ||||||||||||||||||||||||
| 895 | targetPrivate->anchors()->resetLeft(); | - | ||||||||||||||||||||||||
| 896 | QQmlPropertyPrivate::removeBinding(d->leftBinding.data()); | - | ||||||||||||||||||||||||
| 897 | } executed 10 times by 2 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 898 | if (d->rightBinding
| 4-20 | ||||||||||||||||||||||||
| 899 | targetPrivate->anchors()->resetRight(); | - | ||||||||||||||||||||||||
| 900 | QQmlPropertyPrivate::removeBinding(d->rightBinding.data()); | - | ||||||||||||||||||||||||
| 901 | } executed 20 times by 2 tests: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||
| 902 | if (d->hCenterBinding
| 0-24 | ||||||||||||||||||||||||
| 903 | targetPrivate->anchors()->resetHorizontalCenter(); | - | ||||||||||||||||||||||||
| 904 | QQmlPropertyPrivate::removeBinding(d->hCenterBinding.data()); | - | ||||||||||||||||||||||||
| 905 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 906 | if (d->topBinding
| 8-16 | ||||||||||||||||||||||||
| 907 | targetPrivate->anchors()->resetTop(); | - | ||||||||||||||||||||||||
| 908 | QQmlPropertyPrivate::removeBinding(d->topBinding.data()); | - | ||||||||||||||||||||||||
| 909 | } executed 8 times by 2 tests: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 910 | if (d->bottomBinding
| 10-14 | ||||||||||||||||||||||||
| 911 | targetPrivate->anchors()->resetBottom(); | - | ||||||||||||||||||||||||
| 912 | QQmlPropertyPrivate::removeBinding(d->bottomBinding.data()); | - | ||||||||||||||||||||||||
| 913 | } executed 10 times by 2 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 914 | if (d->vCenterBinding
| 0-24 | ||||||||||||||||||||||||
| 915 | targetPrivate->anchors()->resetVerticalCenter(); | - | ||||||||||||||||||||||||
| 916 | QQmlPropertyPrivate::removeBinding(d->vCenterBinding.data()); | - | ||||||||||||||||||||||||
| 917 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 918 | if (d->baselineBinding
| 0-24 | ||||||||||||||||||||||||
| 919 | targetPrivate->anchors()->resetBaseline(); | - | ||||||||||||||||||||||||
| 920 | QQmlPropertyPrivate::removeBinding(d->baselineBinding.data()); | - | ||||||||||||||||||||||||
| 921 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 922 | - | |||||||||||||||||||||||||
| 923 | - | |||||||||||||||||||||||||
| 924 | if (d->origLeftBinding
| 6-18 | ||||||||||||||||||||||||
| 925 | QQmlPropertyPrivate::setBinding(d->leftProp, d->origLeftBinding.data()); executed 18 times by 2 tests: QQmlPropertyPrivate::setBinding(d->leftProp, d->origLeftBinding.data());Executed by:
| 18 | ||||||||||||||||||||||||
| 926 | if (d->origRightBinding
| 8-16 | ||||||||||||||||||||||||
| 927 | QQmlPropertyPrivate::setBinding(d->rightProp, d->origRightBinding.data()); executed 8 times by 2 tests: QQmlPropertyPrivate::setBinding(d->rightProp, d->origRightBinding.data());Executed by:
| 8 | ||||||||||||||||||||||||
| 928 | if (d->origHCenterBinding
| 4-20 | ||||||||||||||||||||||||
| 929 | QQmlPropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding.data()); executed 4 times by 1 test: QQmlPropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding.data());Executed by:
| 4 | ||||||||||||||||||||||||
| 930 | if (d->origTopBinding
| 8-16 | ||||||||||||||||||||||||
| 931 | QQmlPropertyPrivate::setBinding(d->topProp, d->origTopBinding.data()); executed 8 times by 2 tests: QQmlPropertyPrivate::setBinding(d->topProp, d->origTopBinding.data());Executed by:
| 8 | ||||||||||||||||||||||||
| 932 | if (d->origBottomBinding
| 10-14 | ||||||||||||||||||||||||
| 933 | QQmlPropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding.data()); executed 10 times by 2 tests: QQmlPropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding.data());Executed by:
| 10 | ||||||||||||||||||||||||
| 934 | if (d->origVCenterBinding
| 4-20 | ||||||||||||||||||||||||
| 935 | QQmlPropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding.data()); executed 4 times by 1 test: QQmlPropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding.data());Executed by:
| 4 | ||||||||||||||||||||||||
| 936 | if (d->origBaselineBinding
| 0-24 | ||||||||||||||||||||||||
| 937 | QQmlPropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding.data()); never executed: QQmlPropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding.data()); | 0 | ||||||||||||||||||||||||
| 938 | - | |||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||
| 940 | QQuickAnchors::Anchors stateVAnchors = d->anchorSet->d_func()->usedAnchors & QQuickAnchors::Vertical_Mask; | - | ||||||||||||||||||||||||
| 941 | QQuickAnchors::Anchors origVAnchors = targetPrivate->anchors()->usedAnchors() & QQuickAnchors::Vertical_Mask; | - | ||||||||||||||||||||||||
| 942 | QQuickAnchors::Anchors stateHAnchors = d->anchorSet->d_func()->usedAnchors & QQuickAnchors::Horizontal_Mask; | - | ||||||||||||||||||||||||
| 943 | QQuickAnchors::Anchors origHAnchors = targetPrivate->anchors()->usedAnchors() & QQuickAnchors::Horizontal_Mask; | - | ||||||||||||||||||||||||
| 944 | - | |||||||||||||||||||||||||
| 945 | bool stateSetWidth = (stateHAnchors && | - | ||||||||||||||||||||||||
| 946 | stateHAnchors != QQuickAnchors::LeftAnchor
| 0-20 | ||||||||||||||||||||||||
| 947 | stateHAnchors != QQuickAnchors::RightAnchor
| 10 | ||||||||||||||||||||||||
| 948 | stateHAnchors != QQuickAnchors::HCenterAnchor
| 0-10 | ||||||||||||||||||||||||
| 949 | bool origSetWidth = (origHAnchors && | - | ||||||||||||||||||||||||
| 950 | origHAnchors != QQuickAnchors::LeftAnchor
| 10-12 | ||||||||||||||||||||||||
| 951 | origHAnchors != QQuickAnchors::RightAnchor
| 0-12 | ||||||||||||||||||||||||
| 952 | origHAnchors != QQuickAnchors::HCenterAnchor
| 4-8 | ||||||||||||||||||||||||
| 953 | if (d->origWidth.isValid()
| 2-22 | ||||||||||||||||||||||||
| 954 | d->target->setWidth(d->origWidth.value); executed 2 times by 1 test: d->target->setWidth(d->origWidth.value);Executed by:
| 2 | ||||||||||||||||||||||||
| 955 | - | |||||||||||||||||||||||||
| 956 | bool stateSetHeight = (stateVAnchors && | - | ||||||||||||||||||||||||
| 957 | stateVAnchors != QQuickAnchors::TopAnchor
| 0-10 | ||||||||||||||||||||||||
| 958 | stateVAnchors != QQuickAnchors::BottomAnchor
| 2-8 | ||||||||||||||||||||||||
| 959 | stateVAnchors != QQuickAnchors::VCenterAnchor
| 0-8 | ||||||||||||||||||||||||
| 960 | stateVAnchors != QQuickAnchors::BaselineAnchor
| 0-8 | ||||||||||||||||||||||||
| 961 | bool origSetHeight = (origVAnchors && | - | ||||||||||||||||||||||||
| 962 | origVAnchors != QQuickAnchors::TopAnchor
| 0-14 | ||||||||||||||||||||||||
| 963 | origVAnchors != QQuickAnchors::BottomAnchor
| 2-12 | ||||||||||||||||||||||||
| 964 | origVAnchors != QQuickAnchors::VCenterAnchor
| 4-8 | ||||||||||||||||||||||||
| 965 | origVAnchors != QQuickAnchors::BaselineAnchor
| 0-8 | ||||||||||||||||||||||||
| 966 | if (d->origHeight.isValid()
| 0-22 | ||||||||||||||||||||||||
| 967 | d->target->setHeight(d->origHeight.value); never executed: d->target->setHeight(d->origHeight.value); | 0 | ||||||||||||||||||||||||
| 968 | - | |||||||||||||||||||||||||
| 969 | if (stateHAnchors && !origHAnchors
| 2-18 | ||||||||||||||||||||||||
| 970 | d->target->setX(d->origX); executed 2 times by 1 test: d->target->setX(d->origX);Executed by:
| 2 | ||||||||||||||||||||||||
| 971 | - | |||||||||||||||||||||||||
| 972 | if (stateVAnchors && !origVAnchors
| 2-8 | ||||||||||||||||||||||||
| 973 | d->target->setY(d->origY); executed 2 times by 1 test: d->target->setY(d->origY);Executed by:
| 2 | ||||||||||||||||||||||||
| 974 | } executed 24 times by 3 tests: end of blockExecuted by:
| 24 | ||||||||||||||||||||||||
| 975 | - | |||||||||||||||||||||||||
| 976 | QQuickStateActionEvent::EventType QQuickAnchorChanges::type() const | - | ||||||||||||||||||||||||
| 977 | { | - | ||||||||||||||||||||||||
| 978 | return executed 26 times by 3 tests: AnchorChanges;return AnchorChanges;Executed by:
executed 26 times by 3 tests: return AnchorChanges;Executed by:
| 26 | ||||||||||||||||||||||||
| 979 | } | - | ||||||||||||||||||||||||
| 980 | - | |||||||||||||||||||||||||
| 981 | QList<QQuickStateAction> QQuickAnchorChanges::additionalActions() const | - | ||||||||||||||||||||||||
| 982 | { | - | ||||||||||||||||||||||||
| 983 | const QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 984 | QList<QQuickStateAction> extra; | - | ||||||||||||||||||||||||
| 985 | - | |||||||||||||||||||||||||
| 986 | QQuickAnchors::Anchors combined = d->anchorSet->d_func()->usedAnchors | d->anchorSet->d_func()->resetAnchors; | - | ||||||||||||||||||||||||
| 987 | bool hChange = combined & QQuickAnchors::Horizontal_Mask; | - | ||||||||||||||||||||||||
| 988 | bool vChange = combined & QQuickAnchors::Vertical_Mask; | - | ||||||||||||||||||||||||
| 989 | - | |||||||||||||||||||||||||
| 990 | if (d->target
| 0-10 | ||||||||||||||||||||||||
| 991 | QQuickStateAction a; | - | ||||||||||||||||||||||||
| 992 | if (hChange
| 0-10 | ||||||||||||||||||||||||
| 993 | a.property = QQmlProperty(d->target, QLatin1String("x")); | - | ||||||||||||||||||||||||
| 994 | a.toValue = d->toX; | - | ||||||||||||||||||||||||
| 995 | extra << a; | - | ||||||||||||||||||||||||
| 996 | } executed 8 times by 2 tests: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 997 | if (vChange
| 0-8 | ||||||||||||||||||||||||
| 998 | a.property = QQmlProperty(d->target, QLatin1String("y")); | - | ||||||||||||||||||||||||
| 999 | a.toValue = d->toY; | - | ||||||||||||||||||||||||
| 1000 | extra << a; | - | ||||||||||||||||||||||||
| 1001 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 1002 | if (hChange
| 0-10 | ||||||||||||||||||||||||
| 1003 | a.property = QQmlProperty(d->target, QLatin1String("width")); | - | ||||||||||||||||||||||||
| 1004 | a.toValue = d->toWidth; | - | ||||||||||||||||||||||||
| 1005 | extra << a; | - | ||||||||||||||||||||||||
| 1006 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 1007 | if (vChange
| 0-8 | ||||||||||||||||||||||||
| 1008 | a.property = QQmlProperty(d->target, QLatin1String("height")); | - | ||||||||||||||||||||||||
| 1009 | a.toValue = d->toHeight; | - | ||||||||||||||||||||||||
| 1010 | extra << a; | - | ||||||||||||||||||||||||
| 1011 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 1012 | } executed 10 times by 2 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 1013 | - | |||||||||||||||||||||||||
| 1014 | return executed 10 times by 2 tests: extra;return extra;Executed by:
executed 10 times by 2 tests: return extra;Executed by:
| 10 | ||||||||||||||||||||||||
| 1015 | } | - | ||||||||||||||||||||||||
| 1016 | - | |||||||||||||||||||||||||
| 1017 | bool QQuickAnchorChanges::changesBindings() | - | ||||||||||||||||||||||||
| 1018 | { | - | ||||||||||||||||||||||||
| 1019 | return executed 124 times by 5 tests: true;return true;Executed by:
executed 124 times by 5 tests: return true;Executed by:
| 124 | ||||||||||||||||||||||||
| 1020 | } | - | ||||||||||||||||||||||||
| 1021 | - | |||||||||||||||||||||||||
| 1022 | void QQuickAnchorChanges::saveOriginals() | - | ||||||||||||||||||||||||
| 1023 | { | - | ||||||||||||||||||||||||
| 1024 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1025 | if (!d->target
| 2-34 | ||||||||||||||||||||||||
| 1026 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||
| 1028 | d->origLeftBinding = QQmlPropertyPrivate::binding(d->leftProp); | - | ||||||||||||||||||||||||
| 1029 | d->origRightBinding = QQmlPropertyPrivate::binding(d->rightProp); | - | ||||||||||||||||||||||||
| 1030 | d->origHCenterBinding = QQmlPropertyPrivate::binding(d->hCenterProp); | - | ||||||||||||||||||||||||
| 1031 | d->origTopBinding = QQmlPropertyPrivate::binding(d->topProp); | - | ||||||||||||||||||||||||
| 1032 | d->origBottomBinding = QQmlPropertyPrivate::binding(d->bottomProp); | - | ||||||||||||||||||||||||
| 1033 | d->origVCenterBinding = QQmlPropertyPrivate::binding(d->vCenterProp); | - | ||||||||||||||||||||||||
| 1034 | d->origBaselineBinding = QQmlPropertyPrivate::binding(d->baselineProp); | - | ||||||||||||||||||||||||
| 1035 | - | |||||||||||||||||||||||||
| 1036 | QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target); | - | ||||||||||||||||||||||||
| 1037 | if (targetPrivate->widthValid
| 6-28 | ||||||||||||||||||||||||
| 1038 | d->origWidth = d->target->width(); executed 28 times by 5 tests: d->origWidth = d->target->width();Executed by:
| 28 | ||||||||||||||||||||||||
| 1039 | if (targetPrivate->heightValid
| 6-28 | ||||||||||||||||||||||||
| 1040 | d->origHeight = d->target->height(); executed 28 times by 5 tests: d->origHeight = d->target->height();Executed by:
| 28 | ||||||||||||||||||||||||
| 1041 | d->origX = d->target->x(); | - | ||||||||||||||||||||||||
| 1042 | d->origY = d->target->y(); | - | ||||||||||||||||||||||||
| 1043 | - | |||||||||||||||||||||||||
| 1044 | d->applyOrigLeft = d->applyOrigRight = d->applyOrigHCenter = d->applyOrigTop | - | ||||||||||||||||||||||||
| 1045 | = d->applyOrigBottom = d->applyOrigVCenter = d->applyOrigBaseline = false; | - | ||||||||||||||||||||||||
| 1046 | - | |||||||||||||||||||||||||
| 1047 | saveCurrentValues(); | - | ||||||||||||||||||||||||
| 1048 | } executed 34 times by 5 tests: end of blockExecuted by:
| 34 | ||||||||||||||||||||||||
| 1049 | - | |||||||||||||||||||||||||
| 1050 | void QQuickAnchorChanges::copyOriginals(QQuickStateActionEvent *other) | - | ||||||||||||||||||||||||
| 1051 | { | - | ||||||||||||||||||||||||
| 1052 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1053 | QQuickAnchorChanges *ac = static_cast<QQuickAnchorChanges*>(other); | - | ||||||||||||||||||||||||
| 1054 | QQuickAnchorChangesPrivate *acp = ac->d_func(); | - | ||||||||||||||||||||||||
| 1055 | - | |||||||||||||||||||||||||
| 1056 | QQuickAnchors::Anchors combined = acp->anchorSet->d_func()->usedAnchors | | - | ||||||||||||||||||||||||
| 1057 | acp->anchorSet->d_func()->resetAnchors; | - | ||||||||||||||||||||||||
| 1058 | - | |||||||||||||||||||||||||
| 1059 | - | |||||||||||||||||||||||||
| 1060 | d->applyOrigLeft = (combined & QQuickAnchors::LeftAnchor); | - | ||||||||||||||||||||||||
| 1061 | d->applyOrigRight = (combined & QQuickAnchors::RightAnchor); | - | ||||||||||||||||||||||||
| 1062 | d->applyOrigHCenter = (combined & QQuickAnchors::HCenterAnchor); | - | ||||||||||||||||||||||||
| 1063 | d->applyOrigTop = (combined & QQuickAnchors::TopAnchor); | - | ||||||||||||||||||||||||
| 1064 | d->applyOrigBottom = (combined & QQuickAnchors::BottomAnchor); | - | ||||||||||||||||||||||||
| 1065 | d->applyOrigVCenter = (combined & QQuickAnchors::VCenterAnchor); | - | ||||||||||||||||||||||||
| 1066 | d->applyOrigBaseline = (combined & QQuickAnchors::BaselineAnchor); | - | ||||||||||||||||||||||||
| 1067 | - | |||||||||||||||||||||||||
| 1068 | d->origLeftBinding = acp->origLeftBinding; | - | ||||||||||||||||||||||||
| 1069 | d->origRightBinding = acp->origRightBinding; | - | ||||||||||||||||||||||||
| 1070 | d->origHCenterBinding = acp->origHCenterBinding; | - | ||||||||||||||||||||||||
| 1071 | d->origTopBinding = acp->origTopBinding; | - | ||||||||||||||||||||||||
| 1072 | d->origBottomBinding = acp->origBottomBinding; | - | ||||||||||||||||||||||||
| 1073 | d->origVCenterBinding = acp->origVCenterBinding; | - | ||||||||||||||||||||||||
| 1074 | d->origBaselineBinding = acp->origBaselineBinding; | - | ||||||||||||||||||||||||
| 1075 | - | |||||||||||||||||||||||||
| 1076 | d->origWidth = acp->origWidth; | - | ||||||||||||||||||||||||
| 1077 | d->origHeight = acp->origHeight; | - | ||||||||||||||||||||||||
| 1078 | d->origX = acp->origX; | - | ||||||||||||||||||||||||
| 1079 | d->origY = acp->origY; | - | ||||||||||||||||||||||||
| 1080 | - | |||||||||||||||||||||||||
| 1081 | - | |||||||||||||||||||||||||
| 1082 | - | |||||||||||||||||||||||||
| 1083 | acp->leftBinding = nullptr; | - | ||||||||||||||||||||||||
| 1084 | acp->rightBinding = nullptr; | - | ||||||||||||||||||||||||
| 1085 | acp->hCenterBinding = nullptr; | - | ||||||||||||||||||||||||
| 1086 | acp->topBinding = nullptr; | - | ||||||||||||||||||||||||
| 1087 | acp->bottomBinding = nullptr; | - | ||||||||||||||||||||||||
| 1088 | acp->vCenterBinding = nullptr; | - | ||||||||||||||||||||||||
| 1089 | acp->baselineBinding = nullptr; | - | ||||||||||||||||||||||||
| 1090 | acp->origLeftBinding = nullptr; | - | ||||||||||||||||||||||||
| 1091 | acp->origRightBinding = nullptr; | - | ||||||||||||||||||||||||
| 1092 | acp->origHCenterBinding = nullptr; | - | ||||||||||||||||||||||||
| 1093 | acp->origTopBinding = nullptr; | - | ||||||||||||||||||||||||
| 1094 | acp->origBottomBinding = nullptr; | - | ||||||||||||||||||||||||
| 1095 | acp->origVCenterBinding = nullptr; | - | ||||||||||||||||||||||||
| 1096 | acp->origBaselineBinding = nullptr; | - | ||||||||||||||||||||||||
| 1097 | - | |||||||||||||||||||||||||
| 1098 | saveCurrentValues(); | - | ||||||||||||||||||||||||
| 1099 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 1100 | - | |||||||||||||||||||||||||
| 1101 | void QQuickAnchorChanges::clearBindings() | - | ||||||||||||||||||||||||
| 1102 | { | - | ||||||||||||||||||||||||
| 1103 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1104 | if (!d->target
| 2-80 | ||||||||||||||||||||||||
| 1105 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 1106 | - | |||||||||||||||||||||||||
| 1107 | - | |||||||||||||||||||||||||
| 1108 | d->fromX = d->target->x(); | - | ||||||||||||||||||||||||
| 1109 | d->fromY = d->target->y(); | - | ||||||||||||||||||||||||
| 1110 | d->fromWidth = d->target->width(); | - | ||||||||||||||||||||||||
| 1111 | d->fromHeight = d->target->height(); | - | ||||||||||||||||||||||||
| 1112 | - | |||||||||||||||||||||||||
| 1113 | QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target); | - | ||||||||||||||||||||||||
| 1114 | - | |||||||||||||||||||||||||
| 1115 | - | |||||||||||||||||||||||||
| 1116 | - | |||||||||||||||||||||||||
| 1117 | QQuickAnchors::Anchors combined = d->anchorSet->d_func()->resetAnchors | | - | ||||||||||||||||||||||||
| 1118 | d->anchorSet->d_func()->usedAnchors; | - | ||||||||||||||||||||||||
| 1119 | if (d->applyOrigLeft
| 12-68 | ||||||||||||||||||||||||
| 1120 | targetPrivate->anchors()->resetLeft(); | - | ||||||||||||||||||||||||
| 1121 | QQmlPropertyPrivate::removeBinding(d->leftProp); | - | ||||||||||||||||||||||||
| 1122 | } executed 62 times by 3 tests: end of blockExecuted by:
| 62 | ||||||||||||||||||||||||
| 1123 | if (d->applyOrigRight
| 12-68 | ||||||||||||||||||||||||
| 1124 | targetPrivate->anchors()->resetRight(); | - | ||||||||||||||||||||||||
| 1125 | QQmlPropertyPrivate::removeBinding(d->rightProp); | - | ||||||||||||||||||||||||
| 1126 | } executed 64 times by 3 tests: end of blockExecuted by:
| 64 | ||||||||||||||||||||||||
| 1127 | if (d->applyOrigHCenter
| 0-80 | ||||||||||||||||||||||||
| 1128 | targetPrivate->anchors()->resetHorizontalCenter(); | - | ||||||||||||||||||||||||
| 1129 | QQmlPropertyPrivate::removeBinding(d->hCenterProp); | - | ||||||||||||||||||||||||
| 1130 | } executed 16 times by 3 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||
| 1131 | if (d->applyOrigTop
| 12-68 | ||||||||||||||||||||||||
| 1132 | targetPrivate->anchors()->resetTop(); | - | ||||||||||||||||||||||||
| 1133 | QQmlPropertyPrivate::removeBinding(d->topProp); | - | ||||||||||||||||||||||||
| 1134 | } executed 38 times by 3 tests: end of blockExecuted by:
| 38 | ||||||||||||||||||||||||
| 1135 | if (d->applyOrigBottom
| 12-68 | ||||||||||||||||||||||||
| 1136 | targetPrivate->anchors()->resetBottom(); | - | ||||||||||||||||||||||||
| 1137 | QQmlPropertyPrivate::removeBinding(d->bottomProp); | - | ||||||||||||||||||||||||
| 1138 | } executed 38 times by 2 tests: end of blockExecuted by:
| 38 | ||||||||||||||||||||||||
| 1139 | if (d->applyOrigVCenter
| 0-80 | ||||||||||||||||||||||||
| 1140 | targetPrivate->anchors()->resetVerticalCenter(); | - | ||||||||||||||||||||||||
| 1141 | QQmlPropertyPrivate::removeBinding(d->vCenterProp); | - | ||||||||||||||||||||||||
| 1142 | } executed 14 times by 3 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 1143 | if (d->applyOrigBaseline
| 0-80 | ||||||||||||||||||||||||
| 1144 | targetPrivate->anchors()->resetBaseline(); | - | ||||||||||||||||||||||||
| 1145 | QQmlPropertyPrivate::removeBinding(d->baselineProp); | - | ||||||||||||||||||||||||
| 1146 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 1147 | } executed 80 times by 5 tests: end of blockExecuted by:
| 80 | ||||||||||||||||||||||||
| 1148 | - | |||||||||||||||||||||||||
| 1149 | bool QQuickAnchorChanges::mayOverride(QQuickStateActionEvent*other) | - | ||||||||||||||||||||||||
| 1150 | { | - | ||||||||||||||||||||||||
| 1151 | if (other->type() != AnchorChanges
| 0-4 | ||||||||||||||||||||||||
| 1152 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1153 | if (static_cast<
| 0-4 | ||||||||||||||||||||||||
| 1154 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1155 | if (static_cast<
| 0-4 | ||||||||||||||||||||||||
| 1156 | return executed 4 times by 1 test: true;return true;Executed by:
executed 4 times by 1 test: return true;Executed by:
| 4 | ||||||||||||||||||||||||
| 1157 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1158 | } | - | ||||||||||||||||||||||||
| 1159 | - | |||||||||||||||||||||||||
| 1160 | void QQuickAnchorChanges::rewind() | - | ||||||||||||||||||||||||
| 1161 | { | - | ||||||||||||||||||||||||
| 1162 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1163 | if (!d->target
| 0-10 | ||||||||||||||||||||||||
| 1164 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1165 | - | |||||||||||||||||||||||||
| 1166 | QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target); | - | ||||||||||||||||||||||||
| 1167 | - | |||||||||||||||||||||||||
| 1168 | - | |||||||||||||||||||||||||
| 1169 | d->target->setX(d->rewindX); | - | ||||||||||||||||||||||||
| 1170 | d->target->setY(d->rewindY); | - | ||||||||||||||||||||||||
| 1171 | if (targetPrivate->widthValid
| 0-10 | ||||||||||||||||||||||||
| 1172 | d->target->setWidth(d->rewindWidth); | - | ||||||||||||||||||||||||
| 1173 | } executed 10 times by 2 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 1174 | if (targetPrivate->heightValid
| 0-10 | ||||||||||||||||||||||||
| 1175 | d->target->setHeight(d->rewindHeight); | - | ||||||||||||||||||||||||
| 1176 | } executed 10 times by 2 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 1177 | } executed 10 times by 2 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 1178 | - | |||||||||||||||||||||||||
| 1179 | void QQuickAnchorChanges::saveCurrentValues() | - | ||||||||||||||||||||||||
| 1180 | { | - | ||||||||||||||||||||||||
| 1181 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1182 | if (!d->target
| 0-60 | ||||||||||||||||||||||||
| 1183 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1184 | - | |||||||||||||||||||||||||
| 1185 | QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target); | - | ||||||||||||||||||||||||
| 1186 | d->rewindLeft = targetPrivate->anchors()->left(); | - | ||||||||||||||||||||||||
| 1187 | d->rewindRight = targetPrivate->anchors()->right(); | - | ||||||||||||||||||||||||
| 1188 | d->rewindHCenter = targetPrivate->anchors()->horizontalCenter(); | - | ||||||||||||||||||||||||
| 1189 | d->rewindTop = targetPrivate->anchors()->top(); | - | ||||||||||||||||||||||||
| 1190 | d->rewindBottom = targetPrivate->anchors()->bottom(); | - | ||||||||||||||||||||||||
| 1191 | d->rewindVCenter = targetPrivate->anchors()->verticalCenter(); | - | ||||||||||||||||||||||||
| 1192 | d->rewindBaseline = targetPrivate->anchors()->baseline(); | - | ||||||||||||||||||||||||
| 1193 | - | |||||||||||||||||||||||||
| 1194 | d->rewindX = d->target->x(); | - | ||||||||||||||||||||||||
| 1195 | d->rewindY = d->target->y(); | - | ||||||||||||||||||||||||
| 1196 | d->rewindWidth = d->target->width(); | - | ||||||||||||||||||||||||
| 1197 | d->rewindHeight = d->target->height(); | - | ||||||||||||||||||||||||
| 1198 | } executed 60 times by 5 tests: end of blockExecuted by:
| 60 | ||||||||||||||||||||||||
| 1199 | - | |||||||||||||||||||||||||
| 1200 | void QQuickAnchorChanges::saveTargetValues() | - | ||||||||||||||||||||||||
| 1201 | { | - | ||||||||||||||||||||||||
| 1202 | QQuickAnchorChangesPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1203 | if (!d->target
| 0-10 | ||||||||||||||||||||||||
| 1204 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1205 | - | |||||||||||||||||||||||||
| 1206 | d->toX = d->target->x(); | - | ||||||||||||||||||||||||
| 1207 | d->toY = d->target->y(); | - | ||||||||||||||||||||||||
| 1208 | d->toWidth = d->target->width(); | - | ||||||||||||||||||||||||
| 1209 | d->toHeight = d->target->height(); | - | ||||||||||||||||||||||||
| 1210 | } executed 10 times by 2 tests: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 1211 | - | |||||||||||||||||||||||||
| 1212 | - | |||||||||||||||||||||||||
| 1213 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |