Revert hacks now that we use Qt5 on Mac

Commits a24eb8ac12 and 0b0860d24a introduced a nasty hack that was
needed back then to make tank and weight selection work on the Mac. But it
caused other unpleasant issues (as mentioned in the commit messages).

I re-tested this with the current Qt5.3 based builds on Mac and this hack
is no longer needed.

Fixes #638

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-08-29 09:53:57 -07:00
parent ca3a6c3faf
commit e6ce9a4df1

View file

@ -247,11 +247,8 @@ TankInfoDelegate::TankInfoDelegate(QObject *parent) : ComboBoxDelegate(TankInfoM
void TankInfoDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint)
{
if (
#if !defined __APPLE__
hint == QAbstractItemDelegate::NoHint ||
#endif
hint == QAbstractItemDelegate::RevertModelCache) {
if (hint == QAbstractItemDelegate::NoHint ||
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);
@ -279,11 +276,8 @@ struct RevertWeightData {
void WSInfoDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint)
{
if (
#if !defined __APPLE__
hint == QAbstractItemDelegate::NoHint ||
#endif
hint == QAbstractItemDelegate::RevertModelCache) {
if (hint == QAbstractItemDelegate::NoHint ||
hint == QAbstractItemDelegate::RevertModelCache) {
WeightModel *mymodel = qobject_cast<WeightModel *>(currCombo.model);
mymodel->setData(IDX(WeightModel::TYPE), currWeight.type, Qt::EditRole);
mymodel->passInData(IDX(WeightModel::WEIGHT), currWeight.weight);
@ -438,4 +432,4 @@ QSize HTMLDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModel
doc.setHtml(options.text);
doc.setTextWidth(options.rect.width());
return QSize(doc.idealWidth(), doc.size().height());
}
}