LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
TimeRangeFilterPanel.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <QWidget>
31#include <string>
32#include <vector>
33
34class QComboBox;
35class QLabel;
36class QLineEdit;
37class QPushButton;
38
39namespace db {
40class EventsContainer;
41}
42
43namespace ui::qt {
44class EventsTableView;
45}
46
47namespace ui::qt {
48
62{
63 Q_OBJECT
64
65public:
67 struct State
68 {
69 std::string field {"timestamp"};
70 std::string from;
71 std::string to;
72 bool active {false};
73 };
74
76 EventsTableView* eventsView,
77 QWidget* parent = nullptr);
78
80 [[nodiscard]] State GetState() const;
81
83 void SetState(const State& s);
84
86 void Apply();
87
89 void Clear();
90
91signals:
94
97
98private slots:
99 void HandleAutoDetect();
100 void HandleApply();
101 void HandleClear();
102
103private:
104 void BuildLayout();
105
107 [[nodiscard]] std::vector<unsigned long> ComputeMatchingIndices() const;
108
111
112 QComboBox* m_fieldCombo {nullptr};
113 QLineEdit* m_fromEdit {nullptr};
114 QLineEdit* m_toEdit {nullptr};
115 QLabel* m_statusLabel {nullptr};
116 bool m_active {false};
117};
118
119} // namespace ui::qt
High-performance, thread-safe container for managing large collections of LogEvent objects.
Definition EventsContainer.hpp:129
Definition EventsTableView.hpp:29
Panel for filtering events by a timestamp range.
Definition TimeRangeFilterPanel.hpp:62
void FilterApplied()
Emitted after the filter has been applied to the events view.
db::EventsContainer & m_events
Definition TimeRangeFilterPanel.hpp:109
std::vector< unsigned long > ComputeMatchingIndices() const
Scans all events and returns indices whose timestamp falls in [from, to].
Definition TimeRangeFilterPanel.cpp:253
QLineEdit * m_fromEdit
Definition TimeRangeFilterPanel.hpp:113
void BuildLayout()
Definition TimeRangeFilterPanel.cpp:35
void HandleAutoDetect()
Definition TimeRangeFilterPanel.cpp:143
State GetState() const
Returns the current widget state (field, from, to, active).
Definition TimeRangeFilterPanel.cpp:106
QLineEdit * m_toEdit
Definition TimeRangeFilterPanel.hpp:114
void HandleClear()
Definition TimeRangeFilterPanel.cpp:228
EventsTableView * m_eventsView
Definition TimeRangeFilterPanel.hpp:110
void HandleApply()
Definition TimeRangeFilterPanel.cpp:185
void FilterCleared()
Emitted after the filter has been cleared.
QComboBox * m_fieldCombo
Definition TimeRangeFilterPanel.hpp:112
void Clear()
Clears the time-range filter (shows all events).
Definition TimeRangeFilterPanel.cpp:134
void SetState(const State &s)
Restores state from a profile. Does NOT automatically apply the filter.
Definition TimeRangeFilterPanel.cpp:116
bool m_active
Definition TimeRangeFilterPanel.hpp:116
void Apply()
Applies the filter to the events view immediately.
Definition TimeRangeFilterPanel.cpp:129
QLabel * m_statusLabel
Definition TimeRangeFilterPanel.hpp:115
Database and data model components for the LogViewer application.
Definition EventsContainer.cpp:17
Definition ConfigEditorDialog.cpp:19
Plain-data snapshot of the panel state — used by filter profiles.
Definition TimeRangeFilterPanel.hpp:68
bool active
Definition TimeRangeFilterPanel.hpp:72
std::string field
Definition TimeRangeFilterPanel.hpp:69
std::string to
inclusive upper bound, empty = no upper bound
Definition TimeRangeFilterPanel.hpp:71
std::string from
inclusive lower bound, empty = no lower bound
Definition TimeRangeFilterPanel.hpp:70