GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
documentation-dock-widget.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2011-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
31 
32 #include "help.h"
33 
34 namespace octave
35 {
37  base_qobject& oct_qobj)
38  : octave_dock_widget ("DocumentationDockWidget", p, oct_qobj)
39  {
40  setWindowIcon (QIcon (":/actions/icons/logo.png"));
41  set_title (tr ("Documentation"));
42  setStatusTip (tr ("See the documentation for help."));
43 
44  m_docs = new documentation (this, oct_qobj);
45  setWidget (m_docs);
46 
47  connect (p, SIGNAL (show_doc_signal (const QString&)),
48  this, SLOT (showDoc (const QString&)));
49 
50  connect (p, SIGNAL (register_doc_signal (const QString&)),
51  this, SLOT (registerDoc (const QString&)));
52 
53  connect (p, SIGNAL (unregister_doc_signal (const QString&)),
54  this, SLOT (unregisterDoc (const QString&)));
55  }
56 
58  {
59  if (m_docs)
60  delete m_docs;
61  }
62 
64  {
66  }
67 
69  {
71  }
72 
74  {
76  }
77 
79  {
80  m_docs->selectAll ();
81  }
82 
84  {
85  // show the doc pane without focus for carrying on typing in the console
86  if (! isVisible ())
87  setVisible (true);
88 
89  raise ();
90 
91  m_docs->load_ref (name);
92  }
93 
95  {
97  }
98 
100  {
102  }
103 }
Base class for Octave interfaces that use Qt.
void notice_settings(const gui_settings *settings)
documentation_dock_widget(QWidget *parent, base_qobject &oct_qobj)
The documentation main class derived from QSplitter.
Definition: documentation.h:96
void load_ref(const QString &name)
void notice_settings(const gui_settings *settings)
void registerDoc(const QString &name)
void unregisterDoc(const QString &name)
void set_title(const QString &)
QString name