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

moc does not do macro substitution

XMLWordPrintable

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

      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

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes