| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
#include "finddialog.h" |
| 30 |
#include "mainwindow.h" |
| 31 |
#include "tabbedbrowser.h" |
| 32 |
#include "helpwindow.h" |
| 33 |
|
| 34 |
#include <QTextBrowser> |
| 35 |
#include <QTextCursor> |
| 36 |
#include <QStatusBar> |
| 37 |
#include <QLineEdit> |
| 38 |
#include <QDateTime> |
| 39 |
#include <QGridLayout> |
| 40 |
|
| 41 |
FindDialog::FindDialog(MainWindow *parent) |
| 42 |
: QDialog(parent) |
| 43 |
{ |
| 44 |
sb->showMessage(tr("Enter the text you want to find.")); |
| 45 |
} |
| 46 |
|
| 47 |
void FindDialog::doFind(bool forward) |
| 48 |
{ |
| 49 |
QTextCursor found = browser->document()->find(findExpr, c, flags); |
| 50 |
if (found.isNull()) { |
| 51 |
if (onceFound) { |
| 52 |
if (forward) |
| 53 |
statusMessage(tr("Search reached end of the document")); |
| 54 |
else |
| 55 |
statusMessage(tr("Search reached start of the document")); |
| 56 |
} else { |
| 57 |
statusMessage(tr( "Text not found" )); |
| 58 |
} |
| 59 |
} |
| 60 |
} |