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

moc output does not compile if Q_PROPERTY uses type in a namespace

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0
    • 4.4.0
    • Build tools: moc
    • None
    • 54f0733e7df4134afbcf0a81ba39751f31c9b84d

    Description

      The following file does not compile; the moc-file declares

      static const QMetaObject *qt_meta_extradata_MyObject[] = {
      &NS::staticMetaObject,0
      };

      which is incorrect "staticMetaObject" belongs to the class, not the namespace.

      #include <QObject>

      namespace NS {
      class A : public QObject
      {
      Q_OBJECT
      };
      };

      class B : public QObject
      {
      Q_OBJECT
      Q_PROPERTY(
      NS::A* aProp
      READ aProp
      )

      public:
      NS::A * aProp() const

      { return 0; }


      };

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            admin Administrator
            Votes:
            12 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes