do not create editors for unused columns

actorid
Marc Zinnschlag 12 years ago
parent 929b38ff6a
commit 90bae2bead

@ -116,6 +116,16 @@ void CSVWorld::CommandDelegate::setModelData (QWidget *editor, QAbstractItemMode
///< \todo provide some kind of feedback to the user, indicating that editing is currently not possible.
}
QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleOptionViewItem& option,
const QModelIndex& index) const
{
if (!index.data().isValid())
return 0;
return QStyledItemDelegate::createEditor (parent, option, index);
}
void CSVWorld::CommandDelegate::setEditLock (bool locked)
{
mEditLock = locked;

@ -99,6 +99,9 @@ namespace CSVWorld
virtual void setModelData (QWidget *editor, QAbstractItemModel *model,
const QModelIndex& index) const;
virtual QWidget *createEditor (QWidget *parent, const QStyleOptionViewItem& option,
const QModelIndex& index) const;
void setEditLock (bool locked);
bool isEditLocked() const;

Loading…
Cancel
Save