GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
qt-application.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 
30 #include "main-window.h"
31 #include "octave-qobject.h"
32 #include "qt-application.h"
33 
34 #include "lo-utils.h"
35 #include "oct-env.h"
36 #include "oct-syscalls.h"
37 #include "signal-wrappers.h"
38 
39 #include "display.h"
40 #include "octave.h"
41 #include "sysdep.h"
42 
43 namespace octave
44 {
45  qt_application::qt_application (int argc, char **argv)
46  : application (argc, argv)
47  {
48  // This should probably happen early.
49  sysdep_init ();
50  }
51 
52  bool qt_application::start_gui_p (void) const
53  {
54  return m_options.gui ();
55  }
56 
58  {
60 
62 
63  // Create and show main window.
64 
65  if (start_gui_p ())
66  {
67  gui_qobject gui_interface (*this);
68  return gui_interface.exec ();
69  }
70  else
71  {
72  cli_qobject cli_interface (*this);
73  return cli_interface.exec ();
74  }
75  }
76 }
cmdline_options m_options
Definition: octave.h:333
This object provides a command-line interface to Octave that may use Qt graphics.
bool gui(void) const
Definition: octave.h:60
This object provides a full GUI interface to Octave that is implemented Qt.
qt_application(int argc, char **argv)
bool start_gui_p(void) const
void set_application_id(void)
Definition: sysdep.cc:186
void sysdep_init(void)
Definition: sysdep.cc:433
void octave_block_interrupt_signal(void)