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
qqmlconfigurabledebugservice_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
5#ifndef QQMLCONFIGURABLEDEBUGSEVICE_P_H
6#define QQMLCONFIGURABLEDEBUGSEVICE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "qqmldebugservice_p.h"
21
22#include <QtCore/qmutex.h>
23
25
26template <class Base>
28{
29protected:
30 QQmlConfigurableDebugService(float version, QObject *parent = nullptr) :
31 Base(version, parent)
32 {
33 init();
34 }
35
37 {
40 for (QJSEngine *engine : std::as_const(m_waitingEngines))
41 Q_EMIT Base::attachedToEngine(engine);
43 }
44
45 void init()
46 {
48 // If we're not enabled or not blocking, don't wait for configuration
50 QQmlDebugConnector::instance()->blockingMode());
51 }
52
54 {
57 else
58 init();
59 }
60
62 {
66 else
67 Q_EMIT Base::attachedToEngine(engine);
68 }
69
71 QList<QJSEngine *> m_waitingEngines;
73};
74
76
77#endif // QQMLCONFIGURABLEDEBUGSEVICE_P_H
The QJSEngine class provides an environment for evaluating JavaScript code.
Definition qjsengine.h:26
void append(parameter_type t)
Definition qlist.h:458
void clear()
Definition qlist.h:434
\inmodule QtCore
Definition qmutex.h:313
\inmodule QtCore
Definition qobject.h:103
void stateChanged(QQmlDebugService::State newState) override
QQmlConfigurableDebugService(float version, QObject *parent=nullptr)
void engineAboutToBeAdded(QJSEngine *engine) override
static QQmlDebugConnector * instance()
\inmodule QtCore
Definition qmutex.h:309
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
#define Q_EMIT
QReadWriteLock lock
[0]
QJSEngine engine
[0]