Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
LogHighlightDelegate Class Reference

A delegate for highlighting log entries based on search text and expanding specific rows. More...

#include <log_table_highlight.h>

Inheritance diagram for LogHighlightDelegate:

Public Member Functions

 LogHighlightDelegate (QObject *parent=nullptr)
 Constructs a new LogHighlightDelegate object.
void setSearchText (const QString &text)
 Sets the search text used for highlighting log entries.
void addExpandedRow (int row)
 Adds a row to the list of expanded rows.
void removeExpandedRow (int row)
 Removes a row from the list of expanded rows.
bool containExpandedRow (int row) const
 Checks if a specific row is in the list of expanded rows.
void clearExpandedRows ()
 Clears all expanded rows.
void updatePadding (int hPadding, int vPadding)
 Update the internal padding for expanded rows.
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Returns the size hint for a given item view option and model index.
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Paints an item in a given style option and model index.

Private Attributes

QVector< int > mExpandedRows = {}
 The current search text used for highlighting log entries.
int mMatches = 0
 List of rows that are currently expanded.
int mExpandedHPadding = 4
 Number of matches found during the last search.

Detailed Description

A delegate for highlighting log entries based on search text and expanding specific rows.

Constructor & Destructor Documentation

◆ LogHighlightDelegate()

LogHighlightDelegate::LogHighlightDelegate ( QObject * parent = nullptr)

Constructs a new LogHighlightDelegate object.

Parameters
parentThe parent object.

Member Function Documentation

◆ addExpandedRow()

void LogHighlightDelegate::addExpandedRow ( int row)

Adds a row to the list of expanded rows.

Parameters
rowThe index of the row to add.

◆ containExpandedRow()

bool LogHighlightDelegate::containExpandedRow ( int row) const

Checks if a specific row is in the list of expanded rows.

Parameters
rowThe index of the row to check.
Returns
true If the row is expanded.
false If the row is not expanded.

◆ paint()

void LogHighlightDelegate::paint ( QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const
override

Paints an item in a given style option and model index.

Parameters
painterThe painter to use for drawing.
optionThe style option for the item view.
indexThe model index of the item.

◆ removeExpandedRow()

void LogHighlightDelegate::removeExpandedRow ( int row)

Removes a row from the list of expanded rows.

Parameters
rowThe index of the row to remove.

◆ setSearchText()

void LogHighlightDelegate::setSearchText ( const QString & text)

Sets the search text used for highlighting log entries.

Parameters
textThe search text to set.

◆ sizeHint()

QSize LogHighlightDelegate::sizeHint ( const QStyleOptionViewItem & option,
const QModelIndex & index ) const
override

Returns the size hint for a given item view option and model index.

Parameters
optionThe style option for the item view.
indexThe model index of the item.
Returns
QSize The size hint for the item.

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