Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qjsengine_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 QJSENGINE_P_H
5#define QJSENGINE_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 <QtCore/private/qobject_p.h>
19#include <QtCore/qmutex.h>
20#include <QtCore/qproperty.h>
21#include "qjsengine.h"
22#include "private/qtqmlglobal_p.h"
23#include <private/qqmlmetatype_p.h>
24
26
27class QQmlPropertyCache;
28
29namespace QV4 {
30struct ExecutionEngine;
31}
32
33class Q_QML_EXPORT QJSEnginePrivate : public QObjectPrivate
34{
35 Q_DECLARE_PUBLIC(QJSEngine)
36
37public:
38 static QJSEnginePrivate *get(QJSEngine*e) { return e->d_func(); }
39 static const QJSEnginePrivate* get(const QJSEngine*e) { return e->d_func(); }
40 static QJSEngine *get(QJSEnginePrivate *e) { return e->q_func(); }
41 static const QJSEngine *get(const QJSEnginePrivate *e) { return e->q_func(); }
42 static QJSEnginePrivate *get(QV4::ExecutionEngine *e);
43
44 QJSEnginePrivate() = default;
45 ~QJSEnginePrivate() override;
46
47 static void addToDebugServer(QJSEngine *q);
48 static void removeFromDebugServer(QJSEngine *q);
49
50 void uiLanguageChanged()
51 {
52 Q_Q(QJSEngine);
53 if (q)
54 Q_EMIT q->uiLanguageChanged();
55 }
56 Q_OBJECT_BINDABLE_PROPERTY(QJSEnginePrivate, QString, uiLanguage, &QJSEnginePrivate::uiLanguageChanged);
57
58 std::unique_ptr<QV4::ExecutionEngine> v4Engine;
59};
60
61QT_END_NAMESPACE
62
63#endif // QJSENGINE_P_H
Definition qjsvalue.h:23