Element* QmlPlugin::newElement(int t) { Score* score = curScore(); if (score == 0) return 0; return Element::create(Element::ElementType(t), score); }
Ms::Element* QmlPlugin::newElement(int t) { Score* score = curScore(); if (score == 0) return 0; Element* e = Element::create(ElementType(t), score); Ms::MScore::qml()->setObjectOwnership(e, QQmlEngine::CppOwnership); return e; }
Ms::Element* QmlPlugin::newElement(int t) { Score* score = curScore(); if (score == 0) return 0; Element* e = Element::create(Element::Type(t), score); // tell QML not to garbage collect this score Ms::MScore::qml()->setObjectOwnership(e, QQmlEngine::CppOwnership); return e; }