![]() |
NDEVR
API Documentation
|
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 LogMessage & | activeMessage (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. | |
A model for creating a table that displays logged records.
Definition at line 44 of file LogTable.h.
| LogViewTable::LogViewTable | ( | QObject * | parent = nullptr | ) |
Constructs an empty log view table model.
| [in] | parent | The parent QObject. |
| LogViewTable::LogViewTable | ( | const Buffer< LogMessage > & | messages, |
| QObject * | parent = nullptr ) |
Constructs a log view table model pre-populated with messages.
| [in] | messages | The initial log messages to display. |
| [in] | parent | The parent QObject. |
|
inline |
Returns the active message at the given filtered index.
| [in] | i | The index into the active messages list. |
Definition at line 119 of file LogTable.h.
Returns the indices of messages that pass the current filter.
Definition at line 115 of file LogTable.h.
| void LogViewTable::addMessage | ( | const LogMessage & | message | ) |
Appends a single log message to the model.
| [in] | message | The log message to add. |
| void LogViewTable::addMessages | ( | const Buffer< LogMessage > & | messages | ) |
Appends multiple log messages to the model.
| [in] | messages | The log messages to add. |
|
inline |
Returns all stored log messages, including filtered ones.
Definition at line 112 of file LogTable.h.
|
override |
Returns the number of columns in the model.
| [in] | parent | The parent index (unused for flat tables). |
|
override |
Returns display data for the given cell and role.
| [in] | index | The model index identifying the cell. |
| [in] | role | The data role being requested. |
|
virtual |
Determines whether a given column should be displayed.
| [in] | source_column | The column index. |
| [in] | source_parent | The parent model index. |
|
virtual |
Determines whether a given row passes the current filter criteria.
| [in] | source_row | The row index in the unfiltered message list. |
|
override |
Returns the item flags for the given index.
| [in] | index | The model index. |
|
override |
Returns header data for the given section.
| [in] | section | The column or row index. |
| [in] | orientation | The header orientation. |
| [in] | role | The data role being requested. |
|
override |
Returns the number of visible rows in the model.
| [in] | parent | The parent index (unused for flat tables). |
|
override |
Sets data for the given cell (e.g., for editing).
| [in] | index | The model index identifying the cell. |
| [in] | value | The new value to set. |
| [in] | role | The data role being set. |
| void LogViewTable::setDetectNewLines | ( | bool | detect_new_lines | ) |
Sets whether embedded newline characters in messages create additional rows.
| [in] | detect_new_lines | True to split messages on newlines. |
| void LogViewTable::setMessages | ( | const Buffer< LogMessage > & | messages | ) |
Replaces all messages in the model.
| [in] | messages | The new set of log messages. |
Sets search terms used to filter or highlight log messages.
| [in] | search_terms | The terms to search for. |
| [in] | range | The number of rows around a match to include in results. |
| void LogViewTable::setMinimumLevel | ( | uint01 | minimal_level | ) |
Sets the minimum log severity level for displayed messages.
| [in] | minimal_level | The minimum severity level. |
| void LogViewTable::setShowMicroSeconds | ( | bool | show_microseconds | ) |
Sets whether timestamps display microsecond precision.
| [in] | show_microseconds | True to show microseconds. |
Sets the time span filters used to limit displayed messages.
| [in] | time_spans | The time spans to filter by. |
| bool LogViewTable::showMicroSeconds | ( | ) | const |
Checks whether microsecond timestamp precision is enabled.
| void LogViewTable::updateFilter | ( | bool | can_use_active, |
| uint04 | start_index = 0U ) |
Recomputes the active message filter based on current settings.
| [in] | can_use_active | Whether previously active indices can be reused for efficiency. |
| [in] | start_index | The index to start filtering from. |