Revert auto expansion of enums as it was interfering with row based operations. Fix default values of magic effect skill & attributes.

test
cc9cii 10 years ago
parent 48a6006202
commit 7561b195ab

@ -252,8 +252,8 @@ namespace CSMWorld
// blank row // blank row
ESM::ENAMstruct effect; ESM::ENAMstruct effect;
effect.mEffectID = 0; effect.mEffectID = 0;
effect.mSkill = 0; effect.mSkill = -1;
effect.mAttribute = 0; effect.mAttribute = -1;
effect.mRange = 0; effect.mRange = 0;
effect.mArea = 0; effect.mArea = 0;
effect.mDuration = 0; effect.mDuration = 0;

@ -443,9 +443,10 @@ void CSVWorld::EditWidget::remake(int row)
NestedTable* table = new NestedTable(mDocument, mNestedModels.back(), this); NestedTable* table = new NestedTable(mDocument, mNestedModels.back(), this);
// FIXME: does not work well when enum delegates are used // FIXME: does not work well when enum delegates are used
//table->resizeColumnsToContents(); table->setVisible(false);
table->resizeColumnsToContents();
table->setVisible(true);
table->setEditTriggers(QAbstractItemView::SelectedClicked | QAbstractItemView::CurrentChanged); table->setEditTriggers(QAbstractItemView::SelectedClicked | QAbstractItemView::CurrentChanged);
table->setSelectionBehavior(QAbstractItemView::SelectItems);
QLabel* label = QLabel* label =
new QLabel (mTable->headerData (i, Qt::Horizontal, Qt::DisplayRole).toString(), mMainWidget); new QLabel (mTable->headerData (i, Qt::Horizontal, Qt::DisplayRole).toString(), mMainWidget);

@ -88,8 +88,6 @@ void CSVWorld::EnumDelegate::setEditorData (QWidget *editor, const QModelIndex&
if (mValues[i].first==value) if (mValues[i].first==value)
{ {
comboBox->setCurrentIndex (i); comboBox->setCurrentIndex (i);
if(!tryDisplay)
comboBox->showPopup();
break; break;
} }
} }

Loading…
Cancel
Save