Hey folks,
I'm trying to display my own widget in a QListView using a QItemDelegate.
When specifying a simple widget, the delegate seems to work pretty good.
Unfortunately when I specify a more complete one, it doesn't seem to display anything.
The view is left blank, plus no resizing of the list row.
{
layout->addWidget(editor);
layout->addWidget(editor2);
layout->addWidget(editor3);
test->resize(333, 333);
test->show();
return test;
}
QWidget * ZeContactDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QWidget * test = new QWidget(parent);
QVBoxLayout * layout = new QVBoxLayout(test);
QPushButton * editor = new QPushButton;
QPushButton * editor2 = new QPushButton;
QPushButton * editor3 = new QPushButton;
layout->addWidget(editor);
layout->addWidget(editor2);
layout->addWidget(editor3);
test->resize(333, 333);
test->show();
return test;
}
To copy to clipboard, switch view to plain text mode
Any thoughts ?
Bookmarks