Hack to make tank selection work on Mac

This is an ugly hack as it partially breaks the ability to abort a selection
(so if you click outside of the combobox, the last value you hovered over is
selected). But this seems much better than not being able to select a different
tank at all.

Fixes #275

(and by 'Fixes' I mean "hacks to sort of make work"... but the trac automation
is rather inflexible in which words it understands...)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-21 08:08:04 -08:00
parent 58088d5897
commit a24eb8ac12

View file

@ -224,7 +224,11 @@ TankInfoDelegate::TankInfoDelegate(QObject* parent): ComboBoxDelegate(TankInfoMo
void TankInfoDelegate::revertModelData(QWidget* widget, QAbstractItemDelegate::EndEditHint hint)
{
if (hint == QAbstractItemDelegate::NoHint || hint == QAbstractItemDelegate::RevertModelCache){
if (
#if !defined __APPLE__
hint == QAbstractItemDelegate::NoHint ||
#endif
hint == QAbstractItemDelegate::RevertModelCache) {
CylindersModel *mymodel = qobject_cast<CylindersModel *>(currCombo.model);
mymodel->setData(IDX(CylindersModel::TYPE), currCylinderData.type, Qt::EditRole);
mymodel->passInData(IDX(CylindersModel::WORKINGPRESS), currCylinderData.pressure);