I think I could see that working. Basically, the plugin would be a factory class that would pass a QWidget-based object via a function call on request. The main class would then load the plugin, qobject_cast it, then request the QWidget (if appropriate).
Ok, I think I can do this relatively easily at this stage - my current plugins don't yet do anything, so there's not a whole lot to re-write. Thanks!
EDIT: Actually, I think this will greatly simplify things now, as I can now create signals and slots in my plugin interface (as long as the interface header itself does not include the signals and slots).
Basically, it's like this:
Interface - contains some basic code to hand back a QWidget (or QObject, depending on the plugin type)
Shared abstract base class - contains signals and slots that the QWidget (or QObject) should contain that is passed back. As the interface itself only knows that it's something called a QWidget (or QObject), and doesn't know what either of those are (not including the headers), it should work. I think you just helped me find a way to cleanly implement my plugin structure. Thanks!
Bookmarks