summaryrefslogtreecommitdiffstats
path: root/src/remoteobjects/qremoteobjectsource.cpp
diff options
context:
space:
mode:
authorBrett Stottlemyer <bstottle@ford.com>2019-05-18 18:37:11 -0400
committerBrett Stottlemyer <bstottle@ford.com>2019-05-20 19:37:44 -0400
commit2d5105518ee21ea9ccb32effab76f4c5d1366cae (patch)
tree0bfa5a4913526f140626b560d6ba9220f3624268 /src/remoteobjects/qremoteobjectsource.cpp
parentfa84f22bfd5500550f26f544f6905ac89e60716f (diff)
Support Q_GADGETs with enums
The previous logic for sending/receiving the Q_GADGET definition used a custom GadgetsData type on both sides (a QByteArray for name and a QList of name/type pairs for each member). This isn't really needed on the send side, we just need the QMetaObject for the class. This simplifies the logic on the send side, as we no longer need to copy data around and merge duplicate types, and it allows extension to getting enums. On the receive side, we do need to copy the data. In particular, there can be nested types, where one POD includes another or an enum from another type. It is easier to extend the class if it doesn't need to support the send operation as well. On the send side, we now have serializeGadgets() which takes the pointers for gadget metaobjects as well as the list of needed QMetaEnum types. Using these, it constructs the list of necessary types to serialize and marshalls those. On the receive side, there is registerGadgets which uses the extended GadgetData struct (now including the data needed to create dynamic QMetaEnums) to create metaObjects and register the required types. Change-Id: I80ceff39131c7a2cdcfe592f338ea98f72e76874 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/remoteobjects/qremoteobjectsource.cpp')
-rw-r--r--src/remoteobjects/qremoteobjectsource.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/remoteobjects/qremoteobjectsource.cpp b/src/remoteobjects/qremoteobjectsource.cpp
index 52bd089..3ddec27 100644
--- a/src/remoteobjects/qremoteobjectsource.cpp
+++ b/src/remoteobjects/qremoteobjectsource.cpp
@@ -146,7 +146,7 @@ QRemoteObjectSource::QRemoteObjectSource(QObject *obj, Private *d, const SourceA
QRemoteObjectRootSource::QRemoteObjectRootSource(QObject *obj, const SourceApiMap *api,
QObject *adapter, QRemoteObjectSourceIo *sourceIo)
- : QRemoteObjectSourceBase(obj, new Private(sourceIo), api, adapter)
+ : QRemoteObjectSourceBase(obj, new Private(sourceIo, this), api, adapter)
, m_name(api->name())
{
d->m_sourceIo->registerSource(this);