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)
37 operator bool()
const;
40 Q_INVOKABLE
void unbind();
47 Q_MVVMCORE_EXPORT Binding
bind(
QObject *viewModel,
const char *viewModelProperty,
48 QObject *view,
const char *viewProperty,
50 const char *viewModelChangeSignal =
nullptr,
51 const char *viewChangeSignal =
nullptr);
56 const char *viewModelChangeSignal =
nullptr,
57 const char *viewChangeSignal =
nullptr);
67 Q_DECLARE_OPERATORS_FOR_FLAGS(QtMvvm::Binding::BindingDirection)
69 #if defined(QT_BUILD_MVVMCORE_LIB) && defined(Q_MOC_RUN) 70 #include "binding_p.h" 73 #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.