Files
logos-view-module-runtime/include/LogosViewReplicaFactory.h

25 lines
880 B
C++

#pragma once
#include <QtPlugin>
class QObject;
class QRemoteObjectNode;
class QMetaObject;
// A tiny Qt plugin interface that lets a view module ship a typed
// QRemoteObjectReplica factory alongside its backend plugin. The host loads
// the factory via QPluginLoader and asks it to construct a replica from a
// QRemoteObjectNode — the returned QObject has a real static metaobject
// (generated by `repc`) so QML's QObjectWrapper caches a correct property
// cache and all the dynamic-replica QML quirks go away.
class LogosViewReplicaFactory {
public:
virtual ~LogosViewReplicaFactory() = default;
virtual QObject* acquire(QRemoteObjectNode* node) = 0;
virtual const QMetaObject* replicaMetaObject() const = 0;
};
#define LogosViewReplicaFactory_iid "logos.view.replica_factory/1.0"
Q_DECLARE_INTERFACE(LogosViewReplicaFactory, LogosViewReplicaFactory_iid)