mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-12 12:46:24 +00:00
23 lines
668 B
C++
23 lines
668 B
C++
|
#include <QGuiApplication>
|
||
|
#include <QQmlApplicationEngine>
|
||
|
#include <QQmlContext>
|
||
|
#include <QMetaMethod>
|
||
|
#include <DynamicQObject.h>
|
||
|
#include <QDebug>
|
||
|
|
||
|
int main(int argc, char *argv[])
|
||
|
{
|
||
|
QGuiApplication app(argc, argv);
|
||
|
|
||
|
DynamicQObject dynamicQObject;
|
||
|
int slotIndex;
|
||
|
dynamicQObject.registerSlot("foo", QMetaType::Void, {}, slotIndex);
|
||
|
dynamicQObject.registerSlot("bar", QMetaType::Int, {QMetaType::Int}, slotIndex);
|
||
|
|
||
|
QQmlApplicationEngine engine;
|
||
|
engine.rootContext()->setContextProperty("dynamicQObject", QVariant::fromValue<QObject*>(&dynamicQObject));
|
||
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
||
|
|
||
|
return app.exec();
|
||
|
}
|