GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Menu.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2011-2023 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 (octave_Menu_h)
27 #define octave_Menu_h 1
28 
29 #include "MenuContainer.h"
30 #include "Object.h"
31 
32 class QAction;
33 class QMenu;
34 class QWidget;
35 
37 
38 class base_qobject;
39 class interpreter;
40 
41 class Menu : public Object, public MenuContainer
42 {
43  Q_OBJECT
44 
45 public:
46  Menu (octave::base_qobject& oct_qobj, octave::interpreter& interp,
47  const graphics_object& go, QAction *action, Object *parent);
48  ~Menu (void);
49 
50  static Menu *
51  create (octave::base_qobject& oct_qobj, octave::interpreter& interp,
52  const graphics_object& go);
53 
54  Container * innerContainer (void) { return nullptr; }
55 
56  QWidget * menu (void);
57 
58 protected:
59  void update (int pId);
60 
61 private slots:
62  void actionTriggered (void);
63  void actionHovered (void);
64 
65 private:
66  void updateSiblingPositions (void);
67 
68 private:
70  QAction *m_separator;
71 };
72 
74 
75 #endif
OCTAVE_END_NAMESPACE(octave)
Definition: Menu.h:42
QWidget * m_parent
Definition: Menu.h:69
Menu(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QAction *action, Object *parent)
Definition: Menu.cc:82
void actionTriggered(void)
Definition: Menu.cc:290
Container * innerContainer(void)
Definition: Menu.h:54
QWidget * menu(void)
Definition: Menu.cc:273
~Menu(void)
Definition: Menu.cc:166
void actionHovered(void)
Definition: Menu.cc:300
static Menu * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: Menu.cc:65
void update(int pId)
Definition: Menu.cc:170
QAction * m_separator
Definition: Menu.h:70
void updateSiblingPositions(void)
Definition: Menu.cc:306
Definition: Object.h:47
Base class for Octave interfaces that use Qt.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn