diff options
Diffstat (limited to 'src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp')
-rw-r--r-- | src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp b/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp new file mode 100644 index 000000000..6b39eed03 --- /dev/null +++ b/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp @@ -0,0 +1,14 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +void wrapInFunction() +{ + +//! [0] + m_view->page()->findText(QStringLiteral("Qt"), QWebEnginePage::FindFlags(), [this](const QWebEngineFindTextResult &result) { + if (result.numberOfMatches() == 0) QMessageBox::information(m_view, QString(), QStringLiteral("No occurrences found")); + }); +//! [0] + +} + |