| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/qtquick2.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | static void initResources() | - | ||||||||||||
| 4 | { | - | ||||||||||||
| 5 | do { extern int qInitResources_scenegraph (); qInitResources_scenegraph (); } while (false); | - | ||||||||||||
| 6 | } executed 374 times by 132 tests: end of blockExecuted by:
| 374 | ||||||||||||
| 7 | - | |||||||||||||
| 8 | - | |||||||||||||
| 9 | - | |||||||||||||
| 10 | - | |||||||||||||
| 11 | - | |||||||||||||
| 12 | - | |||||||||||||
| 13 | - | |||||||||||||
| 14 | - | |||||||||||||
| 15 | - | |||||||||||||
| 16 | class QQmlQtQuick2DebugStatesDelegate : public QQmlDebugStatesDelegate | - | ||||||||||||
| 17 | { | - | ||||||||||||
| 18 | public: | - | ||||||||||||
| 19 | QQmlQtQuick2DebugStatesDelegate(); | - | ||||||||||||
| 20 | ~QQmlQtQuick2DebugStatesDelegate(); | - | ||||||||||||
| 21 | void buildStatesList(bool cleanList, const QList<QPointer<QObject> > &instances) override; | - | ||||||||||||
| 22 | void updateBinding(QQmlContext *context, | - | ||||||||||||
| 23 | const QQmlProperty &property, | - | ||||||||||||
| 24 | const QVariant &expression, bool isLiteralValue, | - | ||||||||||||
| 25 | const QString &fileName, int line, int column, | - | ||||||||||||
| 26 | bool *isBaseState) override; | - | ||||||||||||
| 27 | bool setBindingForInvalidProperty(QObject *object, | - | ||||||||||||
| 28 | const QString &propertyName, | - | ||||||||||||
| 29 | const QVariant &expression, | - | ||||||||||||
| 30 | bool isLiteralValue) override; | - | ||||||||||||
| 31 | void resetBindingForInvalidProperty(QObject *object, | - | ||||||||||||
| 32 | const QString &propertyName) override; | - | ||||||||||||
| 33 | - | |||||||||||||
| 34 | private: | - | ||||||||||||
| 35 | void buildStatesList(QObject *obj); | - | ||||||||||||
| 36 | - | |||||||||||||
| 37 | QList<QPointer<QQuickState> > m_allStates; | - | ||||||||||||
| 38 | }; | - | ||||||||||||
| 39 | - | |||||||||||||
| 40 | QQmlQtQuick2DebugStatesDelegate::QQmlQtQuick2DebugStatesDelegate() | - | ||||||||||||
| 41 | { | - | ||||||||||||
| 42 | } | - | ||||||||||||
| 43 | - | |||||||||||||
| 44 | QQmlQtQuick2DebugStatesDelegate::~QQmlQtQuick2DebugStatesDelegate() | - | ||||||||||||
| 45 | { | - | ||||||||||||
| 46 | } | - | ||||||||||||
| 47 | - | |||||||||||||
| 48 | void QQmlQtQuick2DebugStatesDelegate::buildStatesList(bool cleanList, | - | ||||||||||||
| 49 | const QList<QPointer<QObject> > &instances) | - | ||||||||||||
| 50 | { | - | ||||||||||||
| 51 | if (cleanList
| 0-102 | ||||||||||||
| 52 | m_allStates.clear(); executed 102 times by 1 test: m_allStates.clear();Executed by:
| 102 | ||||||||||||
| 53 | - | |||||||||||||
| 54 | - | |||||||||||||
| 55 | for (int ii = 0; ii < instances.count()
| 102-622 | ||||||||||||
| 56 | buildStatesList(instances.at(ii)); | - | ||||||||||||
| 57 | } executed 622 times by 1 test: end of blockExecuted by:
| 622 | ||||||||||||
| 58 | } executed 102 times by 1 test: end of blockExecuted by:
| 102 | ||||||||||||
| 59 | - | |||||||||||||
| 60 | void QQmlQtQuick2DebugStatesDelegate::buildStatesList(QObject *obj) | - | ||||||||||||
| 61 | { | - | ||||||||||||
| 62 | if (QQuickState *state = qobject_cast<QQuickState *>(obj)
| 102-1440 | ||||||||||||
| 63 | m_allStates.append(state); | - | ||||||||||||
| 64 | } executed 102 times by 1 test: end of blockExecuted by:
| 102 | ||||||||||||
| 65 | - | |||||||||||||
| 66 | QObjectList children = obj->children(); | - | ||||||||||||
| 67 | for (int ii = 0; ii < children.count()
| 920-1542 | ||||||||||||
| 68 | buildStatesList(children.at(ii)); | - | ||||||||||||
| 69 | } executed 920 times by 1 test: end of blockExecuted by:
| 920 | ||||||||||||
| 70 | } executed 1542 times by 1 test: end of blockExecuted by:
| 1542 | ||||||||||||
| 71 | - | |||||||||||||
| 72 | void QQmlQtQuick2DebugStatesDelegate::updateBinding(QQmlContext *context, | - | ||||||||||||
| 73 | const QQmlProperty &property, | - | ||||||||||||
| 74 | const QVariant &expression, bool isLiteralValue, | - | ||||||||||||
| 75 | const QString &fileName, int line, int column, | - | ||||||||||||
| 76 | bool *inBaseState) | - | ||||||||||||
| 77 | { | - | ||||||||||||
| 78 | (void)column;; | - | ||||||||||||
| 79 | typedef QPointer<QQuickState> QuickStatePointer; | - | ||||||||||||
| 80 | QObject *object = property.object(); | - | ||||||||||||
| 81 | QString propertyName = property.name(); | - | ||||||||||||
| 82 | for (const QuickStatePointer& statePointer : qAsConst(m_allStates)) { | - | ||||||||||||
| 83 | if (QQuickState *state = statePointer.data()
| 0-12 | ||||||||||||
| 84 | - | |||||||||||||
| 85 | if (state->isStateActive()
| 2-8 | ||||||||||||
| 86 | *inBaseState = false; | - | ||||||||||||
| 87 | - | |||||||||||||
| 88 | QQmlBinding *newBinding = nullptr; | - | ||||||||||||
| 89 | if (!isLiteralValue
| 0-2 | ||||||||||||
| 90 | newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, | - | ||||||||||||
| 91 | expression.toString(), object, | - | ||||||||||||
| 92 | QQmlContextData::get(context), fileName, | - | ||||||||||||
| 93 | line); | - | ||||||||||||
| 94 | newBinding->setTarget(property); | - | ||||||||||||
| 95 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||
| 96 | - | |||||||||||||
| 97 | state->changeBindingInRevertList(object, propertyName, newBinding); | - | ||||||||||||
| 98 | - | |||||||||||||
| 99 | if (isLiteralValue
| 0-2 | ||||||||||||
| 100 | state->changeValueInRevertList(object, propertyName, expression); never executed: state->changeValueInRevertList(object, propertyName, expression); | 0 | ||||||||||||
| 101 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||
| 102 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||
| 103 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||
| 104 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||
| 105 | - | |||||||||||||
| 106 | bool QQmlQtQuick2DebugStatesDelegate::setBindingForInvalidProperty(QObject *object, | - | ||||||||||||
| 107 | const QString &propertyName, | - | ||||||||||||
| 108 | const QVariant &expression, | - | ||||||||||||
| 109 | bool isLiteralValue) | - | ||||||||||||
| 110 | { | - | ||||||||||||
| 111 | if (QQuickPropertyChanges *propertyChanges = qobject_cast<QQuickPropertyChanges *>(object)
| 0-4 | ||||||||||||
| 112 | if (isLiteralValue
| 0-4 | ||||||||||||
| 113 | propertyChanges->changeValue(propertyName, expression); executed 4 times by 1 test: propertyChanges->changeValue(propertyName, expression);Executed by:
| 4 | ||||||||||||
| 114 | else | - | ||||||||||||
| 115 | propertyChanges->changeExpression(propertyName, expression.toString()); never executed: propertyChanges->changeExpression(propertyName, expression.toString()); | 0 | ||||||||||||
| 116 | return executed 4 times by 1 test: true;return true;Executed by:
executed 4 times by 1 test: return true;Executed by:
| 4 | ||||||||||||
| 117 | } else { | - | ||||||||||||
| 118 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 119 | } | - | ||||||||||||
| 120 | } | - | ||||||||||||
| 121 | - | |||||||||||||
| 122 | void QQmlQtQuick2DebugStatesDelegate::resetBindingForInvalidProperty(QObject *object, const QString &propertyName) | - | ||||||||||||
| 123 | { | - | ||||||||||||
| 124 | if (QQuickPropertyChanges *propertyChanges = qobject_cast<QQuickPropertyChanges *>(object)
| 2 | ||||||||||||
| 125 | propertyChanges->removeProperty(propertyName); | - | ||||||||||||
| 126 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||
| 127 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||
| 128 | - | |||||||||||||
| 129 | - | |||||||||||||
| 130 | - | |||||||||||||
| 131 | void QQmlQtQuick2Module::defineModule() | - | ||||||||||||
| 132 | { | - | ||||||||||||
| 133 | initResources(); | - | ||||||||||||
| 134 | - | |||||||||||||
| 135 | QQuick_initializeProviders(); | - | ||||||||||||
| 136 | - | |||||||||||||
| 137 | QQuickUtilModule::defineModule(); | - | ||||||||||||
| 138 | QQmlEnginePrivate::defineQtQuick2Module(); | - | ||||||||||||
| 139 | QQuickItemsModule::defineModule(); | - | ||||||||||||
| 140 | - | |||||||||||||
| 141 | qmlRegisterUncreatableType<QQuickApplication>("QtQuick",2,0,"Application", QQuickApplication::tr("Application is an abstract class")); | - | ||||||||||||
| 142 | - | |||||||||||||
| 143 | QQuickValueTypes::registerValueTypes(); | - | ||||||||||||
| 144 | - | |||||||||||||
| 145 | - | |||||||||||||
| 146 | QAccessible::installFactory(&qQuickAccessibleFactory); | - | ||||||||||||
| 147 | - | |||||||||||||
| 148 | - | |||||||||||||
| 149 | QQmlEngineDebugService *debugService = QQmlDebugConnector::service<QQmlEngineDebugService>(); | - | ||||||||||||
| 150 | if (debugService
| 18-356 | ||||||||||||
| 151 | debugService->setStatesDelegate(new QQmlQtQuick2DebugStatesDelegate); executed 18 times by 2 tests: debugService->setStatesDelegate(new QQmlQtQuick2DebugStatesDelegate);Executed by:
| 18 | ||||||||||||
| 152 | } executed 374 times by 132 tests: end of blockExecuted by:
| 374 | ||||||||||||
| 153 | - | |||||||||||||
| 154 | void QQmlQtQuick2Module::undefineModule() | - | ||||||||||||
| 155 | { | - | ||||||||||||
| 156 | QQuick_deinitializeProviders(); | - | ||||||||||||
| 157 | } executed 88 times by 3 tests: end of blockExecuted by:
| 88 | ||||||||||||
| 158 | - | |||||||||||||
| 159 | - | |||||||||||||
| Switch to Source code | Preprocessed file |