Quote Originally Posted by high_flyer View Post
No.
Qt Code:
  1. //in your application code
  2. MyWidget *pWidget = m_pPlugin->createWidget();
  3. if(pWidget){
  4. pWidget->someMethod();
  5. }
To copy to clipboard, switch view to plain text mode 
Well, yeah, I guess it was kind of a stupid question . I am simply a bit confused on how to implement this the "correct" way. So if I want to create plugins that are independent views in the main application, with which the main application interfaces through a certain interface (i.e. ViewInterface). Would I need to do something like this?

Qt Code:
  1. class ViewPlugin : public QObject, public ViewPluginInterface
  2. {
  3. Q_OBJECT
  4. Q_INTERFACES( ViewPluginInterface )
  5. ...
  6. };
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. class ViewPluginInterface
  2. {
  3. ViewWidget* createWidget( QWidget* parent ) = 0;
  4. };
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. class ViewWidget : public ViewInterface
  2. {
  3. ...
  4. };
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. class ViewInterface : public QWidget
  2. {
  3. ...
  4. };
To copy to clipboard, switch view to plain text mode 

In that case, the createWidget function would be the only function of the plugin interface. And I am not sure the inheritance of QWidget works this way?