#ifndef QTMVVMCORE_GLOBAL_H #define QTMVVMCORE_GLOBAL_H #include #include "qtmvvmcore_helpertypes.h" #if defined(QT_BUILD_MVVMCORE_LIB) # define Q_MVVMCORE_EXPORT Q_DECL_EXPORT #else # define Q_MVVMCORE_EXPORT Q_DECL_IMPORT #endif namespace QtMvvm { template inline void registerInterfaceConverter() { QMetaType::registerConverter([](QObject *o) { return qobject_cast(o); }); } } #define QTMVVM_INJECT(classType, name) \ static inline QByteArray __qtmvvm_inject_##name() { \ return QtMvvm::__helpertypes::inject_iid(); \ } \ Q_PROPERTY(QByteArray __qtmvvm_inject_##name READ __qtmvvm_inject_##name STORED false SCRIPTABLE false DESIGNABLE false CONSTANT FINAL) #define QTMVVM_INJECT_PROP(type, name, member) \ Q_PROPERTY(type name MEMBER member) \ QTMVVM_INJECT(type, name) #endif // QTMVVMCORE_GLOBAL_H