diff libgui/src/documentation.h @ 26245:af99ea9c325f

Doc browser: go to search text when clicking a search result (bug #55228) * documentation.cc (documentation): Initialize new class variable, connect requestShowLink signal from result widget to new slot handle_search_result_clicked; (global_search): save the search string of global search in class variable; (handle_search_result_clicked): new slot opening the search link, highlight all occurrences of the search text and go to the first occurrence; (select_all_occurrences): new private method for highlighting all occurrences of a specific string * documentation.h: new slot handle_search_result_clicked new method select_all_occurrences, new class variable m_query_string
author Torsten <mttl@mailbox.org>
date Sun, 16 Dec 2018 11:20:00 +0100
parents 20b87596b99a
children 00f796120a6d
line wrap: on
line diff
--- a/libgui/src/documentation.h	Sun Dec 16 00:13:55 2018 -0800
+++ b/libgui/src/documentation.h	Sun Dec 16 11:20:00 2018 +0100
@@ -120,6 +120,7 @@
     void find_forward_from_anchor (const QString& text);
     void record_anchor_position (void);
     void handle_cursor_position_change (void);
+    void handle_search_result_clicked (const QUrl& url);
 
     void update_history_menus (void);
     void open_hist_url (QAction *a);
@@ -136,6 +137,8 @@
                          QToolBar *tool_bar = nullptr);
     void update_history (int new_count, QAction **actions);
 
+    //! Select all occurrences of a string in the doc browser
+    void select_all_occurrences (const QString& text);
 
     QHelpEngine *m_help_engine;
     QString m_internal_search;
@@ -147,6 +150,7 @@
 
     QWidget *m_doc_widget;
     QToolBar *m_tool_bar;
+    QString m_query_string;
 
     QAction *m_action_go_home;
     QAction *m_action_go_prev;