diff options
Diffstat (limited to 'src/qmlworkerscript/qquickworkerscript.cpp')
| -rw-r--r-- | src/qmlworkerscript/qquickworkerscript.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qmlworkerscript/qquickworkerscript.cpp b/src/qmlworkerscript/qquickworkerscript.cpp index d42742d6f5..72ae6d5bd4 100644 --- a/src/qmlworkerscript/qquickworkerscript.cpp +++ b/src/qmlworkerscript/qquickworkerscript.cpp @@ -544,6 +544,17 @@ void QQuickWorkerScript::setSource(const QUrl &source) } /*! + \qmlproperty url WorkerScript::ready + + This holds whether the WorkerScript has been initialized and is ready + for receiving messages via \tt WorkerScript.sendMessage(). +*/ +bool QQuickWorkerScript::ready() const +{ + return m_engine != nullptr; +} + +/*! \qmlmethod WorkerScript::sendMessage(jsobject message) Sends the given \a message to a worker script handler in another @@ -603,6 +614,8 @@ QQuickWorkerScriptEngine *QQuickWorkerScript::engine() if (m_source.isValid()) m_engine->executeUrl(m_scriptId, m_source); + emit readyChanged(); + return m_engine; } return nullptr; |
