New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using US_DECLARE_SERVICE_INTERFACE with Qt does not work #19

saschazelzer opened this Issue Jun 1, 2014 · 0 comments


None yet
1 participant

saschazelzer commented Jun 1, 2014

The US_DECLARE_SERVICE_INTERFACE was meant to work like the Q_DECLARE_INTERFACE macro if Qt headers are available. However, this never fully worked because moc needs an explicit Q_DECLARE_INTERFACE statement when parsing the Q_INTERFACES macro in a QObject derived class.

@saschazelzer saschazelzer added this to the Releasse 3.0 milestone Jun 1, 2014

@saschazelzer saschazelzer added the bug label Jun 1, 2014

@saschazelzer saschazelzer self-assigned this Jun 1, 2014

saschazelzer added a commit that referenced this issue Jun 1, 2014

Do not specialize the qobject_cast template for service interfaces.
This fixes issue #19.

The intent was to add support for qobject_cast<Interface*>(qobject)
calls for all micro service interfaces automatically if Qt is used.
However, this never fully worked because the QObject derived class
needs a Q_INTERFACES macro which requires moc to find an explicit
Q_DECLARE_INTERFACE macro for the used interface. By removing the
qobject_cast specializations, Q_DECLARE_INTERFACE and
US_DECLARE_SERVICE_INTERFACE can be used in parallel and existing
Qt classes can also be marked as a micro service interface (no
qobject_cast specialization clashes any more).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment