File indexing completed on 2024-12-15 03:44:59
0001 /* 0002 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #ifndef KUSERFEEDBACK_CONSOLE_CATEGORYAGGREGATOR_H 0008 #define KUSERFEEDBACK_CONSOLE_CATEGORYAGGREGATOR_H 0009 0010 #include "aggregator.h" 0011 0012 #include <memory> 0013 #include <vector> 0014 0015 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0016 namespace QtCharts { 0017 class QPieSeries; 0018 } 0019 using QtCharts::QPieSeries; 0020 #else 0021 class QPieSeries; 0022 #endif 0023 0024 namespace KUserFeedback { 0025 namespace Console { 0026 0027 class CategoryAggregationModel; 0028 class SingleRowFilterProxyModel; 0029 0030 class CategoryAggregator : public Aggregator 0031 { 0032 public: 0033 CategoryAggregator(); 0034 ~CategoryAggregator() override; 0035 0036 ChartModes chartModes() const override; 0037 QAbstractItemModel* timeAggregationModel() override; 0038 QChart* timelineChart() override; 0039 QChart* singlularChart() override; 0040 void setSingularTime(int row) override; 0041 0042 private: 0043 void updateTimelineChart(); 0044 void updateSingularChart(); 0045 void decorateSeries(QPieSeries *series, int ring) const; 0046 0047 std::unique_ptr<CategoryAggregationModel> m_model; 0048 std::unique_ptr<QChart> m_timelineChart; 0049 std::unique_ptr<QChart> m_singularChart; 0050 std::vector<SingleRowFilterProxyModel*> m_hierachicalCategories; 0051 }; 0052 0053 }} 0054 0055 #endif // KUSERFEEDBACK_CONSOLE_CATEGORYAGGREGATOR_H