|
@@ -1,4 +1,4 @@
|
|
|
-From caacc9bc622238ca48674ea6f40d07466e4b97a5 Mon Sep 17 00:00:00 2001
|
|
|
+From 01de3217e14b52e44356185729f804460147c85c Mon Sep 17 00:00:00 2001
|
|
|
From: Valentin Ochs <a@0au.de>
|
|
|
Date: Sat, 20 Jun 2020 16:01:27 +0200
|
|
|
Subject: [PATCH] Replace obsolete/deprecated Qt methods
|
|
@@ -9,6 +9,8 @@ resolved in pv/util.cpp.]
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
|
[Fabrice: restore original patch in pv/util.cpp for 0.4.2]
|
|
|
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
|
+[Dario: make the patch to be applied with fuzz factor 0]
|
|
|
+Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
|
|
---
|
|
|
pv/util.cpp | 21 +++++++++++++++++++--
|
|
|
pv/util.hpp | 10 ++++++++++
|
|
@@ -18,7 +20,7 @@ Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
|
5 files changed, 33 insertions(+), 5 deletions(-)
|
|
|
|
|
|
diff --git a/pv/util.cpp b/pv/util.cpp
|
|
|
-index 49b9467c..2a63038d 100644
|
|
|
+index 9a9a5065a2e1..b0c29f304287 100644
|
|
|
--- a/pv/util.cpp
|
|
|
+++ b/pv/util.cpp
|
|
|
@@ -137,7 +137,7 @@ QString format_time_si(const Timestamp& v, SIPrefix prefix,
|
|
@@ -30,7 +32,7 @@ index 49b9467c..2a63038d 100644
|
|
|
ts << qSetRealNumberPrecision(precision) << (v * multiplier);
|
|
|
ts << ' ' << prefix << unit;
|
|
|
|
|
|
-@@ -171,7 +171,7 @@ QString format_value_si(double v, SIPrefix prefix, unsigned precision,
|
|
|
+@@ -175,7 +175,7 @@ QString format_value_si(double v, SIPrefix prefix, unsigned precision,
|
|
|
QString s;
|
|
|
QTextStream ts(&s);
|
|
|
if (sign && (v != 0))
|
|
@@ -39,7 +41,7 @@ index 49b9467c..2a63038d 100644
|
|
|
ts.setRealNumberNotation(QTextStream::FixedNotation);
|
|
|
ts.setRealNumberPrecision(precision);
|
|
|
ts << (v * multiplier) << ' ' << prefix << unit;
|
|
|
-@@ -281,5 +281,22 @@ vector<string> split_string(string text, string separator)
|
|
|
+@@ -285,5 +285,22 @@ vector<string> split_string(string text, string separator)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -63,7 +65,7 @@ index 49b9467c..2a63038d 100644
|
|
|
} // namespace util
|
|
|
} // namespace pv
|
|
|
diff --git a/pv/util.hpp b/pv/util.hpp
|
|
|
-index dd7be222..ad904f85 100644
|
|
|
+index e1640c4a374d..a6cdfdcad4d9 100644
|
|
|
--- a/pv/util.hpp
|
|
|
+++ b/pv/util.hpp
|
|
|
@@ -30,6 +30,7 @@
|
|
@@ -74,7 +76,7 @@ index dd7be222..ad904f85 100644
|
|
|
|
|
|
using std::string;
|
|
|
using std::vector;
|
|
|
-@@ -137,6 +138,15 @@ QString format_time_minutes(const Timestamp& t, signed precision = 0,
|
|
|
+@@ -138,6 +139,15 @@ QString format_time_minutes(const Timestamp& t, signed precision = 0,
|
|
|
|
|
|
vector<string> split_string(string text, string separator);
|
|
|
|
|
@@ -91,10 +93,10 @@ index dd7be222..ad904f85 100644
|
|
|
} // namespace pv
|
|
|
|
|
|
diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp
|
|
|
-index 9c7196bf..1ee7ae9f 100644
|
|
|
+index 1cc89feb67ae..0347b3327b27 100644
|
|
|
--- a/pv/views/trace/decodetrace.cpp
|
|
|
+++ b/pv/views/trace/decodetrace.cpp
|
|
|
-@@ -103,7 +103,8 @@ DecodeTrace::DecodeTrace(pv::Session &session,
|
|
|
+@@ -164,7 +164,8 @@ DecodeTrace::DecodeTrace(pv::Session &session,
|
|
|
|
|
|
// Determine shortest string we want to see displayed in full
|
|
|
QFontMetrics m(QApplication::font());
|
|
@@ -102,13 +104,13 @@ index 9c7196bf..1ee7ae9f 100644
|
|
|
+ // e.g. two hex characters
|
|
|
+ min_useful_label_width_ = util::text_width(m, "XX");
|
|
|
|
|
|
- // For the base color, we want to start at a very different color for
|
|
|
- // every decoder stack, so multiply the index with a number that is
|
|
|
+ default_row_height_ = (ViewItemPaintParams::text_height() * 6) / 4;
|
|
|
+ annotation_height_ = (ViewItemPaintParams::text_height() * 5) / 4;
|
|
|
diff --git a/pv/views/trace/ruler.cpp b/pv/views/trace/ruler.cpp
|
|
|
-index acea8a36..68134966 100644
|
|
|
+index 555794fc42c6..83ffed281b5f 100644
|
|
|
--- a/pv/views/trace/ruler.cpp
|
|
|
+++ b/pv/views/trace/ruler.cpp
|
|
|
-@@ -218,7 +218,7 @@ void Ruler::paintEvent(QPaintEvent*)
|
|
|
+@@ -283,7 +283,7 @@ void Ruler::paintEvent(QPaintEvent*)
|
|
|
const int rightedge = width();
|
|
|
const int x_tick = tick.first;
|
|
|
if ((x_tick > leftedge) && (x_tick < rightedge)) {
|
|
@@ -118,10 +120,10 @@ index acea8a36..68134966 100644
|
|
|
const int x_legend = min(max(x_tick, x_left_bound), x_right_bound);
|
|
|
p.drawText(x_legend, ValueMargin, 0, text_height,
|
|
|
diff --git a/pv/widgets/timestampspinbox.cpp b/pv/widgets/timestampspinbox.cpp
|
|
|
-index 21b3d0d7..383aed1f 100644
|
|
|
+index fea8175e8e00..01424a5b7837 100644
|
|
|
--- a/pv/widgets/timestampspinbox.cpp
|
|
|
+++ b/pv/widgets/timestampspinbox.cpp
|
|
|
-@@ -75,7 +75,7 @@ QSize TimestampSpinBox::minimumSizeHint() const
|
|
|
+@@ -76,7 +76,7 @@ QSize TimestampSpinBox::minimumSizeHint() const
|
|
|
{
|
|
|
const QFontMetrics fm(fontMetrics());
|
|
|
const int l = round(value_).str().size() + precision_ + 10;
|
|
@@ -131,5 +133,5 @@ index 21b3d0d7..383aed1f 100644
|
|
|
return QSize(w, h);
|
|
|
}
|
|
|
--
|
|
|
-2.26.2
|
|
|
+2.43.0
|
|
|
|