Fix ChatWidget search text label threshold.

This commit is contained in:
Phenom 2015-08-22 16:31:08 +02:00
parent 48c3eedcf5
commit 5c970100f1

View File

@ -586,14 +586,14 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
if (keyEvent) { if (keyEvent) {
QString qsTextToFind=ui->leSearch->text(); QString qsTextToFind=ui->leSearch->text();
if (((qsTextToFind.length()>iCharToStartSearch) || (keyEvent->key()==Qt::Key_Return)) && (keyEvent->text().length()>0)) if (keyEvent->key()==Qt::Key_Backspace) {
qsTextToFind=qsTextToFind.left(qsTextToFind.length()-1);// "\010"
} else if (keyEvent->key()==Qt::Key_Tab) { // "\011"
} else if (keyEvent->key()==Qt::Key_Return) { // "\015"
} else if (keyEvent->text().length()==1)
qsTextToFind+=keyEvent->text();
if (((qsTextToFind.length()>=iCharToStartSearch) || (keyEvent->key()==Qt::Key_Return)) && (keyEvent->text().length()>0))
{ {
if (keyEvent->key()==Qt::Key_Backspace) {
qsTextToFind=qsTextToFind.left(qsTextToFind.length()-1);// "\010"
} else if (keyEvent->key()==Qt::Key_Tab) { // "\011"
} else if (keyEvent->key()==Qt::Key_Return) { // "\015"
} else if (keyEvent->text().length()==1)
qsTextToFind+=keyEvent->text();
findText(qsTextToFind); findText(qsTextToFind);
} else { } else {