From 9f8577a5ea42b62808dcf3c14daa3c7ea9548961 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 13 Nov 2013 15:49:26 -0200 Subject: Fix edition of alphanumeric input on equipments. This patch fixes the edition of alphanumeric input, columns like depth accepted '23ft', '20m' or '30', with an inplicit conversion to the unit. But the code ignored that the input could have a 'ft' or 'm' ( ot anything else for that matter. Signed-off-by: Taiane Ramos Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 51faa0670..dcc16d8d6 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -195,7 +195,9 @@ void CylindersModel::passInData(const QModelIndex& index, const QVariant& value) } } -#define CHANGED(_t,_u1,_u2) value._t() != data(index, role).toString().remove(_u1).remove(_u2)._t() +#define CHANGED(_t,_u1,_u2) \ + value.toString().remove(_u1).remove(_u2)._t() != \ + data(index, role).toString().remove(_u1).remove(_u2)._t() bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, int role) { -- cgit v1.2.3-70-g09d2