GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
terminal-dock-widget.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2013-2017 John W. Eaton
4 Copyright (C) 2011-2016 Jacob Dawid
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if defined (HAVE_CONFIG_H)
25 # include "config.h"
26 #endif
27 
28 #include "terminal-dock-widget.h"
29 
31  : octave_dock_widget (p), terminal (QTerminal::create (p))
32 {
33  terminal->setObjectName ("OctaveTerminal");
34  terminal->setFocusPolicy (Qt::StrongFocus);
35 
36  setObjectName ("TerminalDockWidget");
37  setWindowIcon (QIcon (":/actions/icons/logo.png"));
38  set_title (tr ("Command Window"));
39 
40  setWidget (terminal);
41  setFocusProxy (terminal);
42 
43  connect (terminal, SIGNAL (interrupt_signal (void)),
44  this, SLOT (terminal_interrupt ()));
45 }
46 
47 bool
49 {
50  QWidget *w = widget ();
51 
52  return w->hasFocus ();
53 }
54 
55 void
57 {
59 
60  QWidget *w = widget ();
61 
62  w->setFocus ();
63  w->activateWindow ();
64  w->raise ();
65 }
66 
67 void
69 {
70  emit interrupt_signal ();
71 }
72 
74 {
75  delete terminal;
76 }
void set_title(const QString &)
std::complex< double > w(std::complex< double > z, double relerr=0)
bool has_focus(void) const
terminal_dock_widget(QWidget *parent=0)
p
Definition: lu.cc:138
virtual void focus(void)