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

Wrong indentation in template project

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.6.0-beta1
    • Fix Version/s: None
    • Component/s: All Other Issues
    • Environment:
      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

        For Gerrit Dashboard: QTCREATORBUG-19648
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              portale Alessandro Portale
              Reporter:
              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