mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use temperature_t for temperatures in struct stats_t
Use struct temperature_t for temperatures in struct stats_t and use get_temperature_string() when printing these temperatures for statistics and HTML export. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
928e7ed869
commit
95a23cf470
8 changed files with 48 additions and 49 deletions
|
@ -591,16 +591,15 @@ void DiveTemperatureItem::modelDataChanged(const QModelIndex &topLeft, const QMo
|
|||
|
||||
void DiveTemperatureItem::createTextItem(int sec, int mkelvin)
|
||||
{
|
||||
double deg;
|
||||
const char *unit;
|
||||
deg = get_temp_units(mkelvin, &unit);
|
||||
temperature_t temp;
|
||||
temp.mkelvin = mkelvin;
|
||||
|
||||
DiveTextItem *text = new DiveTextItem(this);
|
||||
text->setAlignment(Qt::AlignRight | Qt::AlignBottom);
|
||||
text->setBrush(getColor(TEMP_TEXT));
|
||||
text->setPos(QPointF(hAxis->posAtValue(sec), vAxis->posAtValue(mkelvin)));
|
||||
text->setScale(0.8); // need to call this BEFORE setText()
|
||||
text->setText(QString("%1%2").arg(deg, 0, 'f', 1).arg(unit));
|
||||
text->setText(get_temperature_string(temp, true));
|
||||
texts.append(text);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue