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

Moc compiler can't parse Q_INVOKABLE declaration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.8.0
    • 4.7.3
    • Build tools: moc
    • None
    • macos 10.5 ( built from source or with official offline distrib )
    • f57dac1faf4d39eae851d0e9238a8b5968b48a73

    Description

      I have used Qt 4.7.3

      // a.h
      
      class A : public QObject
      {
        Q_OBJECT
      
        public:
          Q_PROPERTY( int invokableValue READ invokableValue )
      
          Q_INVOKABLE int invokableValue() { return 0; }
      };
      
      // a_moc.cpp:
      
          if (_c == QMetaObject::InvokeMetaMethod) {
              // no calls here
          }
      #ifndef QT_NO_PROPERTIES
          else if (_c == QMetaObject::ReadProperty) {
              void *_v = _a[0];
              switch (_id) {
              case 0: *reinterpret_cast< int*>(_v) = invokableValue(); break;
          }
      

      The problem can be solved by adding semicolon after Q_PROPERTY ( see http://stackoverflow.com/questions/7846238/q-property-methods-cant-be-called-using-qmetaobjectinvokemethod ).

      Attachments

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

        Activity

          People

            ogoffart Olivier Goffart (Woboq GmbH)
            anberlin Iakov Minochkin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes