5#ifndef QQMLSYNCHRONIZER_P_H
6#define QQMLSYNCHRONIZER_P_H
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>
24#include <QtLabsSynchronizer/qtlabssynchronizerexports.h>
28class QQmlSynchronizerPrivate;
30 :
public QObject,
public QQmlPropertyValueSource,
public QQmlFinalizerHook
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)
46 QQmlSynchronizer(QObject *parent =
nullptr);
48 QObject *sourceObject()
const;
49 void setSourceObject(QObject *object);
51 QString sourceProperty()
const;
52 void setSourceProperty(
const QString &property);
54 QObject *targetObject()
const;
55 void setTargetObject(QObject *object);
57 QString targetProperty()
const;
58 void setTargetProperty(
const QString &property);
61 void sourceObjectChanged();
62 void sourcePropertyChanged();
63 void targetObjectChanged();
64 void targetPropertyChanged();
66 void valueBounced(QObject *object,
const QString &property);
67 void valueIgnored(QObject *object,
const QString &property);
70 void setTarget(
const QQmlProperty &target) final;
71 void componentFinalized() final;
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
OwnedTarget sourceObjectProperty
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)
bool isComponentFinalized
OwnedTarget targetObjectProperty
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
~QQmlSynchronizerSlotObject()
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
QPointer< QObject > object
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