File indexing completed on 2021-12-21 14:36:19

0001 /*
0002     SPDX-FileCopyrightText: 2012-2013 Evan Teran <evan.teran@gmail.com>
0003     SPDX-FileCopyrightText: 2006 Michel Marti <mma@objectxp.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include <QFrame>
0011 
0012 class QButtonGroup;
0013 class QAbstractButton;
0014 class KCalcBitset : public QFrame
0015 {
0016     Q_OBJECT
0017 
0018 public:
0019     explicit KCalcBitset(QWidget *parent = nullptr);
0020     Q_REQUIRED_RESULT quint64 getValue() const;
0021 
0022 protected:
0023     void resizeEvent(QResizeEvent *event) override;
0024 
0025 public Q_SLOTS:
0026     void setValue(quint64 value);
0027     void slotToggleBit(QAbstractButton *button);
0028 
0029 Q_SIGNALS:
0030     void valueChanged(quint64 value);
0031 
0032 private:
0033     QButtonGroup *const bit_button_group_;
0034     quint64 value_;
0035     float ratio_;
0036 };
0037