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

moc does not do macro substitution

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 4.0.1
    • Build tools: moc
    • None

    Description

      Moc do macro substitution in preprocessor command (#if) but not for source code.

      Original report:

      moc does not notice the namespace and generates meta-object code that does not compile for the class declaration below:

      #define NAMESPACE_BEGIN namespace test

      { #define NAMESPACE_END }

      NAMESPACE_BEGIN

      class AnalogClock : public QWidget
      {
      Q_OBJECT

      public:
      AnalogClock(QWidget *parent = 0);

      protected:
      void paintEvent(QPaintEvent *event);
      };

      NAMESPACE_END

      Attachments

        Issue Links

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

          Activity

            People

              ogoffart Olivier Goffart (Woboq GmbH)
              vhilshei Volker Hilsheimer
              Votes:
              8 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes