GNU Octave  4.4.1
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-2018 Andrew Thornton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_ButtonGroup_h)
24 #define octave_ButtonGroup_h 1
25 
26 #include "Object.h"
27 
28 class QAbstractButton;
29 class QButtonGroup;
30 class QFrame;
31 class QLabel;
32 class QRadioButton;
33 
34 namespace QtHandles
35 {
36 
37  class Container;
38 
39  class ButtonGroup : public Object
40  {
41  Q_OBJECT
42 
43  public:
44  ButtonGroup (const graphics_object& go, QButtonGroup *buttongroup,
45  QFrame *frame);
46  ~ButtonGroup (void);
47 
48  Container * innerContainer (void) { return m_container; }
49 
50  bool eventFilter (QObject *watched, QEvent *event);
51 
52  static ButtonGroup * create (const graphics_object& go);
53 
54  void addButton (QAbstractButton *btn);
55 
56  void selectNothing (void);
57 
58  protected:
59  void update (int pId);
60  void redraw (void);
61 
62  private slots:
63  void buttonToggled (bool toggled);
64  void buttonClicked (QAbstractButton *btn);
65 
66  private:
67  void updateLayout (void);
68 
69  private:
70  QButtonGroup *m_buttongroup;
71  QRadioButton *m_hiddenbutton;
73  QLabel *m_title;
75  };
76 
77 }
78 
79 #endif
static ButtonGroup * create(const graphics_object &go)
Definition: ButtonGroup.cc:96
void addButton(QAbstractButton *btn)
Definition: ButtonGroup.cc:436
void buttonClicked(QAbstractButton *btn)
Definition: ButtonGroup.cc:469
void update(int pId)
Definition: ButtonGroup.cc:250
Container * innerContainer(void)
Definition: ButtonGroup.h:48
QRadioButton * m_hiddenbutton
Definition: ButtonGroup.h:71
bool eventFilter(QObject *watched, QEvent *event)
Definition: ButtonGroup.cc:176
octave::unwind_protect frame
Definition: graphics.cc:12190
void buttonToggled(bool toggled)
Definition: ButtonGroup.cc:443
ButtonGroup(const graphics_object &go, QButtonGroup *buttongroup, QFrame *frame)
Definition: ButtonGroup.cc:114
Container * m_container
Definition: ButtonGroup.h:72
QButtonGroup * m_buttongroup
Definition: ButtonGroup.h:70