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
qqmlsynchronizer_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 reason:default
4
5#ifndef QQMLSYNCHRONIZER_P_H
6#define QQMLSYNCHRONIZER_P_H
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 <QtQml/private/qqmlfinalizer_p.h>
19#include <QtQml/qqmlpropertyvaluesource.h>
20#include <QtQmlMeta/qtqmlmetaexports.h>
21#include <QtQmlIntegration/qqmlintegration.h>
22#include <QtCore/qobject.h>
23
24#include <QtLabsSynchronizer/qtlabssynchronizerexports.h>
25
26QT_BEGIN_NAMESPACE
27
28class QQmlSynchronizerPrivate;
29class Q_LABSSYNCHRONIZER_EXPORT QQmlSynchronizer
30 : public QObject, public QQmlPropertyValueSource, public QQmlFinalizerHook
31{
32 Q_OBJECT
33 Q_DECLARE_PRIVATE(QQmlSynchronizer)
34 Q_INTERFACES(QQmlPropertyValueSource QQmlFinalizerHook)
35 Q_PROPERTY(QObject *sourceObject READ sourceObject WRITE setSourceObject
36 NOTIFY sourceObjectChanged FINAL)
37 Q_PROPERTY(QString sourceProperty READ sourceProperty WRITE setSourceProperty
38 NOTIFY sourcePropertyChanged FINAL)
39 Q_PROPERTY(QObject *targetObject READ targetObject WRITE setTargetObject
40 NOTIFY targetObjectChanged FINAL)
41 Q_PROPERTY(QString targetProperty READ targetProperty WRITE setTargetProperty
42 NOTIFY targetPropertyChanged FINAL)
43 QML_NAMED_ELEMENT(Synchronizer)
44 QML_ADDED_IN_VERSION(6, 10)
45public:
46 QQmlSynchronizer(QObject *parent = nullptr);
47
48 QObject *sourceObject() const;
49 void setSourceObject(QObject *object);
50
51 QString sourceProperty() const;
52 void setSourceProperty(const QString &property);
53
54 QObject *targetObject() const;
55 void setTargetObject(QObject *object);
56
57 QString targetProperty() const;
58 void setTargetProperty(const QString &property);
59
60Q_SIGNALS:
61 void sourceObjectChanged();
62 void sourcePropertyChanged();
63 void targetObjectChanged();
64 void targetPropertyChanged();
65
66 void valueBounced(QObject *object, const QString &property);
67 void valueIgnored(QObject *object, const QString &property);
68
69protected:
70 void setTarget(const QQmlProperty &target) final;
71 void componentFinalized() final;
72};
73
74QT_END_NAMESPACE
75
76#endif // QQMLSYNCHRONIZER_P_H
QQmlSynchronizerChangeHandler(QQmlSynchronizerPrivate *receiver, const QQmlSynchronizerProperty &property)
QPropertyChangeHandler< QQmlSynchronizerHandler > createChangeHandler()
bool contains(const QQmlSynchronizerProperty &p) const
void write(QVariant value) const
QVariant coerce(const QVariant &source, QQmlSynchronizer *q) const
QQmlSynchronizerHandler(QQmlSynchronizerPrivate *receiver, const QQmlSynchronizerProperty &property)
QQmlSynchronizerProperty property() const
QQmlSynchronizerProperty connectObjectProperty(const QString &property, OwnedTarget *objectProperty, QQmlSynchronizer *q)
void initialize(QQmlSynchronizer *q)
void synchronize(const QQmlSynchronizerProperty &property)
std::vector< QQmlSynchronizerChangeHandler > changeHandlers
QQmlSynchronizerProperty connectTarget(QQmlSynchronizer *q)
static QQmlSynchronizerPrivate * get(QQmlSynchronizer *q)
std::vector< QQmlRefPointer< QQmlSynchronizerSlotObject > > slotObjects
void disconnectObjectProperty(const QString &property, OwnedTarget *objectProperty)
void createConnection(QQmlSynchronizer *q, const QQmlSynchronizerProperty &property)
\qmlsignal Qt.labs.synchronizer::Synchronizer::valueBounced(QtObject object, string property)
void write(QVariant value) const
QQmlSynchronizerProperty property() const
QVariant coerce(const QVariant &source, QQmlSynchronizer *q) const
bool contains(const QQmlSynchronizerProperty &p) const
static void impl(int which, QtPrivate::QSlotObjectBase *self, QObject *r, void **a, bool *ret)
QQmlSynchronizerSlotObject(QQmlSynchronizer *receiver, const QQmlSynchronizerProperty &property)
void operator()(QQmlSynchronizer *receiver)
static QVariant doReadProperty(QObject *object, const QQmlPropertyData *property)
std::unique_ptr< const QQmlPropertyData > core
std::unique_ptr< const QQmlPropertyData > auxiliary
QHash< QQmlSynchronizerProperty, Result > results
const QQmlPropertyData * valueTypeData() const
QQmlSynchronizerProperty()=default
QVariant coerce(const QVariant &source, QQmlSynchronizer *q) const
friend bool comparesEqual(const QQmlSynchronizerProperty &a, const QQmlSynchronizerProperty &b) noexcept
QQmlSynchronizerProperty(QObject *object, const QQmlPropertyData *core, const QQmlPropertyData *valueTypeData=nullptr)
void write(QVariant &&value) const
const QQmlPropertyData * core() const