18 #include "PluginIncubator.h"
19 #include <QQmlContext>
22 Q_LOGGING_CATEGORY(PLUGIN_INCUBATOR,
"dekko.plugman.incubator")
25 QQmlIncubator(QQmlIncubator::Asynchronous), m_comp(Q_NULLPTR)
29 void PluginIncubator::setSourceUrl(QQmlEngine *engine,
const QUrl &source)
31 m_comp =
new QQmlComponent(engine, source,
this);
32 if (m_comp->isError()) {
33 qCDebug(PLUGIN_INCUBATOR) <<
"Comp failed: " << m_comp->errorString();
37 QQmlContext *c = engine->contextForObject(parent());
39 m_comp->create(*
this, c);
43 void PluginIncubator::statusChanged(QQmlIncubator::Status status)
46 case QQmlIncubator::Null:
48 case QQmlIncubator::Ready:
49 qCDebug(PLUGIN_INCUBATOR) <<
"Incubator finished and ready to hatch.";
52 case QQmlIncubator::Loading:
53 qCDebug(PLUGIN_INCUBATOR) <<
"Incubating plugin";
55 case QQmlIncubator::Error:
56 qCDebug(PLUGIN_INCUBATOR) <<
"Incubation Error";