40 explicit StatCard(
const QString& label,
const QString& value,
const QString& icon =
"",
41 QWidget* parent =
nullptr,
ThemeManager* themeManager =
nullptr);
50 QLabel* iconLabel_ =
nullptr;
51 QLabel* valueLabel_ =
nullptr;
52 QLabel* labelLabel_ =
nullptr;
53 QLabel* subtextLabel_ =
nullptr;
75 void setData(
const std::vector<Slice>& slices);
85 return QSize(250, 250);
89 return QSize(200, 200);
93 std::vector<Slice> slices_;
96 QColor backgroundColor_;
118 void setData(
const std::vector<Bar>& bars);
119 void setTitle(
const QString& title);
134 std::vector<Bar> bars_;
139 QColor backgroundColor_;
156 void setTitle(
const QString& title);
165 return QSize(700, 150);
169 return QSize(500, 100);
173 std::map<int, double> activityData_;
176 QColor lowActivityColor_;
177 QColor highActivityColor_;
178 QColor backgroundColor_;
179 double maxActivity_ = 0;
196 void setGames(
const std::vector<Game*>& games);
199 void onTimeRangeChanged(
int index);
200 void onGameDoubleClicked(QListWidgetItem* item);
205 void setupOverviewTab(QWidget* tab);
206 void setupPlaytimeTab(QWidget* tab);
207 void setupLibraryTab(QWidget* tab);
209 void refreshStatistics();
210 void calculateOverviewStats();
211 void calculatePlaytimeStats();
212 void calculateLibraryStats();
214 QString formatPlaytime(
double seconds)
const;
215 QString formatDate(time_t timestamp)
const;
217 std::vector<Game*> games_;
220 QComboBox* timeRangeCombo_ =
nullptr;
224 QTabWidget* tabWidget_ =
nullptr;
227 StatCard* totalGamesCard_ =
nullptr;
228 StatCard* totalPlaytimeCard_ =
nullptr;
229 StatCard* avgSessionCard_ =
nullptr;
230 StatCard* mostPlayedCard_ =
nullptr;
237 StatCard* weeklyPlaytimeCard_ =
nullptr;
238 StatCard* monthlyPlaytimeCard_ =
nullptr;
239 StatCard* longestSessionCard_ =
nullptr;
242 StatCard* installedGamesCard_ =
nullptr;
243 StatCard* favoriteGamesCard_ =
nullptr;
244 StatCard* completedGamesCard_ =
nullptr;
248 QListWidget* recentlyAddedList_ =
nullptr;
249 QListWidget* recentlyPlayedList_ =
nullptr;
void setGames(const std::vector< Game * > &games)
~GameStatisticsDialog() override=default
GameStatisticsDialog(QWidget *parent=nullptr, ThemeManager *themeManager=nullptr)
void setValue(const QString &value)
void setSubtext(const QString &subtext)
StatCard(const QString &label, const QString &value, const QString &icon="", QWidget *parent=nullptr, ThemeManager *themeManager=nullptr)