| 19 | #include <QTimer> |
| 20 | |
| 21 | SearchLineEdit::SearchLineEdit(QWidget *parent, Okular::Document *document) |
| 22 | : KLineEdit(parent) |
| 23 | , m_document(document) |
| 24 | , m_minLength(0) |
| 25 | , m_caseSensitivity(Qt::CaseInsensitive) |
| 26 | , m_searchType(Okular::Document::AllDocument) |
| 27 | , m_id(-1) |
| 28 | , m_moveViewport(false) |
| 29 | , m_changed(false) |
| 30 | , m_fromStart(true) |
| 31 | , m_findAsYouType(true) |
| 32 | , m_searchRunning(false) |
| 33 | { |
| 34 | setObjectName(QStringLiteral("SearchLineEdit")); |
| 35 | setClearButtonEnabled(true); |
| 36 | |
| 37 | // a timer to ensure that we don't flood the document with requests to search |
| 38 | m_inputDelayTimer = new QTimer(this); |
| 39 | m_inputDelayTimer->setSingleShot(true); |
| 40 | connect(m_inputDelayTimer, &QTimer::timeout, this, &SearchLineEdit::startSearch); |
| 41 | |
| 42 | connect(this, &SearchLineEdit::textChanged, this, &SearchLineEdit::slotTextChanged); |
| 43 | connect(document, &Okular::Document::searchFinished, this, &SearchLineEdit::searchFinished); |
| 44 | } |
| 45 | |
| 46 | void SearchLineEdit::clearText() |
| 47 | { |
nothing calls this directly
no outgoing calls
no test coverage detected