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
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
4#ifndef QQMLCONNECTIONS_H
5#define QQMLCONNECTIONS_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#include <private/qqmlcustomparser_p.h>
20
21#include <QtCore/qobject.h>
22#include <QtCore/qstring.h>
23
25
26class QQmlBoundSignal;
27class QQmlContext;
29class Q_QML_EXPORT QQmlConnections : public QObject, public QQmlParserStatus
30{
32 Q_DECLARE_PRIVATE(QQmlConnections)
33
35 Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
36 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged REVISION(2, 3))
37 Q_PROPERTY(bool ignoreUnknownSignals READ ignoreUnknownSignals WRITE setIgnoreUnknownSignals)
38 QML_NAMED_ELEMENT(Connections)
41
42public:
43 QQmlConnections(QObject *parent = nullptr);
45
46 QObject *target() const;
47 void setTarget(QObject *);
48
49 bool isEnabled() const;
50 void setEnabled(bool enabled);
51
52 bool ignoreUnknownSignals() const;
53 void setIgnoreUnknownSignals(bool ignore);
54
55protected:
56 void classBegin() override;
57 void componentComplete() override;
58
60 void targetChanged();
61 Q_REVISION(2, 3) void enabledChanged();
62
64 void connectSignals();
65 void connectSignalsToMethods();
66 void connectSignalsToBindings();
67};
68
69// TODO: Drop this class as soon as we can
71{
72public:
73 void verifyBindings(const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit, const QList<const QV4::CompiledData::Binding *> &props) override;
74 void applyBindings(QObject *object, const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override;
75};
76
77// TODO: We won't need Connections to be a custom type anymore once we can drop the
78// automatic signal handler inference from undeclared properties.
79template<>
84
86
87#endif
\inmodule QtCore
Definition qobject.h:103
The QQmlContext class defines a context within a QML engine.
Definition qqmlcontext.h:25
The QQmlCustomParser class allows you to add new arbitrary types to QML.
The QQmlParserStatus class provides updates on the QML parser state.
Combined button and popup list for selecting options.
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum target
GLenum GLuint GLsizei const GLenum * props
QQmlCustomParser * qmlCreateCustomParser< QQmlConnections >()
#define QML_NAMED_ELEMENT(NAME)
#define QML_CUSTOMPARSER
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_INTERFACES(x)
#define Q_SIGNALS