1 | /* |
2 | SPDX-FileCopyrightText: 2012-2013 Evan Teran <evan.teran@gmail.com> |
3 | SPDX-FileCopyrightText: 2006 Michel Marti <mma@objectxp.com> |
4 | |
5 | SPDX-License-Identifier: GPL-2.0-or-later |
6 | */ |
7 | |
8 | #pragma once |
9 | |
10 | #include <QFrame> |
11 | |
12 | class QButtonGroup; |
13 | class QAbstractButton; |
14 | class KCalcBitset : public QFrame |
15 | { |
16 | Q_OBJECT |
17 | |
18 | public: |
19 | explicit KCalcBitset(QWidget *parent = nullptr); |
20 | Q_REQUIRED_RESULT quint64 getValue() const; |
21 | |
22 | protected: |
23 | void resizeEvent(QResizeEvent *event) override; |
24 | |
25 | public Q_SLOTS: |
26 | void setValue(quint64 value); |
27 | void slotToggleBit(QAbstractButton *button); |
28 | |
29 | Q_SIGNALS: |
30 | void valueChanged(quint64 value); |
31 | |
32 | private: |
33 | QButtonGroup *const bit_button_group_; |
34 | quint64 value_; |
35 | float ratio_; |
36 | }; |
37 | |
38 | |