1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

cleanup: reuse constructor of DiveCartesianAxis

The constructors of Time- and TemperatureAxis don't do anything.
In reasonable modern C++ we can simply reuse the constructor
of the base class with a "using" directive.

The point here is to simplify followup commits that will
add additional parameters to the constructors of the axes.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-06-02 11:24:14 +02:00 committed by Dirk Hohndel
parent d725170914
commit 7744fec0bf
2 changed files with 2 additions and 10 deletions

View file

@ -370,10 +370,6 @@ void DepthAxis::settingsChanged()
unitSystem = prefs.units.length;
}
TimeAxis::TimeAxis(ProfileWidget2 *widget) : DiveCartesianAxis(widget)
{
}
QColor TimeAxis::colorForValue(double) const
{
return QColor(Qt::blue);
@ -397,10 +393,6 @@ void TimeAxis::updateTicks(color_index_t color)
}
}
TemperatureAxis::TemperatureAxis(ProfileWidget2 *widget) : DiveCartesianAxis(widget)
{
}
QString TemperatureAxis::textForValue(double value) const
{
return QString::number(mkelvin_to_C((int)value));

View file

@ -88,7 +88,7 @@ slots:
class TimeAxis : public DiveCartesianAxis {
Q_OBJECT
public:
TimeAxis(ProfileWidget2 *widget);
using DiveCartesianAxis::DiveCartesianAxis;
void updateTicks(color_index_t color = TIME_GRID) override;
private:
QString textForValue(double value) const override;
@ -98,7 +98,7 @@ private:
class TemperatureAxis : public DiveCartesianAxis {
Q_OBJECT
public:
TemperatureAxis(ProfileWidget2 *widget);
using DiveCartesianAxis::DiveCartesianAxis;
private:
QString textForValue(double value) const override;
};