Fixed mismatched connections

Fixed connections to call drawProfile() in diveplanner whenever cylinder
table widget is edited.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lakshman 2014-04-17 21:48:00 -05:00 committed by Dirk Hohndel
parent 3027701a14
commit e871169e4c
2 changed files with 12 additions and 4 deletions

View file

@ -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;

View file

@ -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);