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

Q_PROPERTY silently ignored on forward declared types

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 5.9.3
    • Build tools: moc
    • None
    • Windows 7 with Visual Studio 2015 Update 3

    Description

      If a Q_PROPERTY is used with a forward declared type, MOC does not generate code for it. There is no warnings/errors during compilation.

      Example:

          class Foo;
          Q_PROPERTY(Foo* foo READ GetFoo NOTIFY FooChanged);
      

      This is a problem when refactoring large code bases, as forward declaring types in some file may introduce bugs that are not detected.

      I would expect MOC to fail when generating code for a forward declared type.

      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)
            jogerh Jøger Hansegård (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes