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

#include <EventsTableView.hpp>

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

Public Slots

void JumpToTimestamp ()
 Opens an input dialog and scrolls to the event with the nearest timestamp.
 

Signals

void CurrentActualRowChanged (int actualRow)
 
void MatchInfoChanged (int current, int total)
 
void BookmarkRequested (int actualRow)
 Emitted when the user chooses "Bookmark Event" from the context menu.
 
void AddToScenarioRequested (int actualRow)
 Emitted when the user chooses "Add to Scenario" from the context menu.
 

Public Member Functions

 EventsTableView (db::EventsContainer &events, QWidget *parent=nullptr)
 
 ~EventsTableView () override
 
void RefreshColumns () override
 Rebuilds visible columns after configuration changes.
 
void RefreshView () override
 Refreshes both the underlying model and the visual control.
 
void SetFilteredEvents (const std::vector< unsigned long > &filteredIndices) override
 Applies filtered indices so only selected events are shown.
 
void ClearFilter () override
 Clears any active filter; all events become visible via O(1) path.
 
void UpdateColors () override
 Updates row colors or other visual embellishments.
 
const std::vector< unsigned long > * GetFilteredIndices () const
 
const std::vector< unsigned long > * GetBaseFilteredIndices () const
 
bool IsFilterActive () const
 True if a filter is active, even if it currently matches zero events.
 
bool HasColumnFilters () const
 
void ClearColumnFilters ()
 
void AddQuickFilterActions (QMenu &menu, const QModelIndex &cell)
 
bool ShowTimeWindow (int actualRow, int seconds)
 
bool HasTimeWindow () const
 
void ClearTimeWindow ()
 Puts back the filter that was set before ShowTimeWindow().
 
void OnDataUpdated () override
 Called when the model's data is updated.
 
void OnCurrentIndexUpdated (const int index) override
 Called when the current item index in the model is updated.
 
int CurrentActualRow () const
 
void ScrollToActualRow (int actualRow, bool takeFocus=true)
 
int ResolveToActualIndex (int modelRow) const
 
int FirstVisibleActualRow () const
 
void SyncScrollTo (int actualRow)
 
void SetSearchTerm (const QString &term, bool caseSensitive)
 
void NavigateToNextMatch ()
 
void NavigateToPrevMatch ()
 
virtual void OnAttachedToModel (class IModelObservable *)
 Called when the view is attached to a model.
 
virtual void OnDetachedFromModel ()
 Called when the view is detached from a model.
 

Private Slots

void OnColumnMoved ()
 Called when user drags column header to reorder.
 

Private Member Functions

void InitializeView ()
 
void ConnectSelectionSignals ()
 
void ShowContextMenu (const QPoint &pos)
 
void ShowColumnFilterPopup (int column)
 
void ResizeColumnsToConfiguration ()
 
void ScrollToMatchIndex (int matchIndex)
 
void RestoreColumnOrder ()
 
void SaveColumnOrder () const
 
void RestoreColumnWidths ()
 
void SaveColumnWidths () const
 
void CaptureSelectionBeforeReset ()
 
void RestoreSelectionAfterReset ()
 
void OnSearchMatchesChanged ()
 Keeps the "n of m" search position on the same match after the rows change.
 
std::vector< int > SelectedActualIndices () const
 Returns actual event indices for all currently selected table rows.
 
void CopySelectedRowsAsJson ()
 
void CopySelectedRowsAsCsv ()
 

Private Attributes

db::EventsContainer & m_events
 
EventsTableModel * m_model {nullptr}
 
FilterHeaderView * m_filterHeader {nullptr}
 
std::unique_ptr< DrillDownFilter > m_timeWindow
 see ShowTimeWindow()
 
int m_currentMatchIndex {-1}
 
int m_currentMatchActual {-1}
 event of the current search match
 
int m_resetCurrentActual {-1}
 
std::vector< int > m_resetSelectedActual
 
std::uint64_t m_resetGeneration {0}
 
bool m_restoringSelection {false}
 

Constructor & Destructor Documentation

◆ EventsTableView()

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

◆ ~EventsTableView()

ui::qt::EventsTableView::~EventsTableView ( )
overridedefault

Member Function Documentation

◆ AddQuickFilterActions()

void ui::qt::EventsTableView::AddQuickFilterActions ( QMenu &  menu,
const QModelIndex &  cell 
)

Adds the quick filters for the clicked cell to menu: show only / exclude its value, a time window around its event and the conversation of its sender and receiver (see QuickFilters.hpp).

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

