| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlglobal_p.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | /**************************************************************************** | - | ||||||||||||
| 2 | ** | - | ||||||||||||
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - | ||||||||||||
| 4 | ** Contact: https://www.qt.io/licensing/ | - | ||||||||||||
| 5 | ** | - | ||||||||||||
| 6 | ** This file is part of the QtQml module of the Qt Toolkit. | - | ||||||||||||
| 7 | ** | - | ||||||||||||
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - | ||||||||||||
| 9 | ** Commercial License Usage | - | ||||||||||||
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||||||||
| 11 | ** accordance with the commercial license agreement provided with the | - | ||||||||||||
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||||||||
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||||||||
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - | ||||||||||||
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | - | ||||||||||||
| 16 | ** | - | ||||||||||||
| 17 | ** GNU Lesser General Public License Usage | - | ||||||||||||
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||||||||
| 19 | ** General Public License version 3 as published by the Free Software | - | ||||||||||||
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - | ||||||||||||
| 21 | ** packaging of this file. Please review the following information to | - | ||||||||||||
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - | ||||||||||||
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - | ||||||||||||
| 24 | ** | - | ||||||||||||
| 25 | ** GNU General Public License Usage | - | ||||||||||||
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - | ||||||||||||
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - | ||||||||||||
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - | ||||||||||||
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - | ||||||||||||
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - | ||||||||||||
| 31 | ** included in the packaging of this file. Please review the following | - | ||||||||||||
| 32 | ** information to ensure the GNU General Public License requirements will | - | ||||||||||||
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - | ||||||||||||
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - | ||||||||||||
| 35 | ** | - | ||||||||||||
| 36 | ** $QT_END_LICENSE$ | - | ||||||||||||
| 37 | ** | - | ||||||||||||
| 38 | ****************************************************************************/ | - | ||||||||||||
| 39 | - | |||||||||||||
| 40 | #ifndef QQMLGLOBAL_H | - | ||||||||||||
| 41 | #define QQMLGLOBAL_H | - | ||||||||||||
| 42 | - | |||||||||||||
| 43 | // | - | ||||||||||||
| 44 | // W A R N I N G | - | ||||||||||||
| 45 | // ------------- | - | ||||||||||||
| 46 | // | - | ||||||||||||
| 47 | // This file is not part of the Qt API. It exists purely as an | - | ||||||||||||
| 48 | // implementation detail. This header file may change from version to | - | ||||||||||||
| 49 | // version without notice, or even be removed. | - | ||||||||||||
| 50 | // | - | ||||||||||||
| 51 | // We mean it. | - | ||||||||||||
| 52 | // | - | ||||||||||||
| 53 | - | |||||||||||||
| 54 | #include <private/qtqmlglobal_p.h> | - | ||||||||||||
| 55 | #include <QtCore/QObject> | - | ||||||||||||
| 56 | #include <private/qqmlpropertycache_p.h> | - | ||||||||||||
| 57 | #include <private/qmetaobject_p.h> | - | ||||||||||||
| 58 | #include <private/qv8engine_p.h> | - | ||||||||||||
| 59 | - | |||||||||||||
| 60 | QT_BEGIN_NAMESPACE | - | ||||||||||||
| 61 | - | |||||||||||||
| 62 | - | |||||||||||||
| 63 | #define DEFINE_BOOL_CONFIG_OPTION(name, var) \ | - | ||||||||||||
| 64 | static bool name() \ | - | ||||||||||||
| 65 | { \ | - | ||||||||||||
| 66 | static enum { Yes, No, Unknown } status = Unknown; \ | - | ||||||||||||
| 67 | if (status == Unknown) { \ | - | ||||||||||||
| 68 | status = No; \ | - | ||||||||||||
| 69 | if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty(#var))) { \ | - | ||||||||||||
| 70 | const QByteArray v = qgetenv(#var); \ | - | ||||||||||||
| 71 | if (v != "0" && v != "false") \ | - | ||||||||||||
| 72 | status = Yes; \ | - | ||||||||||||
| 73 | } \ | - | ||||||||||||
| 74 | } \ | - | ||||||||||||
| 75 | return status == Yes; \ | - | ||||||||||||
| 76 | } | - | ||||||||||||
| 77 | - | |||||||||||||
| 78 | /*! | - | ||||||||||||
| 79 | Connect \a Signal of \a Sender to \a Method of \a Receiver. \a Signal must be | - | ||||||||||||
| 80 | of type \a SenderType and \a Receiver of type \a ReceiverType. | - | ||||||||||||
| 81 | - | |||||||||||||
| 82 | Unlike QObject::connect(), this method caches the lookup of the signal and method | - | ||||||||||||
| 83 | indexes. It also does not require lazy QMetaObjects to be built so should be | - | ||||||||||||
| 84 | preferred in all QML code that might interact with QML built objects. | - | ||||||||||||
| 85 | - | |||||||||||||
| 86 | \code | - | ||||||||||||
| 87 | QQuickTextControl *control; | - | ||||||||||||
| 88 | QQuickTextEdit *textEdit; | - | ||||||||||||
| 89 | qmlobject_connect(control, QQuickTextControl, SIGNAL(updateRequest(QRectF)), | - | ||||||||||||
| 90 | textEdit, QQuickTextEdit, SLOT(updateDocument())); | - | ||||||||||||
| 91 | \endcode | - | ||||||||||||
| 92 | */ | - | ||||||||||||
| 93 | #define qmlobject_connect(Sender, SenderType, Signal, Receiver, ReceiverType, Method) \ | - | ||||||||||||
| 94 | { \ | - | ||||||||||||
| 95 | SenderType *sender = (Sender); \ | - | ||||||||||||
| 96 | ReceiverType *receiver = (Receiver); \ | - | ||||||||||||
| 97 | const char *signal = (Signal); \ | - | ||||||||||||
| 98 | const char *method = (Method); \ | - | ||||||||||||
| 99 | static int signalIdx = -1; \ | - | ||||||||||||
| 100 | static int methodIdx = -1; \ | - | ||||||||||||
| 101 | if (signalIdx < 0) { \ | - | ||||||||||||
| 102 | Q_ASSERT(((int)(*signal) - '0') == QSIGNAL_CODE); \ | - | ||||||||||||
| 103 | signalIdx = SenderType::staticMetaObject.indexOfSignal(signal+1); \ | - | ||||||||||||
| 104 | } \ | - | ||||||||||||
| 105 | if (methodIdx < 0) { \ | - | ||||||||||||
| 106 | int code = ((int)(*method) - '0'); \ | - | ||||||||||||
| 107 | Q_ASSERT(code == QSLOT_CODE || code == QSIGNAL_CODE); \ | - | ||||||||||||
| 108 | if (code == QSLOT_CODE) \ | - | ||||||||||||
| 109 | methodIdx = ReceiverType::staticMetaObject.indexOfSlot(method+1); \ | - | ||||||||||||
| 110 | else \ | - | ||||||||||||
| 111 | methodIdx = ReceiverType::staticMetaObject.indexOfSignal(method+1); \ | - | ||||||||||||
| 112 | } \ | - | ||||||||||||
| 113 | Q_ASSERT(signalIdx != -1 && methodIdx != -1); \ | - | ||||||||||||
| 114 | QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); \ | - | ||||||||||||
| 115 | } | - | ||||||||||||
| 116 | - | |||||||||||||
| 117 | /*! | - | ||||||||||||
| 118 | Disconnect \a Signal of \a Sender from \a Method of \a Receiver. \a Signal must be | - | ||||||||||||
| 119 | of type \a SenderType and \a Receiver of type \a ReceiverType. | - | ||||||||||||
| 120 | - | |||||||||||||
| 121 | Unlike QObject::disconnect(), this method caches the lookup of the signal and method | - | ||||||||||||
| 122 | indexes. It also does not require lazy QMetaObjects to be built so should be | - | ||||||||||||
| 123 | preferred in all QML code that might interact with QML built objects. | - | ||||||||||||
| 124 | - | |||||||||||||
| 125 | \code | - | ||||||||||||
| 126 | QQuickTextControl *control; | - | ||||||||||||
| 127 | QQuickTextEdit *textEdit; | - | ||||||||||||
| 128 | qmlobject_disconnect(control, QQuickTextControl, SIGNAL(updateRequest(QRectF)), | - | ||||||||||||
| 129 | textEdit, QQuickTextEdit, SLOT(updateDocument())); | - | ||||||||||||
| 130 | \endcode | - | ||||||||||||
| 131 | */ | - | ||||||||||||
| 132 | #define qmlobject_disconnect(Sender, SenderType, Signal, Receiver, ReceiverType, Method) \ | - | ||||||||||||
| 133 | { \ | - | ||||||||||||
| 134 | SenderType *sender = (Sender); \ | - | ||||||||||||
| 135 | ReceiverType *receiver = (Receiver); \ | - | ||||||||||||
| 136 | const char *signal = (Signal); \ | - | ||||||||||||
| 137 | const char *method = (Method); \ | - | ||||||||||||
| 138 | static int signalIdx = -1; \ | - | ||||||||||||
| 139 | static int methodIdx = -1; \ | - | ||||||||||||
| 140 | if (signalIdx < 0) { \ | - | ||||||||||||
| 141 | Q_ASSERT(((int)(*signal) - '0') == QSIGNAL_CODE); \ | - | ||||||||||||
| 142 | signalIdx = SenderType::staticMetaObject.indexOfSignal(signal+1); \ | - | ||||||||||||
| 143 | } \ | - | ||||||||||||
| 144 | if (methodIdx < 0) { \ | - | ||||||||||||
| 145 | int code = ((int)(*method) - '0'); \ | - | ||||||||||||
| 146 | Q_ASSERT(code == QSLOT_CODE || code == QSIGNAL_CODE); \ | - | ||||||||||||
| 147 | if (code == QSLOT_CODE) \ | - | ||||||||||||
| 148 | methodIdx = ReceiverType::staticMetaObject.indexOfSlot(method+1); \ | - | ||||||||||||
| 149 | else \ | - | ||||||||||||
| 150 | methodIdx = ReceiverType::staticMetaObject.indexOfSignal(method+1); \ | - | ||||||||||||
| 151 | } \ | - | ||||||||||||
| 152 | Q_ASSERT(signalIdx != -1 && methodIdx != -1); \ | - | ||||||||||||
| 153 | QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); \ | - | ||||||||||||
| 154 | } | - | ||||||||||||
| 155 | - | |||||||||||||
| 156 | /*! | - | ||||||||||||
| 157 | This method is identical to qobject_cast<T>() except that it does not require lazy | - | ||||||||||||
| 158 | QMetaObjects to be built, so should be preferred in all QML code that might interact | - | ||||||||||||
| 159 | with QML built objects. | - | ||||||||||||
| 160 | - | |||||||||||||
| 161 | \code | - | ||||||||||||
| 162 | QObject *object; | - | ||||||||||||
| 163 | if (QQuickTextEdit *textEdit = qmlobject_cast<QQuickTextEdit *>(object)) { | - | ||||||||||||
| 164 | // ...Do something... | - | ||||||||||||
| 165 | } | - | ||||||||||||
| 166 | \endcode | - | ||||||||||||
| 167 | */ | - | ||||||||||||
| 168 | template<class T> | - | ||||||||||||
| 169 | T qmlobject_cast(QObject *object) | - | ||||||||||||
| 170 | { | - | ||||||||||||
| 171 | if (object && QQmlMetaObject::canConvert(object, &reinterpret_cast<T>(object)->staticMetaObject))
| 3676-899747 | ||||||||||||
| 172 | return static_cast<T>(object); executed 703048 times by 99 tests: return static_cast<T>(object);Executed by:
| 703048 | ||||||||||||
| 173 | else | - | ||||||||||||
| 174 | return 0; executed 200375 times by 75 tests: return 0;Executed by:
| 200375 | ||||||||||||
| 175 | } | - | ||||||||||||
| 176 | - | |||||||||||||
| 177 | inline quint16 qmlSourceCoordinate(int n) | - | ||||||||||||
| 178 | { | - | ||||||||||||
| 179 | return (n > 0 && n <= static_cast<int>(USHRT_MAX)) ? static_cast<quint16>(n) : 0; executed 3280 times by 53 tests: return (n > 0 && n <= static_cast<int>( (0x7fff * 2 + 1) )) ? static_cast<quint16>(n) : 0;Executed by:
| 3280 | ||||||||||||
| 180 | } | - | ||||||||||||
| 181 | - | |||||||||||||
| 182 | inline int qmlSourceCoordinate(quint16 n) | - | ||||||||||||
| 183 | { | - | ||||||||||||
| 184 | return (n == 0) ? -1 : static_cast<int>(n); executed 4785 times by 53 tests: return (n == 0) ? -1 : static_cast<int>(n);Executed by:
| 4785 | ||||||||||||
| 185 | } | - | ||||||||||||
| 186 | - | |||||||||||||
| 187 | #define IS_SIGNAL_CONNECTED(Sender, SenderType, Name, Arguments) \ | - | ||||||||||||
| 188 | do { \ | - | ||||||||||||
| 189 | QObject *sender = (Sender); \ | - | ||||||||||||
| 190 | void (SenderType::*signal)Arguments = &SenderType::Name; \ | - | ||||||||||||
| 191 | static QMetaMethod method = QMetaMethod::fromSignal(signal); \ | - | ||||||||||||
| 192 | static int signalIdx = QMetaObjectPrivate::signalIndex(method); \ | - | ||||||||||||
| 193 | return QObjectPrivate::get(sender)->isSignalConnected(signalIdx); \ | - | ||||||||||||
| 194 | } while (0) | - | ||||||||||||
| 195 | - | |||||||||||||
| 196 | /*! | - | ||||||||||||
| 197 | Returns true if the case of \a fileName is equivalent to the file case of | - | ||||||||||||
| 198 | \a fileName on disk, and false otherwise. | - | ||||||||||||
| 199 | - | |||||||||||||
| 200 | This is used to ensure that the behavior of QML on a case-insensitive file | - | ||||||||||||
| 201 | system is the same as on a case-sensitive file system. This function | - | ||||||||||||
| 202 | performs a "best effort" attempt to determine the real case of the file. | - | ||||||||||||
| 203 | It may have false positives (say the case is correct when it isn't), but it | - | ||||||||||||
| 204 | should never have a false negative (say the case is incorrect when it is | - | ||||||||||||
| 205 | correct). | - | ||||||||||||
| 206 | - | |||||||||||||
| 207 | Length specifies specifies the number of characters to be checked from | - | ||||||||||||
| 208 | behind. That is, if a file name results from a relative path specification | - | ||||||||||||
| 209 | like "foo/bar.qml" and is made absolute, the original length (11) should | - | ||||||||||||
| 210 | be passed indicating that only the last part of the relative path should | - | ||||||||||||
| 211 | be checked. | - | ||||||||||||
| 212 | - | |||||||||||||
| 213 | */ | - | ||||||||||||
| 214 | bool QQml_isFileCaseCorrect(const QString &fileName, int length = -1); | - | ||||||||||||
| 215 | - | |||||||||||||
| 216 | /*! | - | ||||||||||||
| 217 | Makes the \a object a child of \a parent. Note that when using this method, | - | ||||||||||||
| 218 | neither \a parent nor the object's previous parent (if it had one) will | - | ||||||||||||
| 219 | receive ChildRemoved or ChildAdded events. | - | ||||||||||||
| 220 | */ | - | ||||||||||||
| 221 | inline void QQml_setParent_noEvent(QObject *object, QObject *parent) | - | ||||||||||||
| 222 | { | - | ||||||||||||
| 223 | QObjectPrivate *d_ptr = QObjectPrivate::get(object); | - | ||||||||||||
| 224 | bool sce = d_ptr->sendChildEvents; | - | ||||||||||||
| 225 | d_ptr->sendChildEvents = false; | - | ||||||||||||
| 226 | object->setParent(parent); | - | ||||||||||||
| 227 | d_ptr->sendChildEvents = sce; | - | ||||||||||||
| 228 | } executed 437763 times by 131 tests: end of blockExecuted by:
| 437763 | ||||||||||||
| 229 | - | |||||||||||||
| 230 | class Q_QML_PRIVATE_EXPORT QQmlValueTypeProvider | - | ||||||||||||
| 231 | { | - | ||||||||||||
| 232 | public: | - | ||||||||||||
| 233 | QQmlValueTypeProvider(); | - | ||||||||||||
| 234 | virtual ~QQmlValueTypeProvider(); | - | ||||||||||||
| 235 | - | |||||||||||||
| 236 | const QMetaObject *metaObjectForMetaType(int); | - | ||||||||||||
| 237 | - | |||||||||||||
| 238 | bool initValueType(int, QVariant&); | - | ||||||||||||
| 239 | - | |||||||||||||
| 240 | QVariant createValueType(int, int, const void *[]); | - | ||||||||||||
| 241 | bool createValueFromString(int, const QString &, void *, size_t); | - | ||||||||||||
| 242 | bool createStringFromValue(int, const void *, QString *); | - | ||||||||||||
| 243 | - | |||||||||||||
| 244 | QVariant createVariantFromString(const QString &); | - | ||||||||||||
| 245 | QVariant createVariantFromString(int, const QString &, bool *); | - | ||||||||||||
| 246 | QVariant createVariantFromJsObject(int, QQmlV4Handle, QV4::ExecutionEngine *, bool*); | - | ||||||||||||
| 247 | - | |||||||||||||
| 248 | bool equalValueType(int, const void *, const QVariant&); | - | ||||||||||||
| 249 | bool storeValueType(int, const void *, void *, size_t); | - | ||||||||||||
| 250 | bool readValueType(const QVariant&, void *, int); | - | ||||||||||||
| 251 | bool writeValueType(int, const void *, QVariant&); | - | ||||||||||||
| 252 | - | |||||||||||||
| 253 | private: | - | ||||||||||||
| 254 | virtual const QMetaObject *getMetaObjectForMetaType(int); | - | ||||||||||||
| 255 | virtual bool init(int, QVariant&); | - | ||||||||||||
| 256 | - | |||||||||||||
| 257 | virtual bool create(int, int, const void *[], QVariant *); | - | ||||||||||||
| 258 | virtual bool createFromString(int, const QString &, void *, size_t); | - | ||||||||||||
| 259 | virtual bool createStringFrom(int, const void *, QString *); | - | ||||||||||||
| 260 | - | |||||||||||||
| 261 | virtual bool variantFromString(const QString &, QVariant *); | - | ||||||||||||
| 262 | virtual bool variantFromString(int, const QString &, QVariant *); | - | ||||||||||||
| 263 | virtual bool variantFromJsObject(int, QQmlV4Handle, QV4::ExecutionEngine *, QVariant *); | - | ||||||||||||
| 264 | - | |||||||||||||
| 265 | virtual bool equal(int, const void *, const QVariant&); | - | ||||||||||||
| 266 | virtual bool store(int, const void *, void *, size_t); | - | ||||||||||||
| 267 | virtual bool read(const QVariant&, void *, int); | - | ||||||||||||
| 268 | virtual bool write(int, const void *, QVariant&); | - | ||||||||||||
| 269 | - | |||||||||||||
| 270 | friend Q_QML_PRIVATE_EXPORT void QQml_addValueTypeProvider(QQmlValueTypeProvider *); | - | ||||||||||||
| 271 | friend Q_QML_PRIVATE_EXPORT void QQml_removeValueTypeProvider(QQmlValueTypeProvider *); | - | ||||||||||||
| 272 | - | |||||||||||||
| 273 | QQmlValueTypeProvider *next; | - | ||||||||||||
| 274 | }; | - | ||||||||||||
| 275 | - | |||||||||||||
| 276 | Q_QML_PRIVATE_EXPORT void QQml_addValueTypeProvider(QQmlValueTypeProvider *); | - | ||||||||||||
| 277 | Q_AUTOTEST_EXPORT QQmlValueTypeProvider *QQml_valueTypeProvider(); | - | ||||||||||||
| 278 | - | |||||||||||||
| 279 | - | |||||||||||||
| 280 | class Q_QML_PRIVATE_EXPORT QQmlColorProvider | - | ||||||||||||
| 281 | { | - | ||||||||||||
| 282 | public: | - | ||||||||||||
| 283 | virtual ~QQmlColorProvider(); | - | ||||||||||||
| 284 | virtual QVariant colorFromString(const QString &, bool *); | - | ||||||||||||
| 285 | virtual unsigned rgbaFromString(const QString &, bool *); | - | ||||||||||||
| 286 | - | |||||||||||||
| 287 | virtual QVariant fromRgbF(double, double, double, double); | - | ||||||||||||
| 288 | virtual QVariant fromHslF(double, double, double, double); | - | ||||||||||||
| 289 | virtual QVariant fromHsvF(double, double, double, double); | - | ||||||||||||
| 290 | virtual QVariant lighter(const QVariant &, qreal); | - | ||||||||||||
| 291 | virtual QVariant darker(const QVariant &, qreal); | - | ||||||||||||
| 292 | virtual QVariant tint(const QVariant &, const QVariant &); | - | ||||||||||||
| 293 | }; | - | ||||||||||||
| 294 | - | |||||||||||||
| 295 | Q_QML_PRIVATE_EXPORT QQmlColorProvider *QQml_setColorProvider(QQmlColorProvider *); | - | ||||||||||||
| 296 | Q_QML_PRIVATE_EXPORT QQmlColorProvider *QQml_colorProvider(); | - | ||||||||||||
| 297 | - | |||||||||||||
| 298 | - | |||||||||||||
| 299 | class Q_QML_PRIVATE_EXPORT QQmlGuiProvider | - | ||||||||||||
| 300 | { | - | ||||||||||||
| 301 | public: | - | ||||||||||||
| 302 | virtual ~QQmlGuiProvider(); | - | ||||||||||||
| 303 | virtual QObject *application(QObject *parent); | - | ||||||||||||
| 304 | virtual QObject *inputMethod(); | - | ||||||||||||
| 305 | virtual QObject *styleHints(); | - | ||||||||||||
| 306 | virtual QStringList fontFamilies(); | - | ||||||||||||
| 307 | virtual bool openUrlExternally(QUrl &); | - | ||||||||||||
| 308 | virtual QString pluginName() const; | - | ||||||||||||
| 309 | }; | - | ||||||||||||
| 310 | - | |||||||||||||
| 311 | Q_QML_PRIVATE_EXPORT QQmlGuiProvider *QQml_setGuiProvider(QQmlGuiProvider *); | - | ||||||||||||
| 312 | Q_AUTOTEST_EXPORT QQmlGuiProvider *QQml_guiProvider(); | - | ||||||||||||
| 313 | - | |||||||||||||
| 314 | class QQmlApplicationPrivate; | - | ||||||||||||
| 315 | - | |||||||||||||
| 316 | class Q_QML_PRIVATE_EXPORT QQmlApplication : public QObject | - | ||||||||||||
| 317 | { | - | ||||||||||||
| 318 | //Application level logic, subclassed by Qt Quick if available via QQmlGuiProvider | - | ||||||||||||
| 319 | Q_OBJECT | - | ||||||||||||
| 320 | Q_PROPERTY(QStringList arguments READ args CONSTANT) | - | ||||||||||||
| 321 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) | - | ||||||||||||
| 322 | Q_PROPERTY(QString version READ version WRITE setVersion NOTIFY versionChanged) | - | ||||||||||||
| 323 | Q_PROPERTY(QString organization READ organization WRITE setOrganization NOTIFY organizationChanged) | - | ||||||||||||
| 324 | Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged) | - | ||||||||||||
| 325 | public: | - | ||||||||||||
| 326 | QQmlApplication(QObject* parent=nullptr); | - | ||||||||||||
| 327 | - | |||||||||||||
| 328 | QStringList args(); | - | ||||||||||||
| 329 | - | |||||||||||||
| 330 | QString name() const; | - | ||||||||||||
| 331 | QString version() const; | - | ||||||||||||
| 332 | QString organization() const; | - | ||||||||||||
| 333 | QString domain() const; | - | ||||||||||||
| 334 | - | |||||||||||||
| 335 | public Q_SLOTS: | - | ||||||||||||
| 336 | void setName(const QString &arg); | - | ||||||||||||
| 337 | void setVersion(const QString &arg); | - | ||||||||||||
| 338 | void setOrganization(const QString &arg); | - | ||||||||||||
| 339 | void setDomain(const QString &arg); | - | ||||||||||||
| 340 | - | |||||||||||||
| 341 | Q_SIGNALS: | - | ||||||||||||
| 342 | void aboutToQuit(); | - | ||||||||||||
| 343 | - | |||||||||||||
| 344 | void nameChanged(); | - | ||||||||||||
| 345 | void versionChanged(); | - | ||||||||||||
| 346 | void organizationChanged(); | - | ||||||||||||
| 347 | void domainChanged(); | - | ||||||||||||
| 348 | - | |||||||||||||
| 349 | protected: | - | ||||||||||||
| 350 | QQmlApplication(QQmlApplicationPrivate &dd, QObject* parent=nullptr); | - | ||||||||||||
| 351 | - | |||||||||||||
| 352 | private: | - | ||||||||||||
| 353 | Q_DISABLE_COPY(QQmlApplication) | - | ||||||||||||
| 354 | Q_DECLARE_PRIVATE(QQmlApplication) executed 10 times by 2 tests: return reinterpret_cast<QQmlApplicationPrivate *>(qGetPtrHelper(d_ptr));Executed by:
never executed: return reinterpret_cast<const QQmlApplicationPrivate *>(qGetPtrHelper(d_ptr)); | 0-10 | ||||||||||||
| 355 | }; | - | ||||||||||||
| 356 | - | |||||||||||||
| 357 | class QQmlApplicationPrivate : public QObjectPrivate | - | ||||||||||||
| 358 | { | - | ||||||||||||
| 359 | Q_DECLARE_PUBLIC(QQmlApplication) | - | ||||||||||||
| 360 | public: | - | ||||||||||||
| 361 | QQmlApplicationPrivate() { | - | ||||||||||||
| 362 | argsInit = false; | - | ||||||||||||
| 363 | } executed 18 times by 6 tests: end of blockExecuted by:
| 18 | ||||||||||||
| 364 | - | |||||||||||||
| 365 | bool argsInit; | - | ||||||||||||
| 366 | QStringList args; | - | ||||||||||||
| 367 | }; | - | ||||||||||||
| 368 | - | |||||||||||||
| 369 | struct QQmlSourceLocation | - | ||||||||||||
| 370 | { | - | ||||||||||||
| 371 | QQmlSourceLocation() {} | - | ||||||||||||
| 372 | QQmlSourceLocation(const QString &sourceFile, quint16 line, quint16 column) | - | ||||||||||||
| 373 | : sourceFile(sourceFile), line(line), column(column) {} executed 98 times by 8 tests: end of blockExecuted by:
| 98 | ||||||||||||
| 374 | QString sourceFile; | - | ||||||||||||
| 375 | quint16 line = 0; | - | ||||||||||||
| 376 | quint16 column = 0; | - | ||||||||||||
| 377 | }; | - | ||||||||||||
| 378 | - | |||||||||||||
| 379 | QT_END_NAMESPACE | - | ||||||||||||
| 380 | - | |||||||||||||
| 381 | #endif // QQMLGLOBAL_H | - | ||||||||||||
| Source code | Switch to Preprocessed file |