Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-56185

Qt3D doesn't follow the coding conventions when including headers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 5.9.0 Beta 2
    • 5.6, 5.7, 5.8
    • Qt3D
    • None

      In https://wiki.qt.io/Coding_Conventions it says:

      Including headers
      
          In public header files, always use this form to include Qt headers: #include <QtCore/qwhatever.h>. The library prefix is neccessary for Mac OS X frameworks and is very convenient for non-qmake projects.
          In source files, include specialized headers first, then generic headers. Separate the categories with empty lines.
      
           #include <qstring.h> // Qt class
           
           #include <new> // STL stuff
           
           #include <limits.h> // system stuff
      
          If you need to include qplatformdefs.h, always include it as the first header file.
          If you need to include private headers, be careful. Use the following syntax, irrespective of which module or directory whatever_p.h is in.
      
           #include <private/whatever_p.h>
      

      E.g in qt3d/src/core/qscenechange.h there is:

      #include <Qt3DCore/qt3dcore_global.h>
      #include <QSharedPointer>
      

      That is just one example. Some headers are incorrectly included throughout the Qt3D code. All those includes should be changed to follow the coding conventions, since it prohibits the inclusion of the binary compatibility tests to Qt3D among other things, since the script that generates the text files chokes on those incorrect includes.

        For Gerrit Dashboard: QTBUG-56185
        # Subject Branch Project Status CR V

            rbrock Robert Brock
            mipohjan Milla Pohjanheimo
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: