SelectionEditorFactory + ItemModel + ItemModelFactory combination is working
in new EditTableWidget (EditTableWidget is very much WIP)
This commit is contained in:
parent
e44f73166f
commit
742fd0a4d3
19 changed files with 419 additions and 80 deletions
|
|
@ -26,24 +26,11 @@ QWidget *ParamTypeDelegate::createEditor(QWidget *parent,
|
|||
cmbbx->setModel(m_typeSelectionModel);
|
||||
w = cmbbx;
|
||||
|
||||
// ...
|
||||
// m_ComboBox->setView(m_ColumnView);
|
||||
// m_ComboBox->view()->setCornerWidget(new QSizeGrip(m_ColumnView));
|
||||
// m_ComboBox->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
// ...
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
void ParamTypeDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
|
||||
{
|
||||
// if (index.data().canConvert<StarRating>()) {
|
||||
// StarRating starRating = qvariant_cast<StarRating>(index.data());
|
||||
// StarEditor *starEditor = qobject_cast<StarEditor *>(editor);
|
||||
// starEditor->setStarRating(starRating);
|
||||
// } else {
|
||||
// QStyledItemDelegate::setEditorData(editor, index);
|
||||
// }
|
||||
if (index.column() == 1) {
|
||||
QComboBox *cmbbx = dynamic_cast<QComboBox*>(editor);
|
||||
if (cmbbx) {
|
||||
|
|
@ -68,12 +55,6 @@ void ParamTypeDelegate::setEditorData(QWidget *editor, const QModelIndex &index)
|
|||
void ParamTypeDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
// if (index.data().canConvert<StarRating>()) {
|
||||
// StarEditor *starEditor = qobject_cast<StarEditor *>(editor);
|
||||
// model->setData(index, QVariant::fromValue(starEditor->starRating()));
|
||||
// } else {
|
||||
// QStyledItemDelegate::setModelData(editor, model, index);
|
||||
// }
|
||||
if (index.column() == 1) {
|
||||
QComboBox *cmbbx = dynamic_cast<QComboBox*>(editor);
|
||||
if (cmbbx) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue