1 #ifndef QTMVVM_BINDING_H 2 #define QTMVVM_BINDING_H 4 #include <QtCore/qobject.h> 5 #include <QtCore/qpointer.h> 6 #include <QtCore/qmetaobject.h> 8 #include "QtMvvmCore/qtmvvmcore_global.h" 22 OneWayToView = (0x02 | SingleInit),
23 OneWayToViewModel = 0x04,
24 TwoWay = (OneWayToView | OneWayToViewModel)
26 Q_DECLARE_FLAGS(BindingDirection, BindingDirectionFlag)
27 Q_FLAG(BindingDirection)
38 Q_INVOKABLE
void unbind();
45 Q_MVVMCORE_EXPORT Binding
bind(
QObject *viewModel,
const char *viewModelProperty,
46 QObject *view,
const char *viewProperty,
48 const char *viewModelChangeSignal =
nullptr,
49 const char *viewChangeSignal =
nullptr);
54 const char *viewModelChangeSignal =
nullptr,
55 const char *viewChangeSignal =
nullptr);
65 Q_DECLARE_OPERATORS_FOR_FLAGS(QtMvvm::Binding::BindingDirection)
67 #if defined(QT_BUILD_MVVMCORE_LIB) && defined(Q_MOC_RUN) 68 #include "binding_p.h" 71 #endif // QTMVVM_BINDING_H Q_MVVMCORE_EXPORT Binding bind(QObject *viewModel, const char *viewModelProperty, QObject *view, const char *viewProperty, Binding::BindingDirection type=Binding::TwoWay, const char *viewModelChangeSignal=nullptr, const char *viewChangeSignal=nullptr)
Create a multidirectional binding between properties.
A handle to a multidirectional binding between properties.
BindingDirectionFlag
Flags to control how to bind the properties.
All changes on both sides are propagated to the other one.
The primary namespace of the QtMvvm library.