GNU Octave  4.0.0
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-2015 John W. Eaton
4 Copyright (C) 2011-2015 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 #ifdef 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  setFocusPolicy (Qt::StrongFocus);
43 
44  connect (terminal, SIGNAL (interrupt_signal (void)),
45  this, SLOT (terminal_interrupt ()));
46 }
47 
48 bool
50 {
51  QWidget *w = widget ();
52 
53  return w->hasFocus ();
54 }
55 
56 void
58 {
60 
61  QWidget *w = widget ();
62 
63  w->setFocus ();
64  w->activateWindow ();
65  w->raise ();
66 }
67 
68 void
70 {
71  emit interrupt_signal ();
72 }
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)
virtual void focus(void)