From 5e84858c0b4cef213cdaf67932217f9f33e3361f Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sat, 18 Apr 2015 10:07:53 +1000 Subject: [PATCH] Change the cell edit selection behaviour of the nested tables. Also auto-expand the enum delegate selections (both main table as well as nested table in the dialogue subview) --- apps/opencs/view/world/dialoguesubview.cpp | 2 ++ apps/opencs/view/world/enumdelegate.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index 10a192668..9d718cf81 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -444,6 +444,8 @@ void CSVWorld::EditWidget::remake(int row) NestedTable* table = new NestedTable(mDocument, mNestedModels.back(), this); // FIXME: does not work well when enum delegates are used //table->resizeColumnsToContents(); + table->setEditTriggers(QAbstractItemView::CurrentChanged); + table->setSelectionBehavior(QAbstractItemView::SelectItems); QLabel* label = diff --git a/apps/opencs/view/world/enumdelegate.cpp b/apps/opencs/view/world/enumdelegate.cpp index eb523f781..c635948a3 100644 --- a/apps/opencs/view/world/enumdelegate.cpp +++ b/apps/opencs/view/world/enumdelegate.cpp @@ -88,6 +88,7 @@ void CSVWorld::EnumDelegate::setEditorData (QWidget *editor, const QModelIndex& if (mValues[i].first==value) { comboBox->setCurrentIndex (i); + comboBox->showPopup(); break; } }