LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
ui::qt::ActorsPanel Class Reference

Panel showing aggregate statistics per "actor" in the visible event set. More...

#include <ActorsPanel.hpp>

Inheritance diagram for ui::qt::ActorsPanel:
Inheritance graph
Collaboration diagram for ui::qt::ActorsPanel:
Collaboration graph

Classes

struct  ActorData
 Per-actor statistics accumulated during a Refresh pass. More...
 
struct  GroupedActorData
 

Public Slots

void Refresh ()
 Recompute actor statistics from the current visible row set.
 
void SetDefinitions (const std::vector< ActorDefinition > &defs)
 Set actor definitions and refresh the tree.
 
void RestoreUncheckedActors (const std::set< std::string > &unchecked)
 Restore the set of unchecked actors from a saved filter.
 

Signals

void ActorDirectionChanged (const QString &defName, const QString &actorName, bool isSubActor, const QString &newTarget)
 

Public Member Functions

 ActorsPanel (db::EventsContainer &events, EventsTableView *eventsView, QWidget *parent=nullptr)
 
std::set< std::string > GetUncheckedActors () const
 Get the set of currently unchecked actors (for filter persistence).
 

Private Types

using GroupData = GroupedActorData
 Alias used in the sequence-diagram lambda capture.
 

Private Member Functions

void BuildLayout ()
 
void RefreshWithDefinitions (const std::vector< unsigned long > &vis)
 
void RefreshFromDiscoveredActors (const analyzer::ActorDiscoveryResult &discovered, const std::vector< unsigned long > &vis)
 
void PopulateActorTree (size_t totalVisible)
 
void ApplyCheckedFilter ()
 
void ApplyToView (const std::vector< unsigned long > *indices)
 
bool ViewShowsOwnFilter () const
 
bool ViewShowsOwnFilterOf (std::uint64_t generation) const
 Like ViewShowsOwnFilter(), but events appended since do not count.
 
void ShowActorContextMenu (const QPoint &pos)
 
void ShowSequenceDiagram ()
 
std::vector< unsigned long > VisibleIndices () const
 

Private Attributes

db::EventsContainer & m_events
 
EventsTableView * m_eventsView
 
QTreeWidget * m_tree {nullptr}
 
QLabel * m_statusLabel {nullptr}
 
QPushButton * m_seqDiagBtn {nullptr}
 
std::vector< ActorDefinition > m_definitions
 
std::map< std::string, GroupedActorData > m_groupedCache
 
std::set< std::string > m_uncheckedActors
 
bool m_ignoreNextRefresh {false}
 
std::uint64_t m_cacheGeneration {0}
 
bool m_ownFilterCleared {false}
 
std::vector< unsigned long > m_ownFilter
 
std::size_t m_ownFilterSize {0}
 
std::uint64_t m_ownFilterGeneration {0}
 
bool m_ownFilterApplied {false}
 
bool m_ownActorFilter {false}
 The last ApplyToView() set an actor filter (not "no actor filter").
 
std::optional< std::vector< unsigned long > > m_upstreamFilter
 The filter that was set before the actor filter (none: no filter).
 

Detailed Description

Panel showing aggregate statistics per "actor" in the visible event set.

An actor is any field value (e.g. user, IP, process ID) that can be used to identify who performed an action. The panel organises actors by their ActorDefinition, showing hierarchical data with counts, types, and timestamps.

Clicking a checkbox on a row filters the events view to show only events from the selected actors. Multiple actors can be selected.

Refreshes automatically via a modelReset connection wired up in MainWindow.

Member Typedef Documentation

◆ GroupData

Alias used in the sequence-diagram lambda capture.

Constructor & Destructor Documentation

◆ ActorsPanel()

ui::qt::ActorsPanel::ActorsPanel ( db::EventsContainer &  events,
EventsTableView *  eventsView,
QWidget *  parent = nullptr 
)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ ActorDirectionChanged

void ui::qt::ActorsPanel::ActorDirectionChanged ( const QString &  defName,
const QString &  actorName,
bool  isSubActor,
const QString &  newTarget 
)
signal

Emitted when the user changes the actor direction in a context menu. Arguments: (definition name, actor name, isSubActor, new target actor name)

Here is the caller graph for this function:

◆ ApplyCheckedFilter()

void ui::qt::ActorsPanel::ApplyCheckedFilter ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ApplyToView()

void ui::qt::ActorsPanel::ApplyToView ( const std::vector< unsigned long > *  indices)
private

