diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-05-06 09:01:09 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-05-06 07:27:07 +0000 |
commit | d54f7f520ab876e86db3ddc895ddba7f685aec1d (patch) | |
tree | a9ba7a83dc734568d69266969529929961e0d797 /src/qml/qml/qqmlapplicationengine.cpp | |
parent | 7c287efccc1fc2432de206c339af60a3fee9fe04 (diff) |
Introduce delegating constructors.
Reduce code duplication by chaining constructors.
Change-Id: I8a0afd20ed13d4eb938536dcb05787ba2565a4cc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlapplicationengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlapplicationengine.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp index 57cdd3f47f..8c342e0592 100644 --- a/src/qml/qml/qqmlapplicationengine.cpp +++ b/src/qml/qml/qqmlapplicationengine.cpp @@ -211,11 +211,8 @@ QQmlApplicationEngine::QQmlApplicationEngine(QObject *parent) This is provided as a convenience, and is the same as using the empty constructor and calling load afterwards. */ QQmlApplicationEngine::QQmlApplicationEngine(const QUrl &url, QObject *parent) - : QQmlEngine(*(new QQmlApplicationEnginePrivate(this)), parent) + : QQmlApplicationEngine(parent) { - Q_D(QQmlApplicationEngine); - d->init(); - QJSEnginePrivate::addToDebugServer(this); load(url); } @@ -228,12 +225,8 @@ QQmlApplicationEngine::QQmlApplicationEngine(const QUrl &url, QObject *parent) This is provided as a convenience, and is the same as using the empty constructor and calling load afterwards. */ QQmlApplicationEngine::QQmlApplicationEngine(const QString &filePath, QObject *parent) - : QQmlEngine(*(new QQmlApplicationEnginePrivate(this)), parent) + : QQmlApplicationEngine(QUrl::fromLocalFile(filePath), parent) { - Q_D(QQmlApplicationEngine); - d->init(); - QJSEnginePrivate::addToDebugServer(this); - load(QUrl::fromLocalFile(filePath)); } /*! |