40 const int roleCount = roles.count();
43 for(
int roleIndex=0; roleIndex < roleCount; roleIndex++)
45 if(roleIndex >= roleCount || roleIndex < 0)
48 bool searchTextFound =
false;
50 const int role = roles.at(roleIndex);
52 QVariant next = data.at(role);
69 qint64 currentRecordID)
73 if(!chunkSize || !model)
78 const int chunkActualSize = chunkSize < modelRowCount ? chunkSize : modelRowCount;
80 const int chunkCount = modelRowCount / chunkActualSize;
82 const int chunkFraction = modelRowCount % chunkActualSize;
95 for(
int i=0; i < chunkCount; i++)
97 const int startRow = i * chunkActualSize;
106 vRows = QVariant::fromValue<ZTableRowList>(rows);
113 const int startRow = chunkCount * chunkActualSize;
122 vRows = QVariant::fromValue<ZTableRowList>(rows);
130 emit m_search->searchRowsMatched(searchList);
147 const int rowCount = columnRows.count();
154 for(
int row=0; row < rowCount; row++)
157 QMap<int, QVariant> nextRow = columnRows.at(row);
158 QList<int> roles = nextRow.keys();
160 QMap<int, QVariant> outRow;
161 QList<int> rolesFound;
164 const int roleCount = roles.count();
168 for(
int roleIndex = 0; roleIndex < roleCount; roleIndex++)
170 bool searchTextFound =
false;
172 const int role = roles.at(roleIndex);
174 QVariant nextValue = nextRow.value(role);
176 if(scanRoles.contains(role))
180 outRow.insert(role, nextValue);
184 rolesFound.append(role);
190 outRows.append(outRow);
210 searchTextFound =
false;
215 QString text = data.toString();
217 const int textLen = text.length();
220 if(!searchLen || !textLen)
229 for(
int nextIx = text.indexOf(searchPhrase, 0, Qt::CaseInsensitive); nextIx != -1;
230 nextIx = text.indexOf(searchPhrase, lastIx, Qt::CaseInsensitive))
232 searchTextFound =
true;
237 markup += text.mid(lastIx, nextIx) + fontStart
238 + text.mid(nextIx, searchLen)
241 lastIx = nextIx + searchLen;
247 if(textLen > lastIx + 1)
248 markup += text.mid(lastIx);
250 return QVariant(markup);
bool signalFindComplete()
Determine if scanner will send rowsMatched signals.
ZTableRowList scanTableColumnRows(ZTableRowList columnRows, ZblLogSearchList &searchList, ZLogViewport *viewport=NULL)
Scans a log viewport data model for search text.
qint64 getRowID(QMap< int, QVariant > row)
bool m_markupColumn
True if the data model has an optional markup column.
ZblLogScanner()
Constructs an invalid scanner/highlighter object.
static const QString m_highlightColor
The color to highlight text that mataches the search parameters.
bool signalRowsMatched()
Determine if scanner will send rowsMatched signals.
This class allows Zuble log file viewer text search operations to pass parameters between threads...
void addRow(qint64 recordID, qint64 seekPos, QList< int > rolesFound)
bool outputHighlightedText()
Determine if scanner is enabled.
QList< int > roles() const
QVariant scanTextValue(QVariant data, bool &searchTextFound)
Returns a highlighted text string for the specified QVariant object.
A log viewport encapsulates a ZTableModel containing a contiguous subset of log records from a Zuble ...
QList< LinkNode > m_links
This two dimensional table model is used to store and manipulate data.
const ZblLogSearchParams * m_params
Search parameters to be used by the text scanning algorithms.
QList< QMap< int, QVariant > > ZTableRowList
Represents multiple rows of data cell values for multiple roles for a single column.
bool m_findCompleteSent
true if fineComplete signal has been sent, false otherwise;
Q_INVOKABLE int modelRowCount() const
Returns the number of rows in the data set. This method may block the current thread.
Q_INVOKABLE QVariant getTableColumnRows(QList< int > roles, int startRow, int col, int rowCount)
Obtain data values for a set of rows from a single model column.
controlFlags m_controlFlags
These flags control the output of the scanner.
This class allows Zuble log file viewer text search operations to pass search results between threads...
Q_INVOKABLE void putTableColumnRows(QVariant rows, int startRow, int col)
Replaces the current value for a set of rows for a single model column.
static int getSeekIndexRole()
Obtain the role number for the file seek position of a log record in the viewport's log record data m...
qint64 getRowSeekPos(QMap< int, QVariant > row)
QVariantList markupOrdinalRoleList(QVariantList data)
Returns a highlighted text string for the specified QVariant objects.
ZblLogSearchList scanModelColumnRows(ZTableModel *model, int chunkSize, ZLogViewport *viewport=NULL, qint64 currentRecordID=-1)
scanModelColumnRows