diff options
| author | Maximilian Goldstein <max.goldstein@qt.io> | 2019-12-06 10:56:22 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-12-06 14:32:16 +0000 |
| commit | 3c4247e1e021b6bcc480afc0716e0231575d0501 (patch) | |
| tree | 8f1f72b91e150b88e53e5b4ccac6a551e096220b /src/qmlworkerscript/qquickworkerscript_p.h | |
| parent | 8fadf5d374936e50b8bce5adb1f10da2f66eac2b (diff) | |
src/qmlworkerscript: Add ready property to WorkerScript
Previously it was impossible to determine whether a WorkerScript has
been fully initialized. This commit introduces a ready property that
allows outside Components to determine whether it is safe to send
signals.
Fixes: QTBUG-80413
Change-Id: I2a1892b5e759e317de791e71d79fbb0cbd320dd3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlworkerscript/qquickworkerscript_p.h')
| -rw-r--r-- | src/qmlworkerscript/qquickworkerscript_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qmlworkerscript/qquickworkerscript_p.h b/src/qmlworkerscript/qquickworkerscript_p.h index 9b5d3587fb..d1f686a78d 100644 --- a/src/qmlworkerscript/qquickworkerscript_p.h +++ b/src/qmlworkerscript/qquickworkerscript_p.h @@ -87,6 +87,8 @@ class Q_AUTOTEST_EXPORT QQuickWorkerScript : public QObject, public QQmlParserSt { Q_OBJECT Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) + Q_PROPERTY(bool ready READ ready NOTIFY readyChanged) + QML_NAMED_ELEMENT(WorkerScript); Q_INTERFACES(QQmlParserStatus) @@ -97,11 +99,14 @@ public: QUrl source() const; void setSource(const QUrl &); + bool ready() const; + public Q_SLOTS: void sendMessage(QQmlV4Function*); Q_SIGNALS: void sourceChanged(); + void readyChanged(); void message(const QJSValue &messageObject); protected: |
