diff options
Diffstat (limited to 'src/interfaceframework/qifsimulationengine.cpp')
| -rw-r--r-- | src/interfaceframework/qifsimulationengine.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/interfaceframework/qifsimulationengine.cpp b/src/interfaceframework/qifsimulationengine.cpp index e4c89d5f..7056afb4 100644 --- a/src/interfaceframework/qifsimulationengine.cpp +++ b/src/interfaceframework/qifsimulationengine.cpp @@ -18,11 +18,11 @@ QT_BEGIN_NAMESPACE namespace qtif_helper { - static const QString qrcUrlLiteral = QStringLiteral("qrc:"); - static const QString qrcLiteral = QStringLiteral("qrc"); - static const QString resourceLiteral = QStringLiteral(":/"); - QUrl toQmlUrl(const QString &path) { + static const QString qrcUrlLiteral = QStringLiteral("qrc:"); + static const QString qrcLiteral = QStringLiteral("qrc"); + static const QString resourceLiteral = QStringLiteral(":/"); + if (path.startsWith(qrcUrlLiteral)) return path; else if (path.startsWith(resourceLiteral)) @@ -214,14 +214,23 @@ using namespace qtif_helper; \endcode */ +/*! + Constructs a new QIfSimulationEngine with the given \a parent. +*/ QIfSimulationEngine::QIfSimulationEngine(QObject *parent) : QIfSimulationEngine(QString(), parent) { } +/*! + Constructs a new QIfSimulationEngine with the given \a identifier and \a parent. + + The \a identifier can be used to override the simulation QML file or the simulation data file. + \sa Runtime Override +*/ QIfSimulationEngine::QIfSimulationEngine(const QString &identifier, QObject *parent) : QQmlApplicationEngine (parent) - , m_globalObject(new QIfSimulationGlobalObject) + , m_globalObject(new QIfSimulationGlobalObject(this)) , m_identifier(identifier) { rootContext()->setContextProperty(QStringLiteral("IfSimulator"), m_globalObject); |
