aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/modeldelegates.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 97a00a461..58a7e141b 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -150,6 +150,10 @@ void TankInfoDelegate::setModelData(QWidget* editor, QAbstractItemModel* model,
int tankSize = tanks->data(tanks->index(row, TankInfoModel::ML)).toInt();
int tankPressure = tanks->data(tanks->index(row, TankInfoModel::BAR)).toInt();
+ // don't fuck the other data, jimmy.
+ if ( mymodel->data(thisindex, CylindersModel::TYPE).toString() == currCombo.activeText){
+ return;
+ }
mymodel->setData(model->index(currCombo.currRow, CylindersModel::TYPE), currCombo.activeText, Qt::EditRole);
mymodel->passInData(model->index(currCombo.currRow, CylindersModel::WORKINGPRESS), tankPressure);
mymodel->passInData(model->index(currCombo.currRow, CylindersModel::SIZE), tankSize);
@@ -175,6 +179,11 @@ void WSInfoDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, co
}
int grams = wsim->data(wsim->index(row, WSInfoModel::GR)).toInt();
QVariant v = QString(currCombo.activeText);
+
+ // don't set if it's the same as it was before setting.
+ if (mymodel->data(thisindex, WeightModel::TYPE).toString() == currCombo.activeText){
+ return;
+ }
mymodel->setData(model->index(currCombo.currRow, WeightModel::TYPE), v, Qt::EditRole);
mymodel->passInData(model->index(currCombo.currRow, WeightModel::WEIGHT), grams);
qDebug() << "Fixme, every weigth is 0.0 grams. see:" << grams;