1 #ifndef QTMVVM_INJECTION_H 2 #define QTMVVM_INJECTION_H 4 #include "qtmvvmcore_global.h" 10 template <
typename TInterface>
12 QMetaType::registerConverter<QObject*, TInterface*>([](
QObject *o) {
13 return qobject_cast<TInterface*>(o);
20 #define QTMVVM_INJECT(classType, name) \ 21 static inline QByteArray __qtmvvm_inject_##name() { \ 22 return QtMvvm::__helpertypes::inject_iid<classType>(); \ 24 Q_PROPERTY(QByteArray __qtmvvm_inject_##name READ __qtmvvm_inject_##name STORED false SCRIPTABLE false DESIGNABLE false CONSTANT FINAL) 27 #define QTMVVM_INJECT_PROP(type, name, member) \ 28 Q_PROPERTY(type name MEMBER member) \ 29 QTMVVM_INJECT(type, name) void registerInterfaceConverter()
Registers QVariant converters from QObject to an interface type registered with Q_DECLARE_INTERFACE.
The primary namespace of the QtMvvm library.