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

moc does not do macro substitution

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.0.1
    • Fix Version/s: 5.0.0
    • Component/s: Build tools: moc
    • Labels:
      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

              • Assignee:
                ogoffart Olivier Goffart (Woboq GmbH)
                Reporter:
                vhilshei Volker Hilsheimer (closed Nokia identity) (Inactive)
              • Votes:
                8 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes