GNU Octave 7.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-2022 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
31class QAbstractButton;
32class QButtonGroup;
33class QFrame;
34class QLabel;
35class QRadioButton;
36
37namespace octave
38{
39 class base_qobject;
40 class interpreter;
41}
42
43namespace octave
44{
45
46 class Container;
47
48 class ButtonGroup : public Object
49 {
50 Q_OBJECT
51
52 public:
53 ButtonGroup (octave::base_qobject& oct_qobj, octave::interpreter& interp,
54 const graphics_object& go, QButtonGroup *buttongroup,
55 QFrame *frame);
56 ~ButtonGroup (void);
57
59
60 bool eventFilter (QObject *watched, QEvent *event);
61
62 static ButtonGroup *
63 create (octave::base_qobject& oct_qobj, octave::interpreter& interp,
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;
87 };
88
89}
90
91#endif
bool eventFilter(QObject *watched, QEvent *event)
Definition: ButtonGroup.cc:196
static ButtonGroup * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: ButtonGroup.cc:103
void updateLayout(void)
Definition: ButtonGroup.cc:420
QRadioButton * m_hiddenbutton
Definition: ButtonGroup.h:83
void buttonClicked(QAbstractButton *btn)
Definition: ButtonGroup.cc:504
Container * m_container
Definition: ButtonGroup.h:84
QButtonGroup * m_buttongroup
Definition: ButtonGroup.h:82
void addButton(QAbstractButton *btn)
Definition: ButtonGroup.cc:468
void buttonToggled(bool toggled)
Definition: ButtonGroup.cc:475
void selectNothing(void)
Definition: ButtonGroup.cc:461
ButtonGroup(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QButtonGroup *buttongroup, QFrame *frame)
Definition: ButtonGroup.cc:123
void update(int pId)
Definition: ButtonGroup.cc:274
Container * innerContainer(void)
Definition: ButtonGroup.h:58
Base class for Octave interfaces that use Qt.