GNU Octave  6.2.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-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 (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 
37 namespace octave
38 {
39  class base_qobject;
40  class interpreter;
41 }
42 
43 namespace QtHandles
44 {
45 
46  class Container;
47 
48  class ButtonGroup : public Object
49  {
50  Q_OBJECT
51 
52  public:
54  const graphics_object& go, QButtonGroup *buttongroup,
55  QFrame *frame);
56  ~ButtonGroup (void);
57 
58  Container * innerContainer (void) { return m_container; }
59 
60  bool eventFilter (QObject *watched, QEvent *event);
61 
62  static ButtonGroup *
64  const graphics_object& go);
65 
66  void addButton (QAbstractButton *btn);
67 
68  void selectNothing (void);
69 
70  protected:
71  void update (int pId);
72  void redraw (void);
73 
74  private slots:
75  void buttonToggled (bool toggled);
76  void buttonClicked (QAbstractButton *btn);
77 
78  private:
79  void updateLayout (void);
80 
81  private:
82  QButtonGroup *m_buttongroup;
83  QRadioButton *m_hiddenbutton;
85  QLabel *m_title;
87  };
88 
89 }
90 
91 #endif
void buttonClicked(QAbstractButton *btn)
Definition: ButtonGroup.cc:500
Container * innerContainer(void)
Definition: ButtonGroup.h:58
void buttonToggled(bool toggled)
Definition: ButtonGroup.cc:471
QButtonGroup * m_buttongroup
Definition: ButtonGroup.h:82
bool eventFilter(QObject *watched, QEvent *event)
Definition: ButtonGroup.cc:192
void update(int pId)
Definition: ButtonGroup.cc:270
static ButtonGroup * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: ButtonGroup.cc:102
void addButton(QAbstractButton *btn)
Definition: ButtonGroup.cc:464
Container * m_container
Definition: ButtonGroup.h:84
ButtonGroup(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QButtonGroup *buttongroup, QFrame *frame)
Definition: ButtonGroup.cc:122
QRadioButton * m_hiddenbutton
Definition: ButtonGroup.h:83
Base class for Octave interfaces that use Qt.