[Interest] QPlugin and RTTI

Bo Thorsen bo at vikingsoft.eu
Wed Jun 18 17:53:54 CEST 2014


Den 18-06-2014 17:31, Etienne Sandré-Chardonnal skrev:
> Which defeats the purpose of the plugin, which should define a subclass
> of a base class common between plugins (and app).
> Can I define the base class in a separate library, dynamically linked
> with every plugin & the app?

Yes, that's exactly what you do.

The library has the class Base { ... }. Plugins has class whatever : 
Base. In the application you do dynamic_cast<Base*>(object).

Bo.

>      > Will the dynamic_cast work? Is there a special way to
>     export/declare things
>      > for that?
>
>     Yes, provided those classes are all in the library.
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>


-- 
Viking Software
Qt and C++ developers for hire
http://www.vikingsoft.eu



More information about the Interest mailing list