GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ButtonGroup.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2016-2017 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 the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 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 <http://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:11584
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