From a24eb8ac120bf6999eeda973e06644035c51800e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 21 Nov 2013 08:08:04 -0800 Subject: 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 --- qt-ui/modeldelegates.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index cb1af8706..2b86476e1 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -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(currCombo.model); mymodel->setData(IDX(CylindersModel::TYPE), currCylinderData.type, Qt::EditRole); mymodel->passInData(IDX(CylindersModel::WORKINGPRESS), currCylinderData.pressure); -- cgit v1.2.3-70-g09d2