summaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r--qt-ui/modeldelegates.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 31267810c..9bc633191 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -262,6 +262,10 @@ void AirTypesDelegate::revertModelData(QWidget* widget, QAbstractItemDelegate::E
void AirTypesDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
{
+ if (!index.isValid())
+ return;
+ QComboBox *combo = qobject_cast<QComboBox*>(editor);
+ model->setData(index, QVariant(combo->currentText()));
}
AirTypesDelegate::AirTypesDelegate(QObject* parent) : ComboBoxDelegate(airTypes(), parent)