forked from lubuwest/Friendiqa
v0.1
This commit is contained in:
parent
591d55f43a
commit
fb560b54b1
115 changed files with 5537 additions and 0 deletions
|
@ -0,0 +1,26 @@
|
|||
#include <QtQml>
|
||||
#include <AndroidNative/systemdispatcher.h>
|
||||
#include <AndroidNative/priv/systemdispatcherproxy.h>
|
||||
|
||||
using namespace AndroidNative;
|
||||
|
||||
static QObject *systemDispatcherProvider(QQmlEngine *engine, QJSEngine *scriptEngine) {
|
||||
Q_UNUSED(engine);
|
||||
Q_UNUSED(scriptEngine);
|
||||
|
||||
SystemDispatcherProxy* object = new SystemDispatcherProxy();
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void regiserQmlTypes() {
|
||||
// QADevice is a exception. Won't register by QAQmlTypes.
|
||||
|
||||
qmlRegisterSingletonType<SystemDispatcherProxy>("AndroidNative", 1, 0,
|
||||
"SystemDispatcher",
|
||||
systemDispatcherProvider);
|
||||
}
|
||||
|
||||
Q_COREAPP_STARTUP_FUNCTION(regiserQmlTypes)
|
|
@ -0,0 +1,25 @@
|
|||
#include <QtQml>
|
||||
#include "systemdispatcherproxy.h"
|
||||
#include "AndroidNative/systemdispatcher.h"
|
||||
|
||||
AndroidNative::SystemDispatcherProxy::SystemDispatcherProxy(QObject *parent) : QObject(parent)
|
||||
{
|
||||
connect(SystemDispatcher::instance(),SIGNAL(dispatched(QString,QVariantMap)),
|
||||
this,SIGNAL(dispatched(QString,QVariantMap)));
|
||||
|
||||
}
|
||||
|
||||
AndroidNative::SystemDispatcherProxy::~SystemDispatcherProxy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void AndroidNative::SystemDispatcherProxy::dispatch(QString type, QVariantMap message)
|
||||
{
|
||||
SystemDispatcher::instance()->dispatch(type,message);
|
||||
}
|
||||
|
||||
void AndroidNative::SystemDispatcherProxy::loadClass(QString className)
|
||||
{
|
||||
SystemDispatcher::instance()->loadClass(className);
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariantMap>
|
||||
|
||||
namespace AndroidNative {
|
||||
|
||||
class SystemDispatcherProxy : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SystemDispatcherProxy(QObject *parent = 0);
|
||||
~SystemDispatcherProxy();
|
||||
|
||||
Q_INVOKABLE void dispatch(QString type, QVariantMap message = QVariantMap());
|
||||
|
||||
Q_INVOKABLE void loadClass(QString className);
|
||||
|
||||
signals:
|
||||
void dispatched(QString type , QVariantMap message);
|
||||
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue