On Thu, Apr 17, 2014 at 10:19 AM, Dirk Hohndel <[email protected]> wrote: > On Thu, 2014-04-17 at 10:54 +0200, Robert Helling wrote: >> The update of the profile only works partially upon changes in the list of >> available gases. > > This may have something to do with these errors at start: > > $ ./subsurface > Object::connect: No such signal CylindersModel::dataChanged(QModelIndex, int, > int) in qt-ui/diveplanner.cpp:974 > Object::connect: No such slot DivePlannerPointsModel::drawProfile() in > qt-ui/diveplanner.cpp:977 > Object::connect: No such slot DivePlannerPointsModel::drawProfile() in > qt-ui/diveplanner.cpp:979 > > I recommend fixing those next :-) > Attached patch addresses the object-slot mismatch warning by maintaining the intended functionality.
Thank you, Lakshman
From 115077ac43a48ca4aa8b5a08c6051955119caf1c Mon Sep 17 00:00:00 2001 From: Lakshman Anumolu <[email protected]> Date: Thu, 17 Apr 2014 21:35:20 -0500 Subject: [PATCH] Fixed mismatched connections Fixed connections to call drawProfile() in diveplanner whenever cylinder table widget is edited. Signed-off-by: Lakshman Anumolu <[email protected]> --- qt-ui/diveplanner.cpp | 14 ++++++++++---- qt-ui/diveplanner.h | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index ac7a208..9382667 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 8352d6a..91f8744 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); -- 1.8.3.2
_______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
