1
0
Fork 0
This commit is contained in:
lynnux 2016-12-03 10:06:02 +08:00
parent 4736b30042
commit 727c0656ef
2 changed files with 4 additions and 4 deletions

View File

@ -150,17 +150,16 @@ bool SearchListView::findTextInList(SearchListViewTable* list, QString text, int
void SearchListView::searchTextChanged(const QString & arg1)
{
QString lastFirstColValue = "";
if(mSearchList->isHidden())
{
auto selList = mList->getSelection();
if(!selList.empty())
if(!selList.empty() && mList->isValidIndex(selList[0], 0))
lastFirstColValue = mList->getCellContent(selList[0], 0);
}
else
{
auto selList = mSearchList->getSelection();
if(!selList.empty())
auto selList = mSearchList->getSelection(); // bug?: still return QList<0> if empty
if(!selList.empty() && mSearchList->isValidIndex(selList[0], 0))
lastFirstColValue = mSearchList->getCellContent(selList[0], 0);
}

View File

@ -25,6 +25,7 @@ public:
SearchListViewTable* mCurList;
QLineEdit* mSearchBox;
int mSearchStartCol;
QString lastFirstColValue;
bool findTextInList(SearchListViewTable* list, QString text, int row, int startcol, bool startswith);
void refreshSearchList();