Can a Dock Widget set a View with a custom Model instead of a Widget?
-
Hi there,
How can I make a QDockWidget set a View (e.g. QListView) instead of a widget, like:
dock->setWidget(view);I'd like to dock my QListView which uses my custom Model, i.e.
QListView* view = new QListView; view->setModel(customModel);But then I cannot do:
QDockWidget* dock = new QDockWidget(tr("My dock"), this); dock->setWidget(view);Thanks
-
@Loquat said in Can a Dock Widget set a View with a custom Model instead of a Widget?:
But then I cannot do:
You can - QListView derives from QWidget. What's your compiler error?
-
@Loquat said in Can a Dock Widget set a View with a custom Model instead of a Widget?:
But then I cannot do:
You can - QListView derives from QWidget. What's your compiler error?
@Christian-Ehrlicher oh so it does but in a very long chain of inheritance... I thought it derived only from QAbstractItemView but then I didn't realise the chain is QListView:QAbstractItemView:QAbstractScrollArea:QFrame:QWidget