Passes the actor filter to the events view (nullptr clears it) and remembers it, so the refresh caused by it can be told apart.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildLayout()

void ui::qt::ActorsPanel::BuildLayout ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUncheckedActors()

std::set< std::string > ui::qt::ActorsPanel::GetUncheckedActors ( ) const
inline

Get the set of currently unchecked actors (for filter persistence).

◆ PopulateActorTree()

void ui::qt::ActorsPanel::PopulateActorTree ( size_t  totalVisible)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Refresh

void ui::qt::ActorsPanel::Refresh ( )
slot

Recompute actor statistics from the current visible row set.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RefreshFromDiscoveredActors()

void ui::qt::ActorsPanel::RefreshFromDiscoveredActors ( const analyzer::ActorDiscoveryResult &  discovered,
const std::vector< unsigned long > &  vis 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RefreshWithDefinitions()

void ui::qt::ActorsPanel::RefreshWithDefinitions ( const std::vector< unsigned long > &  vis)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RestoreUncheckedActors

void ui::qt::ActorsPanel::RestoreUncheckedActors ( const std::set< std::string > &  unchecked)
slot

Restore the set of unchecked actors from a saved filter.

Here is the call graph for this function:

◆ SetDefinitions

void ui::qt::ActorsPanel::SetDefinitions ( const std::vector< ActorDefinition > &  defs)
slot

Set actor definitions and refresh the tree.

Here is the call graph for this function:

◆ ShowActorContextMenu()

void ui::qt::ActorsPanel::ShowActorContextMenu ( const QPoint &  pos)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowSequenceDiagram()

void ui::qt::ActorsPanel::ShowSequenceDiagram ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ViewShowsOwnFilter()

bool ui::qt::ActorsPanel::ViewShowsOwnFilter ( ) const
private

True while the events view still shows exactly the filter of the last ApplyToView() on the same data.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ViewShowsOwnFilterOf()

bool ui::qt::ActorsPanel::ViewShowsOwnFilterOf ( std::uint64_t  generation) const
private

Like ViewShowsOwnFilter(), but events appended since do not count.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VisibleIndices()

std::vector< unsigned long > ui::qt::ActorsPanel::VisibleIndices ( ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_cacheGeneration

std::uint64_t ui::qt::ActorsPanel::m_cacheGeneration {0}
private

Container generation m_groupedCache was built for (indices are stale once the container is cleared or merged).

◆ m_definitions

std::vector<ActorDefinition> ui::qt::ActorsPanel::m_definitions
private

◆ m_events

db::EventsContainer& ui::qt::ActorsPanel::m_events
private

◆ m_eventsView

EventsTableView* ui::qt::ActorsPanel::m_eventsView
private

◆ m_groupedCache

std::map<std::string, GroupedActorData> ui::qt::ActorsPanel::m_groupedCache
private

◆ m_ignoreNextRefresh

bool ui::qt::ActorsPanel::m_ignoreNextRefresh {false}
private

◆ m_ownActorFilter

bool ui::qt::ActorsPanel::m_ownActorFilter {false}
private

The last ApplyToView() set an actor filter (not "no actor filter").

◆ m_ownFilter

std::vector<unsigned long> ui::qt::ActorsPanel::m_ownFilter
private

◆ m_ownFilterApplied

bool ui::qt::ActorsPanel::m_ownFilterApplied {false}
private

◆ m_ownFilterCleared

bool ui::qt::ActorsPanel::m_ownFilterCleared {false}
private

◆ m_ownFilterGeneration

std::uint64_t ui::qt::ActorsPanel::m_ownFilterGeneration {0}
private

◆ m_ownFilterSize

std::size_t ui::qt::ActorsPanel::m_ownFilterSize {0}
private

◆ m_seqDiagBtn

QPushButton* ui::qt::ActorsPanel::m_seqDiagBtn {nullptr}
private

◆ m_statusLabel

QLabel* ui::qt::ActorsPanel::m_statusLabel {nullptr}
private

◆ m_tree

QTreeWidget* ui::qt::ActorsPanel::m_tree {nullptr}
private

◆ m_uncheckedActors

std::set<std::string> ui::qt::ActorsPanel::m_uncheckedActors
private

◆ m_upstreamFilter

std::optional<std::vector<unsigned long> > ui::qt::ActorsPanel::m_upstreamFilter
private

The filter that was set before the actor filter (none: no filter).


The documentation for this class was generated from the following files: