forked from teamnwah/openmw-tes3coop
Checkboxes in the table view use a combobox editor
This commit is contained in:
parent
bd46ddcf47
commit
d63b01dde3
1 changed files with 11 additions and 1 deletions
|
@ -152,7 +152,17 @@ void CSVWorld::CommandDelegate::setModelData (QWidget *editor, QAbstractItemMode
|
||||||
QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleOptionViewItem& option,
|
QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleOptionViewItem& option,
|
||||||
const QModelIndex& index) const
|
const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
return createEditor (parent, option, index, getDisplayTypeFromIndex(index));
|
CSMWorld::ColumnBase::Display display = getDisplayTypeFromIndex(index);
|
||||||
|
|
||||||
|
// This createEditor() method is called implicitly from tables.
|
||||||
|
// For boolean values in tables use the default editor (combobox).
|
||||||
|
// Checkboxes is looking ugly in the table view.
|
||||||
|
// TODO: Find a better solution?
|
||||||
|
if (display == CSMWorld::ColumnBase::Display_Boolean)
|
||||||
|
{
|
||||||
|
return QStyledItemDelegate::createEditor(parent, option, index);
|
||||||
|
}
|
||||||
|
return createEditor (parent, option, index, display);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleOptionViewItem& option,
|
QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleOptionViewItem& option,
|
||||||
|
|
Loading…
Reference in a new issue