Relax comparsion for floating point

This commit is contained in:
Chocobo1 2017-04-05 15:03:14 +08:00 committed by sledgehammer999
parent cdcafecb44
commit 112a24f9b6
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2

View file

@ -93,7 +93,7 @@ public:
case DOWN_SPEED: case DOWN_SPEED:
case UP_SPEED:{ case UP_SPEED:{
qreal speed = index.data().toDouble(); qreal speed = index.data().toDouble();
if (speed == 0.0) if (speed <= 0.0)
break; break;
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter; opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
QItemDelegate::drawDisplay(painter, opt, opt.rect, Utils::Misc::friendlyUnit(speed, true)); QItemDelegate::drawDisplay(painter, opt, opt.rect, Utils::Misc::friendlyUnit(speed, true));