[Interest] Qt Plugin Low Level API

Samuel Stirtzel s.stirtzel at googlemail.com
Thu May 22 09:55:43 CEST 2014


2014-05-22 9:37 GMT+02:00 Etienne Sandré-Chardonnal <etienne.sandre at m4x.org>:
> Dear all,
>
> I'm reading the doc in order to implement plugins into my Qt 4.8
> application.
>
> The manual says that I need first to define the plugin interface as a pure
> virtual class. In the example it does not inherit QObject.
>
> Then it shows an example plugin implementation which inherits from QObject
> and the interface class (multiple inheritance)
>
> Then it says "use qobject_cast() to test whether a plugin implement a given
> interface". However, the qobject_cast page clearly says that the target
> class type must inherit QObject.
>
> I dit not try compiling an example yet, but how could this work? Shouldn't
> the interface inherit QObject, and the plugin implementation simply inherit
> the interface class?
>

Hi,

look up the Q_DECLARE_INTERFACE macro definition.

The docs describe this as "Use the Q_DECLARE_INTERFACE() macro to tell
Qt's meta-object system about the interface."


-- 
Regards
Samuel



More information about the Interest mailing list