Example #1
0
Element* QmlPlugin::newElement(int t)
      {
      Score* score = curScore();
      if (score == 0)
            return 0;
      return Element::create(Element::ElementType(t), score);
      }
Example #2
0
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;
      }
Example #3
0
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;
      }