3#include <QStyledItemDelegate>
67 QSize
sizeHint(
const QStyleOptionViewItem& option,
const QModelIndex& index)
const override;
76 void paint(QPainter* painter,
const QStyleOptionViewItem& option,
const QModelIndex& index)
const override;
84 int mExpandedVPadding = 7;
86 void paintSearchHighlights(QPainter* painter,
const QStyleOptionViewItem& option,
const QRect& textRect,
const QString& text,
bool wordWrap)
const;
void addExpandedRow(int row)
Adds a row to the list of expanded rows.
Definition log_table_highlight.cpp:19
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Paints an item in a given style option and model index.
Definition log_table_highlight.cpp:166
void removeExpandedRow(int row)
Removes a row from the list of expanded rows.
Definition log_table_highlight.cpp:24
void setSearchText(const QString &text)
Sets the search text used for highlighting log entries.
Definition log_table_highlight.cpp:14
bool containExpandedRow(int row) const
Checks if a specific row is in the list of expanded rows.
Definition log_table_highlight.cpp:29
LogHighlightDelegate(QObject *parent=nullptr)
Constructs a new LogHighlightDelegate object.
Definition log_table_highlight.cpp:9
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Returns the size hint for a given item view option and model index.
Definition log_table_highlight.cpp:45
int mExpandedHPadding
Number of matches found during the last search.
Definition log_table_highlight.h:83
QVector< int > mExpandedRows
The current search text used for highlighting log entries.
Definition log_table_highlight.h:80
int mMatches
List of rows that are currently expanded.
Definition log_table_highlight.h:81
void updatePadding(int hPadding, int vPadding)
Update the internal padding for expanded rows.
Definition log_table_highlight.cpp:39
void clearExpandedRows()
Clears all expanded rows.
Definition log_table_highlight.cpp:34