Commit b93816f4 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

renaming QMetaObject-based qbind: qzap

parent ad0429bf
...@@ -848,9 +848,9 @@ QSeq<T_> QSeq<T_>::forEach(Ts& ts, ...@@ -848,9 +848,9 @@ QSeq<T_> QSeq<T_>::forEach(Ts& ts,
#include <QtCore/qmetatype.h> #include <QtCore/qmetatype.h>
#include <QtCore/qmetaobject.h> #include <QtCore/qmetaobject.h>
// For QBIND_GADGET_WITH_METAOBJECT below // For Q_DEFINE_ZAP_WITH_METAOBJECT below
template<class T> template<class T>
QValueStatus qbind(QValue&& v, T* t) { QValueStatus qzap(QValue&& v, T* t) {
auto rw = v->mode(); auto rw = v->mode();
auto mo = T::staticMetaObject; auto mo = T::staticMetaObject;
auto r = v.meta(qmName,QAsciiData(mo.className())).record(); auto r = v.meta(qmName,QAsciiData(mo.className())).record();
...@@ -921,7 +921,7 @@ QValueStatus qbind(QValue&& v, T* t) { ...@@ -921,7 +921,7 @@ QValueStatus qbind(QValue&& v, T* t) {
} }
//! Default bind(QValue&&) based on static QMetaObject reflection //! Default bind(QValue&&) based on static QMetaObject reflection
#define QBIND_GADGET_WITH_METAOBJECT(Class) QValueStatus zap(QValue&& v) { return qbind<Class>(std::move(v), this); } #define Q_DEFINE_ZAP_WITH_METAOBJECT(Class) QValueStatus zap(QValue&& v) { return qzap<Class>(std::move(v), this); }
template<typename T> template<typename T>
struct QTransmogrifier<QDefaultValue<T>> { struct QTransmogrifier<QDefaultValue<T>> {
......
...@@ -9,7 +9,7 @@ class Phone { ...@@ -9,7 +9,7 @@ class Phone {
Q_PROPERTY(Type type MEMBER _t) Q_PROPERTY(Type type MEMBER _t)
Q_PROPERTY(QString number MEMBER _n) Q_PROPERTY(QString number MEMBER _n)
public: public:
QBIND_GADGET_WITH_METAOBJECT(Phone) // making it (de)serializable and printable using reflection Q_DEFINE_ZAP_WITH_METAOBJECT(Phone) // making it (de)serializable and printable using reflection
enum Type : quint8 { Unknown=0, Mobile, Home, Office }; enum Type : quint8 { Unknown=0, Mobile, Home, Office };
Q_ENUM(Type) Q_ENUM(Type)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment