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