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:
parent
d725170914
commit
7744fec0bf
2 changed files with 2 additions and 10 deletions
|
@ -370,10 +370,6 @@ void DepthAxis::settingsChanged()
|
||||||
unitSystem = prefs.units.length;
|
unitSystem = prefs.units.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeAxis::TimeAxis(ProfileWidget2 *widget) : DiveCartesianAxis(widget)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QColor TimeAxis::colorForValue(double) const
|
QColor TimeAxis::colorForValue(double) const
|
||||||
{
|
{
|
||||||
return QColor(Qt::blue);
|
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
|
QString TemperatureAxis::textForValue(double value) const
|
||||||
{
|
{
|
||||||
return QString::number(mkelvin_to_C((int)value));
|
return QString::number(mkelvin_to_C((int)value));
|
||||||
|
|
|
@ -88,7 +88,7 @@ slots:
|
||||||
class TimeAxis : public DiveCartesianAxis {
|
class TimeAxis : public DiveCartesianAxis {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
TimeAxis(ProfileWidget2 *widget);
|
using DiveCartesianAxis::DiveCartesianAxis;
|
||||||
void updateTicks(color_index_t color = TIME_GRID) override;
|
void updateTicks(color_index_t color = TIME_GRID) override;
|
||||||
private:
|
private:
|
||||||
QString textForValue(double value) const override;
|
QString textForValue(double value) const override;
|
||||||
|
@ -98,7 +98,7 @@ private:
|
||||||
class TemperatureAxis : public DiveCartesianAxis {
|
class TemperatureAxis : public DiveCartesianAxis {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
TemperatureAxis(ProfileWidget2 *widget);
|
using DiveCartesianAxis::DiveCartesianAxis;
|
||||||
private:
|
private:
|
||||||
QString textForValue(double value) const override;
|
QString textForValue(double value) const override;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue