mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Draw the Ceiling in red if preferences are marked for that.
This code actually uses the preferences for something. It will show and hide the calculated ceiling in red if the prefrerences are changed for that. One bad thing that I did in this commit ( so it was easy to try ) is that a preference change will redraw the whole graph - not optimized. I'll make this better in a later commit so that only the affected items will be redrawn. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8831bf6350
commit
b08da94007
4 changed files with 63 additions and 1 deletions
|
@ -39,7 +39,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
|
|||
cartesianPlane(new DiveCartesianPlane()),
|
||||
meanDepth(new DiveLineItem()),
|
||||
diveComputerText(new DiveTextItem()),
|
||||
diveCeiling(NULL)
|
||||
diveCeiling(NULL),
|
||||
reportedCeiling(NULL)
|
||||
{
|
||||
setScene(new QGraphicsScene());
|
||||
scene()->setSceneRect(0, 0, 100, 100);
|
||||
|
@ -386,6 +387,18 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
|||
allTissues.append(tissueItem);
|
||||
scene()->addItem(tissueItem);
|
||||
}
|
||||
|
||||
if(reportedCeiling){
|
||||
scene()->removeItem(reportedCeiling);
|
||||
delete reportedCeiling;
|
||||
}
|
||||
reportedCeiling = new DiveReportedCeiling();
|
||||
reportedCeiling->setHorizontalAxis(timeAxis);
|
||||
reportedCeiling->setVerticalAxis(profileYAxis);
|
||||
reportedCeiling->setModel(dataModel);
|
||||
reportedCeiling->setVerticalDataColumn(DivePlotDataModel::CEILING);
|
||||
reportedCeiling->setHorizontalDataColumn(DivePlotDataModel::TIME);
|
||||
scene()->addItem(reportedCeiling);
|
||||
emit startProfileState();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue