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

"signals:" section has no effect on moc in class defined through macro

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.11.2
    • Build tools: moc
    • None

    Description

      Consider this class declaration:

      #include <QObject>
      
      #define THE_CLASS(name)            \
      class name : public QObject \
      { \
          Q_OBJECT \
      signals: \
          void mySignal(); \
      }
      THE_CLASS(MyClass);
      

      moc does not recognize "mySignal" as a signal when run on this file; there is no such metadata in the output. However, if I add Q_SIGNAL to the declaration of mySignal, then it works.
      Apparently, the fact that the class is declared via a macro makes the "signals:" keyword lose its effect somehow.

      Attachments

        1. theclass.h
          0.2 kB
        2. theclass2.h
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            kandeler Christian Kandeler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes