From b42e19e36b4d80716059011581851c8600338cbb Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 15 Jan 2021 22:48:32 +0100 Subject: statistics: convert bar series to QSGNodes To this end, two new ChartItems were added: A "bar" (a rectangle with a border) and a "text" (multiple lines of text). It turns out that the text on the bars now looks atrocious. The reason appears to be that the antialiasing of the font-rendering does not blend into the alpha channel, but into a supposed background color? This will have to be investigated. Signed-off-by: Berthold Stoeger --- stats/barseries.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'stats/barseries.h') diff --git a/stats/barseries.h b/stats/barseries.h index 33a36395e..5655bc977 100644 --- a/stats/barseries.h +++ b/stats/barseries.h @@ -10,9 +10,11 @@ #include #include -#include +#include class QGraphicsScene; +class ChartBarItem; +class ChartTextItem; struct InformationBox; struct StatsVariable; @@ -80,17 +82,16 @@ private: // A label that is composed of multiple lines struct BarLabel { - std::vector> items; - double totalWidth, totalHeight; // Size of the item + std::unique_ptr item; bool isOutside; // Is shown outside of bar - BarLabel(QGraphicsScene *scene, const std::vector &labels, int bin_nr, int binCount); + BarLabel(StatsView &view, const std::vector &labels, int bin_nr, int binCount); void setVisible(bool visible); void updatePosition(bool horizontal, bool center, const QRectF &rect, int bin_nr, int binCount); void highlight(bool highlight, int bin_nr, int binCount); }; struct SubItem { - std::unique_ptr item; + std::unique_ptr item; std::unique_ptr label; double value_from; double value_to; @@ -107,7 +108,7 @@ private: const QString binName; StatsOperationResults res; int total; - Item(QGraphicsScene *scene, BarSeries *series, double lowerBound, double upperBound, + Item(BarSeries *series, double lowerBound, double upperBound, std::vector subitems, const QString &binName, const StatsOperationResults &res, int total, bool horizontal, bool stacked, int binCount); @@ -118,7 +119,6 @@ private: std::unique_ptr information; std::vector items; - std::vector barLabels; bool horizontal; bool stacked; QString categoryName; -- cgit v1.2.3-70-g09d2