mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:23:23 +00:00
Don't recreate the tissues, but instead, reshape them.
This patch makes the Tissues be used as a 'cache', it will not be deleted untill the program closes, but whenever a new dive is selected, the old drawings of the tissues will be regenerated, Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
803623042c
commit
2f0b778f92
1 changed files with 12 additions and 15 deletions
|
@ -125,6 +125,18 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
|
|||
diveCeiling->setZValue(1);
|
||||
scene()->addItem(diveCeiling);
|
||||
|
||||
for(int i = 0; i < 16; i++){
|
||||
DiveCalculatedTissue *tissueItem = new DiveCalculatedTissue();
|
||||
tissueItem->setHorizontalAxis(timeAxis);
|
||||
tissueItem->setVerticalAxis(profileYAxis);
|
||||
tissueItem->setModel(dataModel);
|
||||
tissueItem->setVerticalDataColumn(DivePlotDataModel::TISSUE_1 + i);
|
||||
tissueItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
|
||||
tissueItem->setZValue(1);
|
||||
allTissues.append(tissueItem);
|
||||
scene()->addItem(tissueItem);
|
||||
}
|
||||
|
||||
background->setFlag(QGraphicsItem::ItemIgnoresTransformations);
|
||||
|
||||
//enum State{ EMPTY, PROFILE, EDIT, ADD, PLAN, INVALID };
|
||||
|
@ -384,21 +396,6 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
|||
|
||||
diveComputerText->setText(currentdc->model);
|
||||
diveComputerText->animateMoveTo(1 , sceneRect().height());
|
||||
|
||||
qDeleteAll(allTissues);
|
||||
allTissues.clear();
|
||||
for(int i = 0; i < 16; i++){
|
||||
DiveCalculatedTissue *tissueItem = new DiveCalculatedTissue();
|
||||
tissueItem->setHorizontalAxis(timeAxis);
|
||||
tissueItem->setVerticalAxis(profileYAxis);
|
||||
tissueItem->setModel(dataModel);
|
||||
tissueItem->setVerticalDataColumn(DivePlotDataModel::TISSUE_1 + i);
|
||||
tissueItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
|
||||
tissueItem->setZValue(1);
|
||||
allTissues.append(tissueItem);
|
||||
scene()->addItem(tissueItem);
|
||||
}
|
||||
|
||||
emit startProfileState();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue