[Interest] Adding existing QObjects to QJSEngine

Boudewijn Rempt boud at valdyas.org
Fri Apr 22 11:04:59 CEST 2016


Yes, that works!

     QQmlEngine engine;
     engine.installExtensions(QJSEngine::AllExtensions);
     QJSValue part = engine.newQObject(KisPart::instance());
     engine.globalObject().setProperty("KisPart", part);
     engine.setObjectOwnership(KisPart::instance(), QQmlEngine::CppOwnership);
     QString output = engine.evaluate(script).toString();

Now I can take it from here :-)

-- 
Boudewijn Rempt | http://www.krita.org, http://www.valdyas.org



More information about the Interest mailing list