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

MOC fails on Q_INTERFACES macro

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.2.0
    • Fix Version/s: None
    • Component/s: Build tools: moc
    • Labels:
      None
    • Environment:
      Visual Studio 2012, Qt 5.2, Qt addin 1.2

      Description

      MOC fails on Q_INTERFACES macro, if header file with interface is included by absolute path.

      Project structure:

      + app
        main.cpp
        FooImpl.cpp
        FooImpl.h
      + InterfaceLib
        IFoo.h
      

      Interface is declared in IFoo.h, and included in FooImpl.h. In project configuration $(SolutionDir) is added as Include Path.
      FooImpl.h:

      ...
      #inlcude "InterfaceLib/IFoo.h"
      class FooImpl : public QObject
      {
        Q_OBJECT
        Q_INTERFACES( IFoo )
      };
      

      Moc'ing fails with "error : Undefined interface".
      Bug is not reproducing with relative path:

      #inlcude "../InterfaceLib/IFoo.h"
      

      Seems, that similar issues:
      https://bugreports.qt-project.org/browse/QTBUG-12585
      http://qt-project.org/forums/viewthread/24301

      Added:
      Sample project (Visual Studio 2012, Qt 5.2, Qt addin 1.2) - https://dl.dropboxusercontent.com/u/35260560/bugs/QtMocBug.zip

        Attachments

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

          Activity

            People

            • Assignee:
              ogoffart Olivier Goffart (Woboq GmbH)
              Reporter:
              sazonov Dmitry Sazonov
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes