main.cc
main () {
QGuiApplication app(argc, argv);
QtQuick2ApplicationViewer viewer;
myObj obj;
//! -->
qmlRegisterType<ByteArrayWrapper, 1>("ByteArrayWrapper", 1, 0, "CppType");
//! <--
viewer.rootContext()->setContextProperty("audioData", &obj);
viewer.setMainQmlFile(QStringLiteral("./qml/TestProject/main.qml"));
QObject *object = viewer.rootObject();
QObject::connect(&obj, SIGNAL(triggerDraw()), object, SLOT(on_drawBuffer()));
viewer.showExpanded();
return app.exec();
}
And getAudioBuffer() returns ByteArrayBuffer*. This is important.
Thank you Vincent
↧









