mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix partial pressure graph thresholds
Since we only store things in the preferences if they are different from the default, the existing code that simply compared with the settings value didn't work when people used the defaults. We now compare to the actual preference at runtime which should address that. Fixes #731 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f0cee72444
commit
89e7cae854
3 changed files with 9 additions and 9 deletions
|
@ -833,14 +833,14 @@ void PartialPressureGasItem::modelDataChanged(const QModelIndex &topLeft, const
|
|||
alertPolygons.clear();
|
||||
QSettings s;
|
||||
s.beginGroup("TecDetails");
|
||||
double threshould = s.value(threshouldKey).toDouble();
|
||||
double threshold = *thresholdPtr;
|
||||
bool inAlertFragment = false;
|
||||
for (int i = 0; i < dataModel->rowCount(); i++, entry++) {
|
||||
double value = dataModel->index(i, vDataColumn).data().toDouble();
|
||||
int time = dataModel->index(i, hDataColumn).data().toInt();
|
||||
QPointF point(hAxis->posAtValue(time), vAxis->posAtValue(value));
|
||||
poly.push_back(point);
|
||||
if (value >= threshould) {
|
||||
if (value >= threshold) {
|
||||
if (inAlertFragment) {
|
||||
alertPolygons.back().push_back(point);
|
||||
} else {
|
||||
|
@ -873,9 +873,9 @@ void PartialPressureGasItem::paint(QPainter *painter, const QStyleOptionGraphics
|
|||
painter->restore();
|
||||
}
|
||||
|
||||
void PartialPressureGasItem::setThreshouldSettingsKey(const QString &threshouldSettingsKey)
|
||||
void PartialPressureGasItem::setThreshouldSettingsKey(double *prefPointer)
|
||||
{
|
||||
threshouldKey = threshouldSettingsKey;
|
||||
thresholdPtr = prefPointer;
|
||||
}
|
||||
|
||||
PartialPressureGasItem::PartialPressureGasItem()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue