mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: ensure that after a dive edit the profile is redrawn
Normally this is triggered when the DiveDetailsView component is completed, but since QML isn't recreating this component unless we switch to a dive a couple of spots in the dive list away from this one, we wouldn't get any changes in the data reflected in the profile. But since this now redraws the same dive that potentially was drawn last, we need to make sure we call plotDive() with force=true. I also suspect that this could help with the strange bug that sometimes we show a blank profile after certain edits. See #1013 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
10af45d6dc
commit
2bf6f4e45d
2 changed files with 4 additions and 1 deletions
|
@ -32,6 +32,9 @@ Item {
|
|||
detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText, detailsEdit.suitText,
|
||||
detailsEdit.buddyText, detailsEdit.divemasterText, detailsEdit.weightText, detailsEdit.notesText,
|
||||
detailsEdit.startpressureText, detailsEdit.endpressureText, detailsEdit.gasmixText)
|
||||
// trigger the profile to be redrawn
|
||||
QMLProfile.diveId = dive_id
|
||||
|
||||
// apply the changes to the dive detail view - since the edit could have changed the order
|
||||
// first make sure that we are looking at the correct dive - our model allows us to look
|
||||
// up the index based on the unique dive_id
|
||||
|
|
|
@ -53,7 +53,7 @@ void QMLProfile::setDiveId(const QString &diveId)
|
|||
if (!d)
|
||||
return;
|
||||
qDebug() << "setDiveId called with valid dive" << d->number;
|
||||
m_profileWidget->plotDive(d);
|
||||
m_profileWidget->plotDive(d, true);
|
||||
}
|
||||
|
||||
qreal QMLProfile::devicePixelRatio() const
|
||||
|
|
Loading…
Add table
Reference in a new issue