Gas choices working, both directions ( Planner and Table )

The gas choice now works and correctly ( I hope ) calculates
the gas choosen to show on the planner. User can choose the
gas from the list on the visual planner, and also on the table.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-08-30 15:06:26 -03:00
parent 2d0e877bb2
commit 5e722a93e4
4 changed files with 41 additions and 11 deletions

View file

@ -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)