#ifndef QTMVVM_BINDING_P_H #define QTMVVM_BINDING_P_H #include #include #include "qtmvvmcore_global.h" #include "binding.h" namespace QtMvvm { class BindingPrivate : public QObject { friend class QtMvvm::Binding; Q_OBJECT public: static Binding bind(QObject *viewModel, QMetaProperty viewModelProperty, QObject *view, QMetaProperty viewProperty, Binding::BindingDirection type, QMetaMethod viewModelChangeSignal, QMetaMethod viewChangeSignal); private Q_SLOTS: void viewModelTrigger(); void viewTrigger(); private: BindingPrivate(QObject *viewModel, QMetaProperty viewModelProperty, QObject *view, QMetaProperty viewProperty); void init(); void bindFrom(QMetaMethod changeSignal); void bindTo(QMetaMethod changeSignal); QPointer viewModel; QPointer view; QMetaProperty viewModelProperty; QMetaProperty viewProperty; void testReadable(const QMetaProperty &property, bool asView) const; void testWritable(const QMetaProperty &property, bool asView) const; void testNotifier(const QMetaProperty &property, bool asView) const; }; } #endif // QTMVVM_BINDING_P_H