From 48a6006202a5f8c5c8d006fd616983337b39514e Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sat, 18 Apr 2015 14:16:55 +1000 Subject: [PATCH] Prevent enum delegates from auto expanding when opening a dialogue subview. --- apps/opencs/view/world/dialoguesubview.cpp | 3 +-- apps/opencs/view/world/enumdelegate.cpp | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index 9d718cf81..9358bf6c7 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -444,10 +444,9 @@ 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->setEditTriggers(QAbstractItemView::SelectedClicked | QAbstractItemView::CurrentChanged); table->setSelectionBehavior(QAbstractItemView::SelectItems); - QLabel* label = new QLabel (mTable->headerData (i, Qt::Horizontal, Qt::DisplayRole).toString(), mMainWidget); diff --git a/apps/opencs/view/world/enumdelegate.cpp b/apps/opencs/view/world/enumdelegate.cpp index c635948a3..bda93678a 100644 --- a/apps/opencs/view/world/enumdelegate.cpp +++ b/apps/opencs/view/world/enumdelegate.cpp @@ -88,7 +88,8 @@ void CSVWorld::EnumDelegate::setEditorData (QWidget *editor, const QModelIndex& if (mValues[i].first==value) { comboBox->setCurrentIndex (i); - comboBox->showPopup(); + if(!tryDisplay) + comboBox->showPopup(); break; } }