From e871169e4ce9ff1681a17c0ca0960c69daa8ec09 Mon Sep 17 00:00:00 2001 From: Lakshman Date: Thu, 17 Apr 2014 21:48:00 -0500 Subject: Fixed mismatched connections Fixed connections to call drawProfile() in diveplanner whenever cylinder table widget is edited. Signed-off-by: Lakshman Anumolu Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 14 ++++++++++---- qt-ui/diveplanner.h | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index ac7a208ea..93826675c 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -151,6 +151,7 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent #undef ADD_ACTION connect(plannerModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(drawProfile())); + connect(plannerModel, SIGNAL(cylinderModelEdited()), this, SLOT(drawProfile())); connect(plannerModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(pointInserted(const QModelIndex &, int, int))); @@ -972,12 +973,12 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg GasSelectionModel::instance(), SLOT(repopulate())); connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)), GasSelectionModel::instance(), SLOT(repopulate())); - connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, int, int)), - plannerModel, SLOT(drawProfile())); + connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), + plannerModel, SLOT(emitCylinderModelEdited())); connect(CylindersModel::instance(), SIGNAL(rowsInserted(QModelIndex, int, int)), - plannerModel, SLOT(drawProfile())); + plannerModel, SLOT(emitCylinderModelEdited())); connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)), - plannerModel, SLOT(drawProfile())); + plannerModel, SLOT(emitCylinderModelEdited())); ui.tableWidget->setBtnToolTip(tr("add dive data point")); connect(ui.startTime, SIGNAL(timeChanged(QTime)), plannerModel, SLOT(setStartTime(QTime))); @@ -1055,6 +1056,11 @@ bool DivePlannerPointsModel::recalcQ() return recalc; } +void DivePlannerPointsModel::emitCylinderModelEdited() +{ + cylinderModelEdited(); +} + int DivePlannerPointsModel::columnCount(const QModelIndex &parent) const { return COLUMNS; diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index 8352d6a69..91f8744d8 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -78,10 +78,12 @@ slots: void deleteTemporaryPlan(); void loadFromDive(dive *d); void restoreBackupDive(); + void emitCylinderModelEdited(); signals: void planCreated(); void planCanceled(); + void cylinderModelEdited(); private: explicit DivePlannerPointsModel(QObject *parent = 0); -- cgit v1.2.3-70-g09d2