How to use custom widget editor with QItemDelegate
Hello,
In my project, i need to populate a ListView with different item. Those items can have différent nature, and need a custom widget for drawing and editing.
I have build a custom widget (Widget_CarteFille_Gpio) with QDesigner (1 layout, 2 label, 2 combo-box)
Code:
Widget_CarteFille_Gpio
::Widget_CarteFille_Gpio (QWidget *parent
) :{
setupUi (this);
}
Next, i try to subclass a QItemDelegate who build my new widget for the editing.
Code:
{
Widget_CarteFille_Gpio *editor = new Widget_CarteFille_Gpio (parent);
return editor;
}
I build the project, and exec the application !
When I double click on the item my widget is not show !
I read this exemple : http://doc.qtsoftware.com/4.5/itemvi...rdelegate.html but they draw directly on a widget, this is little different of my problem.
If someone have a code exemple about draw a custom widget for viewing/editing in a ListView. I was very interresting.
Thanks
Apologize for my English !
Re: How to use custom widget editor with QItemDelegate
subclass QStyledItemDelegateinstead of QItemDelegate..also you should read about QItemEditorCreator, QItemEditorCreatorBaseand QItemEditorFactory..this will give you more knowledge about editors and you'd be able to solve problem yourself
Re: How to use custom widget editor with QItemDelegate