PDA

View Full Version : QtPlugin and not-pure virtual functions



manuelschneid3r
16th April 2015, 16:08
For creating a Qt Plugin the doc (http://doc.qt.io/qt-5/plugins-howto.html) states that i have to "Define a set of interfaces (classes with only pure virtual functions) used to talk to the plugins." I do have some (not-pure) virtual functions (those with a body and not declared with "=0"). This is quite handy, because if a plugin function does nothing, the plugin does not need to implement it. It works quite well untill now, but I am afraid of caveats. Are there any?




Define a set of interfaces (classes with only pure virtual functions) used to talk to the plugins.

Lykurg
16th April 2015, 19:11
Hi,

if you define the interface it does not matter if you have pure virtual or only virtual functions. There are no caveats. With pure virtual functions, however, you can force the plug-in to define something but that's a pure architectural question.