hi folks,
i am writing a software that displays logfile data within a QTableView.
in some cases the displayed file content can be several 100 MB of size.
I allready managed to put the whole content into the tableview by subclassing QAbstractTableModel in one go, so that works fine.
but now the problem and would like to get some ideas in regard to this, hope u can help:
there shall be filtering functionalities like: "find all rows that match a certain pattern"
i thought maybe hiding the appropriate rows could be an option to display the result, but that turned out to be quite slow:
QModelIndexList list = tableModel->match(start,
Qt::DisplayRole,
"*DEBUG*",
-1,
Qt::MatchWildcard);
ui->tableView->setUpdatesEnabled(false);
for(ushort idx=0; idx<list.size();idx++)
{
int row = list[idx].row();
ui->tableView->hideRow(row);
}
ui->tableView->setUpdatesEnabled(true);
QModelIndex start = tableModel->index(0, 0);
QModelIndexList list = tableModel->match(start,
Qt::DisplayRole,
"*DEBUG*",
-1,
Qt::MatchWildcard);
ui->tableView->setUpdatesEnabled(false);
for(ushort idx=0; idx<list.size();idx++)
{
int row = list[idx].row();
ui->tableView->hideRow(row);
}
ui->tableView->setUpdatesEnabled(true);
To copy to clipboard, switch view to plain text mode
i know that the parameters for tableModel::match(...) do certainly have an effect on speed, but i think its more the amount of rows within the table.
so, any ideas how this kind of filtering could be implemented without having a bottle neck as this?
hiding rows is not mandatory, so if u have other ideas how to display results i would appreciate.
thnx alot.
greets.
Bookmarks