GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ButtonGroup.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2016-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_ButtonGroup_h)
27 #define octave_ButtonGroup_h 1
28 
29 #include "Object.h"
30 
31 class QAbstractButton;
32 class QButtonGroup;
33 class QFrame;
34 class QLabel;
35 class QRadioButton;
36 
38 
39 class base_qobject;
40 class interpreter;
41 
42 class Container;
43 
44 class ButtonGroup : public Object
45 {
46  Q_OBJECT
47 
48 public:
49  ButtonGroup (octave::base_qobject& oct_qobj, octave::interpreter& interp,
50  const graphics_object& go, QButtonGroup *buttongroup,
51  QFrame *frame);
52  ~ButtonGroup (void);
53 
54  Container * innerContainer (void) { return m_container; }
55 
56  bool eventFilter (QObject *watched, QEvent *event);
57 
58  static ButtonGroup *
59  create (octave::base_qobject& oct_qobj, octave::interpreter& interp,
60  const graphics_object& go);
61 
62  void addButton (QAbstractButton *btn);
63 
64  void selectNothing (void);
65 
66 protected:
67  void update (int pId);
68  void redraw (void);
69 
70 private slots:
71  void buttonToggled (bool toggled);
72  void buttonClicked (QAbstractButton *btn);
73 
74 private:
75  void updateLayout (void);
76 
77 private:
78  QButtonGroup *m_buttongroup;
79  QRadioButton *m_hiddenbutton;
83 };
84 
86 
87 #endif
OCTAVE_END_NAMESPACE(octave)
void updateLayout(void)
Definition: ButtonGroup.cc:419
Container * m_container
Definition: ButtonGroup.h:80
void redraw(void)
Definition: ButtonGroup.cc:407
ButtonGroup(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QButtonGroup *buttongroup, QFrame *frame)
Definition: ButtonGroup.cc:122
void buttonClicked(QAbstractButton *btn)
Definition: ButtonGroup.cc:502
~ButtonGroup(void)
Definition: ButtonGroup.cc:191
void selectNothing(void)
Definition: ButtonGroup.cc:460
QButtonGroup * m_buttongroup
Definition: ButtonGroup.h:78
void buttonToggled(bool toggled)
Definition: ButtonGroup.cc:473
void addButton(QAbstractButton *btn)
Definition: ButtonGroup.cc:466
bool m_blockUpdates
Definition: ButtonGroup.h:82
static ButtonGroup * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: ButtonGroup.cc:102
QRadioButton * m_hiddenbutton
Definition: ButtonGroup.h:79
QLabel * m_title
Definition: ButtonGroup.h:81
void update(int pId)
Definition: ButtonGroup.cc:273
Container * innerContainer(void)
Definition: ButtonGroup.h:54
bool eventFilter(QObject *watched, QEvent *event)
Definition: ButtonGroup.cc:195
Definition: Object.h:47
Base class for Octave interfaces that use Qt.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn