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

Q_NAMESPACE does not compile even if QtGlobal is included

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.9.5
    • Build tools: moc
    • None
    • GCC 7.3, Linux, CMake 3.10.3

      Clang 5, Linux, CMake 3.10.3

    Description

      If `Q_NAMESPACE` is used, the moc compilation fails with

       

      'Q_NAMESPACE' does not name a type

       

      Unless `#include <QtCore/QObject>` is added. This isn't due to the fact that QObject define the macro, but rather that the moc own `#include` misses it AND the `qobjectdefs.h` also miss some of it's own dependencies as well. Only adding a long chain of internal `#include` solves the problem unless QObject is included (because it has that chain of include)

      Attachments

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

        Activity

          People

            ogoffart Olivier Goffart (Woboq GmbH)
            elv13 Emmanuel Lepage Vallee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes