Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
Qt Creator 4.6.0-beta1
-
Ubuntu 17.04 64 bit
Description
- Create a new "Qt Quick Application - Scroll" project using the wizard.
- Open the project's main.cpp.
The indentation in QObject::connect is wrong:#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl mainQml(QStringLiteral("qrc:/main.qml")); // Catch the objectCreated signal, so that we can determine if the root component was loaded // successfully. If not, then the object created from it will be null. The root component may // get loaded asynchronously. const QMetaObject::Connection connection = QObject::connect( &engine, &QQmlApplicationEngine::objectCreated, &app, [&](QObject *object, const QUrl &url) { if (url != mainQml) return; if (!object) app.exit(-1); else QObject::disconnect(connection); }, Qt::QueuedConnection); engine.load(mainQml); return app.exec(); }
Template projects should be correctly indented.
Attachments
For Gerrit Dashboard: QTCREATORBUG-19648 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
219090,2 | Revert "Wizards: Accept asynchronous root components for qqapplication" | 4.6 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |