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
qqmlconnections_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// Qt-Security score:significant
4
5#ifndef QQMLCONNECTIONS_H
6#define QQMLCONNECTIONS_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 <private/qqmlcustomparser_p.h>
20
21#include <QtQmlMeta/qtqmlmetaexports.h>
22#include <QtQml/qqml.h>
23
24#include <QtCore/qobject.h>
25#include <QtCore/qstring.h>
26
27QT_BEGIN_NAMESPACE
28
29class QQmlBoundSignal;
30class QQmlContext;
32class Q_QMLMETA_EXPORT QQmlConnections : public QObject, public QQmlParserStatus
33{
34 Q_OBJECT
35 Q_DECLARE_PRIVATE(QQmlConnections)
36
37 Q_INTERFACES(QQmlParserStatus)
38 Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
39 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged REVISION(2, 3))
40 Q_PROPERTY(bool ignoreUnknownSignals READ ignoreUnknownSignals WRITE setIgnoreUnknownSignals)
41 QML_NAMED_ELEMENT(Connections)
42 QML_ADDED_IN_VERSION(2, 0)
43 QML_CUSTOMPARSER
44
45public:
46 QQmlConnections(QObject *parent = nullptr);
47 ~QQmlConnections();
48
49 QObject *target() const;
50 void setTarget(QObject *);
51
52 bool isEnabled() const;
53 void setEnabled(bool enabled);
54
55 bool ignoreUnknownSignals() const;
56 void setIgnoreUnknownSignals(bool ignore);
57
58protected:
59 void classBegin() override;
60 void componentComplete() override;
61
62Q_SIGNALS:
63 void targetChanged();
64 Q_REVISION(2, 3) void enabledChanged();
65
66private:
67 void connectSignals();
68 void connectSignalsToMethods();
69 void connectSignalsToBindings();
70};
71
72// TODO: Drop this class as soon as we can
74{
75public:
76 void verifyBindings(
77 const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit,
78 const QList<const QV4::CompiledData::Binding *> &props) override;
79 void applyBindings(QObject *object, const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override;
80};
81
82// TODO: We won't need Connections to be a custom type anymore once we can drop the
83// automatic signal handler inference from undeclared properties.
84template<>
89
90QT_END_NAMESPACE
91
92#endif
QQmlBoundSignalDeleter(QQmlBoundSignal *signal)
void applyBindings(QObject *object, const QQmlRefPointer< QV4::ExecutableCompilationUnit > &compilationUnit, const QList< const QV4::CompiledData::Binding * > &bindings) override
void verifyBindings(const QQmlRefPointer< QV4::CompiledData::CompilationUnit > &compilationUnit, const QList< const QV4::CompiledData::Binding * > &props) override
QList< const QV4::CompiledData::Binding * > bindings
QQmlGuard< QObject > target
QList< QBiPointer< QQmlBoundSignal, QQmlConnectionSlotDispatcher > > boundsignals
QQmlRefPointer< QV4::ExecutableCompilationUnit > compilationUnit
QQmlCustomParser * qmlCreateCustomParser< QQmlConnections >()