mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: Add combo box for dive mode selection
I am not really sure what I am doing here but I copied code from the gas selection. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
969dfee9ec
commit
b8c94cad69
6 changed files with 71 additions and 0 deletions
|
@ -407,6 +407,24 @@ AirTypesDelegate::AirTypesDelegate(QObject *parent) : ComboBoxDelegate(GasSelect
|
|||
{
|
||||
}
|
||||
|
||||
void DiveTypesDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint)
|
||||
{
|
||||
Q_UNUSED(widget)
|
||||
Q_UNUSED(hint)
|
||||
}
|
||||
|
||||
void DiveTypesDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return;
|
||||
QComboBox *combo = qobject_cast<QComboBox *>(editor);
|
||||
model->setData(index, QVariant(combo->currentIndex()));
|
||||
}
|
||||
|
||||
DiveTypesDelegate::DiveTypesDelegate(QObject *parent) : ComboBoxDelegate(DiveTypeSelectionModel::instance(), parent, false)
|
||||
{
|
||||
}
|
||||
|
||||
SpinBoxDelegate::SpinBoxDelegate(int min, int max, int step, QObject *parent):
|
||||
QStyledItemDelegate(parent),
|
||||
min(min),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue