55 #include <QTableWidget>
56 #include <QTableWidgetItem>
59 #include "../vmisc/def.h"
75 for(
int i = 0; i <
table->rowCount(); ++i)
77 for(
int j = 0; j <
table->columnCount(); ++j)
79 if (QTableWidgetItem *item =
table->item(i, j))
81 if (item->row() % 2 != 0 &&
table->alternatingRowColors())
83 item->setBackground(QPalette().alternateBase());
87 item->setBackground(QPalette().base());
105 item->setBackground(Qt::yellow);
108 item->setBackground(Qt::red);
109 table->scrollToItem(item);
125 if (not term.isEmpty())
133 item->setBackground(Qt::yellow);
138 item->setBackground(Qt::red);
139 table->scrollToItem(item);
175 if (searchIndex < 0 || searchIndex >=
searchList.size())
186 if (item->row() == row)
197 if (searchIndex < 0 || searchIndex >=
searchList.size())
208 if (item->row() == row)
230 item->setBackground(Qt::yellow);
245 item->setBackground(Qt::red);
246 table->scrollToItem(item);
VTableSearch(QTableWidget *table, QObject *parent=nullptr)
void Find(const QString &term)
QList< QTableWidgetItem * > searchList
void ShowNext(int newIndex)
void HasResult(bool state)
void RefreshList(const QString &term)