Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickworkerscript_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKWORKERSCRIPT_P_H
5#define QQUICKWORKERSCRIPT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <qqml.h>
19
20#include <QtQmlWorkerScript/private/qtqmlworkerscriptglobal_p.h>
21#include <QtQml/qqmlparserstatus.h>
22#include <QtCore/qthread.h>
23#include <QtQml/qjsvalue.h>
24#include <QtCore/qurl.h>
25
27
28
32{
34public:
37
39 void removeWorkerScript(int);
40 void executeUrl(int, const QUrl &);
41 void sendMessage(int, const QByteArray &);
42
43protected:
44 void run() override;
45
46private:
48};
49
50class Q_QMLWORKERSCRIPT_EXPORT QQuickWorkerScript : public QObject, public QQmlParserStatus
51{
53 Q_DISABLE_COPY_MOVE(QQuickWorkerScript)
54 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
55 Q_PROPERTY(bool ready READ ready NOTIFY readyChanged REVISION(2, 15))
56
59
61public:
62 QQuickWorkerScript(QObject *parent = nullptr);
64
65 QUrl source() const;
66 void setSource(const QUrl &);
67
68 bool ready() const;
69
70public Q_SLOTS:
71 void sendMessage(QQmlV4FunctionPtr);
72
74 void sourceChanged();
75 Q_REVISION(2, 15) void readyChanged();
76 void message(const QJSValue &messageObject);
77
78protected:
79 void classBegin() override;
80 void componentComplete() override;
81 bool event(QEvent *) override;
82
86 int m_scriptId;
87 QUrl m_source;
88 bool m_componentComplete;
89};
90
92
93#endif // QQUICKWORKERSCRIPT_P_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qcoreevent.h:45
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QQmlEngine class provides an environment for instantiating QML components.
Definition qqmlengine.h:57
The QQmlParserStatus class provides updates on the QML parser state.
void executeUrl(int, const QUrl &)
QQuickWorkerScriptEngine(QQmlEngine *parent=nullptr)
void sendMessage(int, const QByteArray &)
int registerWorkerScript(QQuickWorkerScript *)
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
GLuint GLsizei const GLchar * message
GLsizei GLsizei GLchar * source
struct _cl_event * event
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_INTERFACES(x)
#define Q_SLOTS
#define Q_SIGNALS
QJSEngine engine
[0]