diff options
author | Ubbo Veentjer <[email protected]> | 2016-02-21 15:39:56 +0000 |
---|---|---|
committer | Ubbo Veentjer <[email protected]> | 2016-02-21 15:39:56 +0000 |
commit | 33d5f7672ba5933f1f5892b7b986c374f8533b64 (patch) | |
tree | 75e28d2dbccd1c681c98b3422a652f805fd008f2 | |
parent | findwidget kind of works, does not crash anymore (diff) | |
download | gpg4usb-33d5f7672ba5933f1f5892b7b986c374f8533b64.tar.gz gpg4usb-33d5f7672ba5933f1f5892b7b986c374f8533b64.zip |
color if nothing found
-rw-r--r-- | findwidget.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/findwidget.cpp b/findwidget.cpp index ba0dd15..ff8de5a 100644 --- a/findwidget.cpp +++ b/findwidget.cpp @@ -34,7 +34,8 @@ void FindWidget::setBackground() QTextCursor cursor = mTextpage->textCursor(); // if match is found set background of QLineEdit to white, otherwise to red QPalette bgPalette( findEdit->palette() ); - if ((cursor.position() == -1) && (!findEdit->text().isEmpty())) { + + if (!findEdit->text().isEmpty() && mTextpage->document()->find(findEdit->text()).position() < 0 ) { bgPalette.setColor( QPalette::Base, "#ececba"); } else { bgPalette.setColor( QPalette::Base, Qt::white); |