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

Qt Quick Test template project can produce both "#pragma once" and closing #include guard

XMLWordPrintable

      Steps to reproduce

      1. In Qt Creator, enable Preferences > C++ > File Naming > Include guard template > Use "#pragma once" instead
      2. Create a new project, File > New Project... > Test Project > Qt Quick Test Project
      3. Check "Generate setup code"

       

      Outcomes
      The generated setup.h contains both #pragma once and #endif // SETUP_H (which fails to compile):

      #pragma once
      
      #include <QObject>
      #include <QQmlEngine>
      
      class Setup : public QObject
      {
          Q_OBJECT
      public:
          Setup() = default;
      
      public slots:
          void applicationAvailable();
          void qmlEngineAvailable(QQmlEngine *engine);
          void cleanupTestCase();
      };
      
      #endif // SETUP_H
      

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

            con Eike Ziller
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change