| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlengine.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | class QQmlAbstractUrlInterceptor; | - | ||||||
| 5 | - | |||||||
| 6 | class __attribute__((visibility("default"))) QQmlImageProviderBase | - | ||||||
| 7 | { | - | ||||||
| 8 | public: | - | ||||||
| 9 | enum ImageType { | - | ||||||
| 10 | Image, | - | ||||||
| 11 | Pixmap, | - | ||||||
| 12 | Texture, | - | ||||||
| 13 | Invalid, | - | ||||||
| 14 | ImageResponse | - | ||||||
| 15 | - | |||||||
| 16 | }; | - | ||||||
| 17 | - | |||||||
| 18 | enum Flag { | - | ||||||
| 19 | ForceAsynchronousImageLoading = 0x01 | - | ||||||
| 20 | }; | - | ||||||
| 21 | typedef QFlags<Flag> Flags; | - | ||||||
| 22 | - | |||||||
| 23 | virtual ~QQmlImageProviderBase(); | - | ||||||
| 24 | - | |||||||
| 25 | virtual ImageType imageType() const = 0; | - | ||||||
| 26 | virtual Flags flags() const = 0; | - | ||||||
| 27 | - | |||||||
| 28 | private: | - | ||||||
| 29 | friend class QQuickImageProvider; | - | ||||||
| 30 | QQmlImageProviderBase(); | - | ||||||
| 31 | }; | - | ||||||
| 32 | constexpr inline QFlags<QQmlImageProviderBase::Flags::enum_type> operator|(QQmlImageProviderBase::Flags::enum_type f1, QQmlImageProviderBase::Flags::enum_type f2) noexcept { return QFlags<QQmlImageProviderBase::Flags::enum_type>(f1) | f2; } constexpr inline QFlags<QQmlImageProviderBase::Flags::enum_type> operator|(QQmlImageProviderBase::Flags::enum_type f1, QFlags<QQmlImageProviderBase::Flags::enum_type> f2) noexcept { return f2 | f1; } constexpr inline QIncompatibleFlag operator|(QQmlImageProviderBase::Flags::enum_type f1, int f2) noexcept { return QIncompatibleFlag(int(f1) | f2); } | - | ||||||
| 33 | - | |||||||
| 34 | class QQmlComponent; | - | ||||||
| 35 | class QQmlEnginePrivate; | - | ||||||
| 36 | class QQmlImportsPrivate; | - | ||||||
| 37 | class QQmlExpression; | - | ||||||
| 38 | class QQmlContext; | - | ||||||
| 39 | class QQmlType; | - | ||||||
| 40 | class QUrl; | - | ||||||
| 41 | - | |||||||
| 42 | class QNetworkAccessManager; | - | ||||||
| 43 | class QQmlNetworkAccessManagerFactory; | - | ||||||
| 44 | - | |||||||
| 45 | class QQmlIncubationController; | - | ||||||
| 46 | class __attribute__((visibility("default"))) QQmlEngine : public QJSEngine | - | ||||||
| 47 | { | - | ||||||
| 48 | - | |||||||
| 49 | public: | - | ||||||
| 50 | #pragma GCC diagnostic push | - | ||||||
| 51 | - | |||||||
| 52 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - | ||||||
| 53 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: | - | ||||||
| 54 | #pragma GCC diagnostic ignored "-Wattributes" | - | ||||||
| 55 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||
| 56 | #pragma GCC diagnostic pop | - | ||||||
| 57 | struct QPrivateSignal {}; | - | ||||||
| 58 | public: | - | ||||||
| 59 | explicit QQmlEngine(QObject *p = nullptr); | - | ||||||
| 60 | ~QQmlEngine() override; | - | ||||||
| 61 | - | |||||||
| 62 | QQmlContext *rootContext() const; | - | ||||||
| 63 | - | |||||||
| 64 | void clearComponentCache(); | - | ||||||
| 65 | void trimComponentCache(); | - | ||||||
| 66 | - | |||||||
| 67 | QStringList importPathList() const; | - | ||||||
| 68 | void setImportPathList(const QStringList &paths); | - | ||||||
| 69 | void addImportPath(const QString& dir); | - | ||||||
| 70 | - | |||||||
| 71 | QStringList pluginPathList() const; | - | ||||||
| 72 | void setPluginPathList(const QStringList &paths); | - | ||||||
| 73 | void addPluginPath(const QString& dir); | - | ||||||
| 74 | - | |||||||
| 75 | bool addNamedBundle(const QString &name, const QString &fileName); | - | ||||||
| 76 | - | |||||||
| 77 | bool importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors); | - | ||||||
| 78 | - | |||||||
| 79 | - | |||||||
| 80 | void setNetworkAccessManagerFactory(QQmlNetworkAccessManagerFactory *); | - | ||||||
| 81 | QQmlNetworkAccessManagerFactory *networkAccessManagerFactory() const; | - | ||||||
| 82 | - | |||||||
| 83 | QNetworkAccessManager *networkAccessManager() const; | - | ||||||
| 84 | - | |||||||
| 85 | - | |||||||
| 86 | void setUrlInterceptor(QQmlAbstractUrlInterceptor* urlInterceptor); | - | ||||||
| 87 | QQmlAbstractUrlInterceptor* urlInterceptor() const; | - | ||||||
| 88 | - | |||||||
| 89 | void addImageProvider(const QString &id, QQmlImageProviderBase *); | - | ||||||
| 90 | QQmlImageProviderBase *imageProvider(const QString &id) const; | - | ||||||
| 91 | void removeImageProvider(const QString &id); | - | ||||||
| 92 | - | |||||||
| 93 | void setIncubationController(QQmlIncubationController *); | - | ||||||
| 94 | QQmlIncubationController *incubationController() const; | - | ||||||
| 95 | - | |||||||
| 96 | void setOfflineStoragePath(const QString& dir); | - | ||||||
| 97 | QString offlineStoragePath() const; | - | ||||||
| 98 | QString offlineStorageDatabaseFilePath(const QString &databaseName) const; | - | ||||||
| 99 | - | |||||||
| 100 | QUrl baseUrl() const; | - | ||||||
| 101 | void setBaseUrl(const QUrl &); | - | ||||||
| 102 | - | |||||||
| 103 | bool outputWarningsToStandardError() const; | - | ||||||
| 104 | void setOutputWarningsToStandardError(bool); | - | ||||||
| 105 | - | |||||||
| 106 | template<typename T> | - | ||||||
| 107 | T singletonInstance(int qmlTypeId); | - | ||||||
| 108 | - | |||||||
| 109 | public : | - | ||||||
| 110 | void retranslate(); | - | ||||||
| 111 | - | |||||||
| 112 | public: | - | ||||||
| 113 | static QQmlContext *contextForObject(const QObject *); | - | ||||||
| 114 | static void setContextForObject(QObject *, QQmlContext *); | - | ||||||
| 115 | - | |||||||
| 116 | enum ObjectOwnership { CppOwnership, JavaScriptOwnership }; | - | ||||||
| 117 | static void setObjectOwnership(QObject *, ObjectOwnership); | - | ||||||
| 118 | static ObjectOwnership objectOwnership(QObject *); | - | ||||||
| 119 | protected: | - | ||||||
| 120 | QQmlEngine(QQmlEnginePrivate &dd, QObject *p); | - | ||||||
| 121 | bool event(QEvent *) override; | - | ||||||
| 122 | - | |||||||
| 123 | public : | - | ||||||
| 124 | void quit(); | - | ||||||
| 125 | void exit(int retCode); | - | ||||||
| 126 | void warnings(const QList<QQmlError> &warnings); | - | ||||||
| 127 | - | |||||||
| 128 | private: | - | ||||||
| 129 | QQmlEngine(const QQmlEngine &) = delete; QQmlEngine &operator=(const QQmlEngine &) = delete; | - | ||||||
| 130 | inline QQmlEnginePrivate* d_func() { return executed 16341040 times by 146 tests: reinterpret_cast<QQmlEnginePrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<QQmlEnginePrivate *>(qGetPtrHelper(d_ptr));Executed by:
executed 16341040 times by 146 tests: } inline const QQmlEnginePrivate* d_func() const { returnreturn reinterpret_cast<QQmlEnginePrivate *>(qGetPtrHelper(d_ptr));Executed by:
executed 4173 times by 96 tests: reinterpret_cast<const QQmlEnginePrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<const QQmlEnginePrivate *>(qGetPtrHelper(d_ptr));Executed by:
executed 4173 times by 96 tests: } friend class QQmlEnginePrivate;return reinterpret_cast<const QQmlEnginePrivate *>(qGetPtrHelper(d_ptr));Executed by:
| 4173-16341040 | ||||||
| 131 | }; | - | ||||||
| 132 | - | |||||||
| 133 | template<> | - | ||||||
| 134 | __attribute__((visibility("default"))) QJSValue QQmlEngine::singletonInstance<QJSValue>(int qmlTypeId); | - | ||||||
| 135 | - | |||||||
| 136 | template<typename T> | - | ||||||
| 137 | T QQmlEngine::singletonInstance(int qmlTypeId) { | - | ||||||
| 138 | QJSValue instance = singletonInstance<QJSValue>(qmlTypeId); | - | ||||||
| 139 | if (!instance.isQObject()
| 0 | ||||||
| 140 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||
| 141 | - | |||||||
| 142 | QObject *object = instance.toQObject(); | - | ||||||
| 143 | return never executed: qobject_cast<T>(object);return qobject_cast<T>(object);never executed: return qobject_cast<T>(object); | 0 | ||||||
| 144 | } | - | ||||||
| 145 | - | |||||||
| 146 | - | |||||||
| Switch to Source code | Preprocessed file |