◆ AddToScenarioRequested

void ui::qt::EventsTableView::AddToScenarioRequested ( int  actualRow)
signal

Emitted when the user chooses "Add to Scenario" from the context menu.

Here is the caller graph for this function:

◆ BookmarkRequested

void ui::qt::EventsTableView::BookmarkRequested ( int  actualRow)
signal

Emitted when the user chooses "Bookmark Event" from the context menu.

Here is the caller graph for this function:

◆ CaptureSelectionBeforeReset()

void ui::qt::EventsTableView::CaptureSelectionBeforeReset ( )
private

A model reset drops the selection: remember it by event (before the reset) and select the same events again afterwards.

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

◆ ClearColumnFilters()

void ui::qt::EventsTableView::ClearColumnFilters ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearFilter()

void ui::qt::EventsTableView::ClearFilter ( )
overridevirtual

Clears any active filter; all events become visible via O(1) path.

Implements ui::IEventsListView.

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

◆ ClearTimeWindow()

void ui::qt::EventsTableView::ClearTimeWindow ( )

Puts back the filter that was set before ShowTimeWindow().

Here is the caller graph for this function:

◆ ConnectSelectionSignals()

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

◆ CopySelectedRowsAsCsv()

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

◆ CopySelectedRowsAsJson()

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

◆ CurrentActualRow()

int ui::qt::EventsTableView::CurrentActualRow ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CurrentActualRowChanged

void ui::qt::EventsTableView::CurrentActualRowChanged ( int  actualRow)
signal
Here is the caller graph for this function:

◆ FirstVisibleActualRow()

int ui::qt::EventsTableView::FirstVisibleActualRow ( ) const

Returns the actual-container row of the first fully visible row, or -1 if the view has no model or no visible rows.

Here is the call graph for this function:

◆ GetBaseFilteredIndices()

const std::vector< unsigned long > * ui::qt::EventsTableView::GetBaseFilteredIndices ( ) const

The indices last passed to SetFilteredEvents() (nullptr after ClearFilter()), without column filters or sorting applied.

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

◆ GetFilteredIndices()

const std::vector< unsigned long > * ui::qt::EventsTableView::GetFilteredIndices ( ) const

Returns nullptr if no filter is active, otherwise a pointer to the (possibly empty) filtered indices — callers must not treat a non-null empty result the same as "no filter" (see IsFilterActive()).

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

◆ HasColumnFilters()

bool ui::qt::EventsTableView::HasColumnFilters ( ) const

Excel-style per-column value filters (opened from the filter button in each column header). They are ANDed with each other and with every filter set through SetFilteredEvents()/ClearFilter().

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

◆ HasTimeWindow()

bool ui::qt::EventsTableView::HasTimeWindow ( ) const

True while the rows are narrowed by ShowTimeWindow() and nobody replaced that filter since.

Here is the caller graph for this function:

◆ InitializeView()

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

◆ IsFilterActive()

bool ui::qt::EventsTableView::IsFilterActive ( ) const

True if a filter is active, even if it currently matches zero events.

Here is the call graph for this function:

◆ JumpToTimestamp

void ui::qt::EventsTableView::JumpToTimestamp ( )
slot

Opens an input dialog and scrolls to the event with the nearest timestamp.

Here is the call graph for this function:

◆ MatchInfoChanged

void ui::qt::EventsTableView::MatchInfoChanged ( int  current,
int  total 
)
signal
Here is the caller graph for this function:

◆ NavigateToNextMatch()

void ui::qt::EventsTableView::NavigateToNextMatch ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NavigateToPrevMatch()

void ui::qt::EventsTableView::NavigateToPrevMatch ( )
Here is the call graph for this function:

◆ OnAttachedToModel()

virtual void mvc::IView::OnAttachedToModel ( class IModelObservable *  )
inlinevirtualinherited

Called when the view is attached to a model.

This method is called after the view is registered with a model. Views can use this to initialize model-specific state.

Parameters
modelThe model the view was attached to (optional)

◆ OnColumnMoved

void ui::qt::EventsTableView::OnColumnMoved ( )
privateslot

Called when user drags column header to reorder.

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

◆ OnCurrentIndexUpdated()

void ui::qt::EventsTableView::OnCurrentIndexUpdated ( const int  index)
overridevirtual

Called when the current item index in the model is updated.

This method should be implemented to update the view based on the new current item index.

Parameters
indexThe new current item index in the model

Implements mvc::IView.

Here is the call graph for this function:

◆ OnDataUpdated()

void ui::qt::EventsTableView::OnDataUpdated ( )
overridevirtual

Called when the model's data is updated.

This method should be implemented to refresh the view with the latest data from the model.

Implements mvc::IView.

Here is the call graph for this function:

◆ OnDetachedFromModel()

virtual void mvc::IView::OnDetachedFromModel ( )
inlinevirtualinherited

Called when the view is detached from a model.

This method is called when the view is unregistered from a model. Views can use this to clean up model-specific state.

◆ OnSearchMatchesChanged()

void ui::qt::EventsTableView::OnSearchMatchesChanged ( )
private

Keeps the "n of m" search position on the same match after the rows change.

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

◆ RefreshColumns()

void ui::qt::EventsTableView::RefreshColumns ( )
overridevirtual

Rebuilds visible columns after configuration changes.

Implements ui::IEventsListView.

Here is the call graph for this function:

◆ RefreshView()

void ui::qt::EventsTableView::RefreshView ( )
overridevirtual

Refreshes both the underlying model and the visual control.

Implements ui::IEventsListView.

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

◆ ResizeColumnsToConfiguration()

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

◆ ResolveToActualIndex()

int ui::qt::EventsTableView::ResolveToActualIndex ( int  modelRow) const

Converts a model row index to the corresponding EventsContainer index (handles filtering: when filtering is active, model rows != container indices)

Here is the call graph for this function:

◆ RestoreColumnOrder()

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

◆ RestoreColumnWidths()

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

◆ RestoreSelectionAfterReset()

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

◆ SaveColumnOrder()

void ui::qt::EventsTableView::SaveColumnOrder ( ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveColumnWidths()

void ui::qt::EventsTableView::SaveColumnWidths ( ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScrollToActualRow()

void ui::qt::EventsTableView::ScrollToActualRow ( int  actualRow,
bool  takeFocus = true 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScrollToMatchIndex()

void ui::qt::EventsTableView::ScrollToMatchIndex ( int  matchIndex)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectedActualIndices()

std::vector< int > ui::qt::EventsTableView::SelectedActualIndices ( ) const
private

Returns actual event indices for all currently selected table rows.

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

◆ SetFilteredEvents()

void ui::qt::EventsTableView::SetFilteredEvents ( const std::vector< unsigned long > &  filteredIndices)
overridevirtual

Applies filtered indices so only selected events are shown.

Implements ui::IEventsListView.

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

◆ SetSearchTerm()

void ui::qt::EventsTableView::SetSearchTerm ( const QString &  term,
bool  caseSensitive 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowColumnFilterPopup()

void ui::qt::EventsTableView::ShowColumnFilterPopup ( int  column)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowContextMenu()

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

◆ ShowTimeWindow()

bool ui::qt::EventsTableView::ShowTimeWindow ( int  actualRow,
int  seconds 
)

Narrows the rows to the events within ±seconds of actualRow's timestamp, on top of the filter set by the rest of the application (a new window replaces the previous one). False if the event has no parseable timestamp.

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

◆ SyncScrollTo()

void ui::qt::EventsTableView::SyncScrollTo ( int  actualRow)

Scrolls the viewport so that actualRow is visible at the top without changing the current selection or stealing focus.

Here is the call graph for this function:

◆ UpdateColors()

void ui::qt::EventsTableView::UpdateColors ( )
overridevirtual

Updates row colors or other visual embellishments.

Implements ui::IEventsListView.

Here is the call graph for this function:

Member Data Documentation

◆ m_currentMatchActual

int ui::qt::EventsTableView::m_currentMatchActual {-1}
private

event of the current search match

◆ m_currentMatchIndex

int ui::qt::EventsTableView::m_currentMatchIndex {-1}
private

◆ m_events

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

◆ m_filterHeader

FilterHeaderView* ui::qt::EventsTableView::m_filterHeader {nullptr}
private

◆ m_model

EventsTableModel* ui::qt::EventsTableView::m_model {nullptr}
private

◆ m_resetCurrentActual

int ui::qt::EventsTableView::m_resetCurrentActual {-1}
private

◆ m_resetGeneration

std::uint64_t ui::qt::EventsTableView::m_resetGeneration {0}
private

◆ m_resetSelectedActual

std::vector<int> ui::qt::EventsTableView::m_resetSelectedActual
private

◆ m_restoringSelection

bool ui::qt::EventsTableView::m_restoringSelection {false}
private

◆ m_timeWindow

std::unique_ptr<DrillDownFilter> ui::qt::EventsTableView::m_timeWindow
private

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