Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QQuickItem* PluginBase::createObject(QQmlEngine* engine, QUrl qmlFile)
- {
- QQmlComponent component(engine, qmlFile);
- if (component.status() == QQmlComponent::Ready)
- {
- auto item = qobject_cast<QQuickItem*>(component.create());
- QQmlEngine::setObjectOwnership(item, QQmlEngine::CppOwnership);
- m_items.append(item);
- return item;
- } else
- {
- emit error(component.errors().last().toString());
- return nullptr;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement