File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1515#include < QRegularExpression>
1616#include < QWebEngineCookieStore>
1717#include < QStandardPaths>
18+ #include < QClipboard>
19+ #include < QApplication>
1820#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
1921 #include < QWebEngineProfileBuilder>
2022#endif
@@ -547,9 +549,17 @@ int CFrmWebBrowser::InitMenu(QMenu *pMenu)
547549 CFrmWebView* pWeb = CurrentView ();
548550 if (pWeb) {
549551 bool ok = false ;
550- QString search = QInputDialog::getText (this , tr (" Find" ),
551- tr (" Find:" ), QLineEdit::Normal,
552- m_szFindText, &ok);
552+ if (pWeb->selectedText ().isEmpty ()) {
553+ if (QApplication::clipboard ()
554+ && !QApplication::clipboard ()->text ().isEmpty ())
555+ m_szFindText = QApplication::clipboard ()->text ();
556+ } else {
557+ m_szFindText = pWeb->selectedText ();
558+ }
559+ QString search = QInputDialog::getText (
560+ this , tr (" Find" ),
561+ tr (" Find:" ), QLineEdit::Normal,
562+ m_szFindText, &ok);
553563 if (ok && !search.isEmpty ()) {
554564 m_szFindText = search;
555565#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
You can’t perform that action at this time.
0 commit comments