26 DButtonBoxButton(
const QIcon& icon,
const QString &text = QString(), QWidget *parent =
nullptr);
27 DButtonBoxButton(QStyle::StandardPixmap iconType =
static_cast<QStyle::StandardPixmap
>(-1),
28 const QString &text = QString(), QWidget *parent =
nullptr);
30 const QString &text = QString(), QWidget *parent =
nullptr);
31 DButtonBoxButton(
const DDciIcon &dciIcon,
const QString &text = QString(), QWidget *parent =
nullptr);
33 void setIcon(
const QIcon &icon);
34 void setIcon(QStyle::StandardPixmap iconType);
37 void setIcon(
const DDciIcon &icon);
38 DDciIcon dciIcon()
const;
40 QSize iconSize()
const;
41 QSize sizeHint()
const;
42 QSize minimumSizeHint()
const override;
47 void paintEvent(QPaintEvent *e)
override;
48 void keyPressEvent(QKeyEvent *event)
override;
49 bool event(QEvent *e)
override;
55class DButtonBox :
public QWidget,
public DCORE_NAMESPACE::DObject
61 explicit DButtonBox(QWidget *parent =
nullptr);
63 Qt::Orientation orientation()
const;
64 void setOrientation(Qt::Orientation orientation);
66 void setButtonList(
const QList<DButtonBoxButton*> &list,
bool checkable);
67 QList<QAbstractButton*> buttonList()
const;
69 QAbstractButton * checkedButton()
const;
72 QAbstractButton *button(
int id)
const;
73 void setId(QAbstractButton *button,
int id);
74 int id(QAbstractButton *button)
const;
75 int checkedId()
const;
78 void buttonClicked(QAbstractButton *);
79 void buttonPressed(QAbstractButton *);
80 void buttonReleased(QAbstractButton *);
81 void buttonToggled(QAbstractButton *,
bool);
84 bool eventFilter(QObject *o, QEvent *e)
override;
87 void paintEvent(QPaintEvent *e)
override;