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
qqmlboundsignal_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 QQMLBOUNDSIGNAL_P_H
5#define QQMLBOUNDSIGNAL_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/qmetaobject.h>
19
20#include <private/qqmljavascriptexpression_p.h>
21#include <private/qqmlnotifier_p.h>
22#include <private/qqmlrefcount_p.h>
23#include <private/qtqmlglobal_p.h>
24
26
27class Q_QML_EXPORT QQmlBoundSignalExpression final
29 public QQmlRefCounted<QQmlBoundSignalExpression>
30{
32public:
34 const QObject *target, int index, const QQmlRefPointer<QQmlContextData> &ctxt, QObject *scope,
35 const QString &expression, const QString &fileName, quint16 line, quint16 column,
36 const QString &handlerName = QString(), const QString &parameterString = QString());
37
39 const QObject *target, int index, const QQmlRefPointer<QQmlContextData> &ctxt,
40 QObject *scopeObject, QV4::Function *function, QV4::ExecutionContext *scope = nullptr);
41
42 // inherited from QQmlJavaScriptExpression.
43 QString expressionIdentifier() const override;
44 void expressionChanged() override;
45
46 // evaluation of a bound signal expression doesn't return any value
47 void evaluate(void **a);
48
49 bool mustCaptureBindableProperty() const final {return true;}
50
51 QString expression() const;
52 const QObject *target() const { return m_target; }
53
54private:
56
57 void init(const QQmlRefPointer<QQmlContextData> &ctxt, QObject *scope);
58
59 bool expressionFunctionValid() const { return function() != nullptr; }
60
61 int m_index;
62 const QObject *m_target;
63};
64
65class Q_QML_EXPORT QQmlBoundSignal : public QQmlNotifierEndpoint
66{
67public:
70
71 void removeFromObject();
72
73 QQmlBoundSignalExpression *expression() const;
74 void takeExpression(QQmlBoundSignalExpression *);
75
76 void setEnabled(bool enabled);
77
78private:
79 friend void QQmlBoundSignal_callback(QQmlNotifierEndpoint *, void **);
80 friend class QQmlPropertyPrivate;
81 friend class QQmlData;
83
84 void addToObject(QObject *owner);
85
86 QQmlBoundSignal **m_prevSignal;
87 QQmlBoundSignal *m_nextSignal;
88
89 bool m_enabled;
90
91 QQmlRefPointer<QQmlBoundSignalExpression> m_expression;
92};
93
95{
96public:
98
99private:
100 QQmlRefPointer<QQmlBoundSignalExpression> expression;
101};
102
104
105#endif // QQMLBOUNDSIGNAL_P_H
\inmodule QtCore
Definition qobject.h:103
QQmlBoundSignalExpression(const QObject *target, int index, const QQmlRefPointer< QQmlContextData > &ctxt, QObject *scope, const QString &expression, const QString &fileName, quint16 line, quint16 column, const QString &handlerName=QString(), const QString &parameterString=QString())
const QObject * target() const
bool mustCaptureBindableProperty() const final
The QQmlEngine class provides an environment for instantiating QML components.
Definition qqmlengine.h:57
QQmlPropertyObserver(QQmlBoundSignalExpression *expr)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
auto signal
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint index
[2]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum target
GLenum GLenum GLsizei void GLsizei void * column
void QQmlBoundSignal_callback(QQmlNotifierEndpoint *e, void **a)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
unsigned short quint16
Definition qtypes.h:48
engine evaluate("var myObject = new MyObject()")
[8]
QJSEngine engine
[0]