mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-12 12:38:02 +00:00
fixed handling of numeric read-only fields in dialogue sub views
This commit is contained in:
parent
10fbe6aada
commit
57015f3666
@ -64,16 +64,24 @@ void CSVWorld::NotEditableSubDelegate::setEditorData (QWidget* editor, const QMo
|
||||
}
|
||||
}
|
||||
|
||||
CSMWorld::Columns::ColumnId columnId = static_cast<CSMWorld::Columns::ColumnId> (
|
||||
mTable->getColumnId (index.column()));
|
||||
|
||||
if (QVariant::String == v.type())
|
||||
{
|
||||
label->setText(v.toString());
|
||||
}
|
||||
else //else we are facing enums
|
||||
else if (CSMWorld::Columns::hasEnums (columnId))
|
||||
{
|
||||
int data = v.toInt();
|
||||
std::vector<std::string> enumNames (CSMWorld::Columns::getEnums (static_cast<CSMWorld::Columns::ColumnId> (mTable->getColumnId (index.column()))));
|
||||
std::vector<std::string> enumNames (CSMWorld::Columns::getEnums (columnId));
|
||||
|
||||
label->setText(QString::fromUtf8(enumNames.at(data).c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
label->setText (v.toString());
|
||||
}
|
||||
}
|
||||
|
||||
void CSVWorld::NotEditableSubDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
|
||||
|
Loading…
Reference in New Issue
Block a user