Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-19648

Wrong indentation in template project

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • Qt Creator 4.6.0-beta1
    • All Other Issues
    • Ubuntu 17.04 64 bit

    Description

      1. Create a new "Qt Quick Application - Scroll" project using the wizard.
      2. 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            portale Alessandro Portale
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes