NDEVR
API Documentation
LogViewTable

A model for creating a table that displays logged records. More...

Public Member Functions

 LogViewTable (const Buffer< LogMessage > &messages, QObject *parent=nullptr)
 Constructs a log view table model pre-populated with messages.
 LogViewTable (QObject *parent=nullptr)
 Constructs an empty log view table model.
virtual ~LogViewTable ()
 Destructor.
const LogMessageactiveMessage (uint04 i) const
 Returns the active message at the given filtered index.
const Buffer< uint04 > & activeMessages () const
 Returns the indices of messages that pass the current filter.
void addMessage (const LogMessage &message)
 Appends a single log message to the model.
void addMessages (const Buffer< LogMessage > &messages)
 Appends multiple log messages to the model.
const Buffer< LogMessage > & allMessages () const
 Returns all stored log messages, including filtered ones.
void clear ()
 Removes all messages from the model.
int columnCount (const QModelIndex &parent) const override
 Returns the number of columns in the model.
QVariant data (const QModelIndex &index, int role) const override
 Returns display data for the given cell and role.
virtual bool filterAcceptsColumn (int source_column, const QModelIndex &source_parent) const
 Determines whether a given column should be displayed.
virtual bool filterAcceptsRow (uint04 source_row) const
 Determines whether a given row passes the current filter criteria.
Qt::ItemFlags flags (const QModelIndex &index) const override
 Returns the item flags for the given index.
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 Returns header data for the given section.
int rowCount (const QModelIndex &parent) const override
 Returns the number of visible rows in the model.
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 Sets data for the given cell (e.g., for editing).
void setDetectNewLines (bool detect_new_lines)
 Sets whether embedded newline characters in messages create additional rows.
void setMessages (const Buffer< LogMessage > &messages)
 Replaces all messages in the model.
void setMessageSearchTerms (const Buffer< String > &search_terms, uint04 range)
 Sets search terms used to filter or highlight log messages.
void setMinimumLevel (uint01 minimal_level)
 Sets the minimum log severity level for displayed messages.
void setShowMicroSeconds (bool show_microseconds)
 Sets whether timestamps display microsecond precision.
void setTimeSpans (const Buffer< TimeSpan > &time_spans)
 Sets the time span filters used to limit displayed messages.
bool showMicroSeconds () const
 Checks whether microsecond timestamp precision is enabled.
void updateFilter (bool can_use_active, uint04 start_index=0U)
 Recomputes the active message filter based on current settings.

Detailed Description

A model for creating a table that displays logged records.


Definition at line 44 of file LogTable.h.

Constructor & Destructor Documentation

◆ LogViewTable() [1/2]

LogViewTable::LogViewTable ( QObject * parent = nullptr)

Constructs an empty log view table model.

Parameters
[in]parentThe parent QObject.

◆ LogViewTable() [2/2]

LogViewTable::LogViewTable ( const Buffer< LogMessage > & messages,
QObject * parent = nullptr )

Constructs a log view table model pre-populated with messages.

Parameters
[in]messagesThe initial log messages to display.
[in]parentThe parent QObject.

Member Function Documentation

◆ activeMessage()

const LogMessage & LogViewTable::activeMessage ( uint04 i) const
inline

Returns the active message at the given filtered index.

Parameters
[in]iThe index into the active messages list.
Returns
A const reference to the log message.

Definition at line 119 of file LogTable.h.

◆ activeMessages()

const Buffer< uint04 > & LogViewTable::activeMessages ( ) const
inline

Returns the indices of messages that pass the current filter.

Returns
A const reference to the active message index buffer.

Definition at line 115 of file LogTable.h.

◆ addMessage()

void LogViewTable::addMessage ( const LogMessage & message)

Appends a single log message to the model.

Parameters
[in]messageThe log message to add.

◆ addMessages()

void LogViewTable::addMessages ( const Buffer< LogMessage > & messages)

Appends multiple log messages to the model.

Parameters
[in]messagesThe log messages to add.

◆ allMessages()

const Buffer< LogMessage > & LogViewTable::allMessages ( ) const
inline

Returns all stored log messages, including filtered ones.

Returns
A const reference to the full message buffer.

Definition at line 112 of file LogTable.h.

◆ columnCount()

int LogViewTable::columnCount ( const QModelIndex & parent) const
override

Returns the number of columns in the model.

Parameters
[in]parentThe parent index (unused for flat tables).
Returns
The column count.

◆ data()

QVariant LogViewTable::data ( const QModelIndex & index,
int role ) const
override

Returns display data for the given cell and role.

Parameters
[in]indexThe model index identifying the cell.
[in]roleThe data role being requested.
Returns
The data for the specified cell and role.

◆ filterAcceptsColumn()

virtual bool LogViewTable::filterAcceptsColumn ( int source_column,
const QModelIndex & source_parent ) const
virtual

Determines whether a given column should be displayed.

Parameters
[in]source_columnThe column index.
[in]source_parentThe parent model index.
Returns
True if the column should be displayed.

◆ filterAcceptsRow()

virtual bool LogViewTable::filterAcceptsRow ( uint04 source_row) const
virtual

Determines whether a given row passes the current filter criteria.

Parameters
[in]source_rowThe row index in the unfiltered message list.
Returns
True if the row should be displayed.

◆ flags()

Qt::ItemFlags LogViewTable::flags ( const QModelIndex & index) const
override

Returns the item flags for the given index.

Parameters
[in]indexThe model index.
Returns
The item flags.

◆ headerData()

QVariant LogViewTable::headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const
override

Returns header data for the given section.

Parameters
[in]sectionThe column or row index.
[in]orientationThe header orientation.
[in]roleThe data role being requested.
Returns
The header data.

◆ rowCount()

int LogViewTable::rowCount ( const QModelIndex & parent) const
override

Returns the number of visible rows in the model.

Parameters
[in]parentThe parent index (unused for flat tables).
Returns
The number of active rows.

◆ setData()

bool LogViewTable::setData ( const QModelIndex & index,
const QVariant & value,
int role = Qt::EditRole )
override

Sets data for the given cell (e.g., for editing).

Parameters
[in]indexThe model index identifying the cell.
[in]valueThe new value to set.
[in]roleThe data role being set.
Returns
True if the data was set successfully.

◆ setDetectNewLines()

void LogViewTable::setDetectNewLines ( bool detect_new_lines)

Sets whether embedded newline characters in messages create additional rows.

Parameters
[in]detect_new_linesTrue to split messages on newlines.

◆ setMessages()

void LogViewTable::setMessages ( const Buffer< LogMessage > & messages)

Replaces all messages in the model.

Parameters
[in]messagesThe new set of log messages.

◆ setMessageSearchTerms()

void LogViewTable::setMessageSearchTerms ( const Buffer< String > & search_terms,
uint04 range )

Sets search terms used to filter or highlight log messages.

Parameters
[in]search_termsThe terms to search for.
[in]rangeThe number of rows around a match to include in results.

◆ setMinimumLevel()

void LogViewTable::setMinimumLevel ( uint01 minimal_level)

Sets the minimum log severity level for displayed messages.

Parameters
[in]minimal_levelThe minimum severity level.

◆ setShowMicroSeconds()

void LogViewTable::setShowMicroSeconds ( bool show_microseconds)

Sets whether timestamps display microsecond precision.

Parameters
[in]show_microsecondsTrue to show microseconds.

◆ setTimeSpans()

void LogViewTable::setTimeSpans ( const Buffer< TimeSpan > & time_spans)

Sets the time span filters used to limit displayed messages.

Parameters
[in]time_spansThe time spans to filter by.

◆ showMicroSeconds()

bool LogViewTable::showMicroSeconds ( ) const

Checks whether microsecond timestamp precision is enabled.

Returns
True if microseconds are shown.

◆ updateFilter()

void LogViewTable::updateFilter ( bool can_use_active,
uint04 start_index = 0U )

Recomputes the active message filter based on current settings.

Parameters
[in]can_use_activeWhether previously active indices can be reused for efficiency.
[in]start_indexThe index to start filtering from.

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