The problem with this:
struct ListViewInterface{
virtual MyListViewWidget
*create
(QWidget *parent
)=0;
...
};
struct ListViewInterface{
virtual MyListViewWidget *create(QWidget *parent)=0;
...
};
To copy to clipboard, switch view to plain text mode
is that the application has to know what a MyListViewWidget class looks like. Which defeats the purpose of the interface.
What is needed is something like:
struct ListViewInterface{
...
};
struct ListViewInterface{
virtual QWidget *create(QWidget *parent)=0;
...
};
To copy to clipboard, switch view to plain text mode
where I could then create a set of plugins:
MyListView
YourListView
AnotherListView
etc...
that all adhere to the ListViewInterface interface.
With the interface defined above, I can call create() and get back a QWidget and then stick that in the layout, but I can't call any of the ListViewInterface defined methods anymore , because i have a QWidget now, not a (QWidget+ListViewInterface)
So, as per your second suggestion, I guess I need to use Qt's meta data access and cast it to its proper class.
Thanks.
-C.
Bookmarks