diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-28 20:55:34 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-28 20:55:34 +0100 |
commit | 270878c74bb4c72e8ceab42b3758329f1edae6c2 (patch) | |
tree | 4b416957892a666ddc0800f5ae68b1205030735e /options/slider.cpp | |
parent | bfd866c6df75ad9dd805744c3acd2adf1b6644d8 (diff) |
options/slider: simplify, sprinkle constexpr
Diffstat (limited to 'options/slider.cpp')
-rw-r--r-- | options/slider.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/options/slider.cpp b/options/slider.cpp index b64358c1..76d1dddc 100644 --- a/options/slider.cpp +++ b/options/slider.cpp @@ -71,11 +71,11 @@ int slider_value::to_slider_pos(int q_min, int q_max) const return int(std::round(((cur() - min()) * q_diff / div) + q_min)); } -} // end ns options +} // ns options -using slider_value = options::slider_value; +using options::slider_value; -QDataStream& operator << (QDataStream& out, const options::slider_value& v) +QDataStream& operator << (QDataStream& out, const slider_value& v) { out << v.cur() << v.min() @@ -83,13 +83,13 @@ QDataStream& operator << (QDataStream& out, const options::slider_value& v) return out; } -QDebug operator << (QDebug dbg, const options::slider_value& v) +QDebug operator << (QDebug dbg, const slider_value& v) { return dbg << QStringLiteral("slider_value(cur=%1, min=%2, max=%3)") .arg(v.cur()).arg(v.min()).arg(v.max()).toUtf8().constData(); } -QDataStream& operator >> (QDataStream& in, options::slider_value& v) +QDataStream& operator >> (QDataStream& in, slider_value& v) { double cur = 0, min = 0, max = 0; in >> cur >> min >> max; |