LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
DashboardPanel.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <QWidget>
4#include <QString>
5#include <cstdint>
6#include <memory>
7
8class QLabel;
9class QPushButton;
10class QScrollArea;
11
12namespace db {
13class EventsContainer;
14}
15
16namespace ui::qt {
17
33class DashboardPanel : public QWidget
34{
35 Q_OBJECT
36
37 public:
38 explicit DashboardPanel(QWidget* parent = nullptr);
39 ~DashboardPanel() = default;
40
44 void SetFilePath(const QString& path);
45
47 void UpdateStats();
48
50 void Refresh() { UpdateStats(); }
51
54
55 signals:
59
60 private slots:
61 void OnExportClicked();
62 void OnReportClicked();
63 void OnBookmarkClicked();
64 void OnEventsChanged();
65
66 private:
67 void CreateLayout();
68 void UpdateFileInfo();
69 void UpdateEventStats();
70 void UpdateTopActors();
71
73 static QString FormatNumber(qint64 count);
74
76 static QString GetLevelIcon(const QString& level);
77
79
80 // UI components
81 QString m_filePath;
84 std::vector<std::string> m_actorFields;
85 std::size_t m_actorFieldsEventCount {0};
86 std::uint64_t m_actorFieldsGeneration {0};
87 QLabel* m_fileNameLabel = nullptr;
88 QLabel* m_fileFormatLabel = nullptr;
89 QLabel* m_fileSizeLabel = nullptr;
90 QLabel* m_timeRangeLabel = nullptr;
91 QLabel* m_testCaseTitleLabel = nullptr;
92 QLabel* m_testCaseLabel = nullptr;
93 QLabel* m_verdictTitleLabel = nullptr;
94 QLabel* m_verdictLabel = nullptr;
95
96 QLabel* m_totalEventsLabel = nullptr;
97 QLabel* m_typeBreakdownTitleLabel = nullptr;
98 QLabel* m_typeBreakdownLabel = nullptr;
99
100 QLabel* m_topActorsLabel = nullptr;
101
102 QPushButton* m_exportButton = nullptr;
103 QPushButton* m_reportButton = nullptr;
104 QPushButton* m_bookmarkButton = nullptr;
105
106 QScrollArea* m_scrollArea = nullptr;
107};
108
109} // namespace ui::qt
High-performance, thread-safe container for managing large collections of LogEvent objects.
Definition EventsContainer.hpp:129
Dashboard panel showing log file overview and quick statistics.
Definition DashboardPanel.hpp:34
db::EventsContainer * m_events
Definition DashboardPanel.hpp:78
QLabel * m_totalEventsLabel
Definition DashboardPanel.hpp:96
QScrollArea * m_scrollArea
Definition DashboardPanel.hpp:106
QLabel * m_testCaseTitleLabel
Definition DashboardPanel.hpp:91
std::vector< std::string > m_actorFields
Definition DashboardPanel.hpp:84
void UpdateFileInfo()
Definition DashboardPanel.cpp:258
QLabel * m_fileSizeLabel
Definition DashboardPanel.hpp:89
void CreateLayout()
Definition DashboardPanel.cpp:33
void UpdateEventStats()
Definition DashboardPanel.cpp:335
void SetFilePath(const QString &path)
Path of the loaded log file (name, format, size and time range are shown for it).
Definition DashboardPanel.cpp:195
static QString FormatNumber(qint64 count)
Helper to format large numbers (1234567 → "1.2M")
Definition DashboardPanel.cpp:480
QLabel * m_verdictLabel
Definition DashboardPanel.hpp:94
QLabel * m_fileFormatLabel
Definition DashboardPanel.hpp:88
void OnEventsChanged()
Definition DashboardPanel.cpp:504
void OnReportClicked()
Definition DashboardPanel.cpp:494
void RecalculateStats()
Force immediate recalculation of statistics.
Definition DashboardPanel.hpp:53
QLabel * m_timeRangeLabel
Definition DashboardPanel.hpp:90
void UpdateTopActors()
Definition DashboardPanel.cpp:406
void OnBookmarkClicked()
Definition DashboardPanel.cpp:499
QLabel * m_typeBreakdownLabel
Definition DashboardPanel.hpp:98
QPushButton * m_bookmarkButton
Definition DashboardPanel.hpp:104
void UpdateStats()
Manually trigger stats update (called automatically on events change)
Definition DashboardPanel.cpp:248
QLabel * m_verdictTitleLabel
Definition DashboardPanel.hpp:93
QLabel * m_topActorsLabel
Definition DashboardPanel.hpp:100
std::size_t m_actorFieldsEventCount
Definition DashboardPanel.hpp:85
std::uint64_t m_actorFieldsGeneration
Definition DashboardPanel.hpp:86
void Refresh()
Refresh dashboard (called from lazy refresh cycle)
Definition DashboardPanel.hpp:50
QLabel * m_fileNameLabel
Definition DashboardPanel.hpp:87
void OnExportClicked()
Definition DashboardPanel.cpp:489
QPushButton * m_reportButton
Definition DashboardPanel.hpp:103
QLabel * m_testCaseLabel
Definition DashboardPanel.hpp:92
void SetEventsSource(db::EventsContainer *events)
Set the events container to display stats for.
Definition DashboardPanel.cpp:183
QPushButton * m_exportButton
Definition DashboardPanel.hpp:102
QLabel * m_typeBreakdownTitleLabel
Definition DashboardPanel.hpp:97
static QString GetLevelIcon(const QString &level)
Helper to get log level icon/color.
QString m_filePath
Definition DashboardPanel.hpp:81
Database and data model components for the LogViewer application.
Definition EventsContainer.cpp:17
Definition ConfigEditorDialog.cpp:19