2016-04-14 13:47:27 +00:00
|
|
|
#ifndef RADIOBUTTON_H
|
|
|
|
#define RADIOBUTTON_H
|
|
|
|
|
2016-06-12 16:02:45 +00:00
|
|
|
#include <QRadioButton>
|
2016-04-14 13:47:27 +00:00
|
|
|
|
2016-06-12 16:02:45 +00:00
|
|
|
class RadioButtonPrivate;
|
|
|
|
|
|
|
|
class RadioButton : public QRadioButton
|
2016-04-14 13:47:27 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit RadioButton(QWidget *parent = 0);
|
|
|
|
~RadioButton();
|
|
|
|
|
2016-06-12 23:19:14 +00:00
|
|
|
void setUseThemeColors(bool state);
|
|
|
|
bool useThemeColors() const;
|
|
|
|
|
|
|
|
void setCheckedColor(const QColor &color);
|
|
|
|
QColor checkedColor() const;
|
|
|
|
|
|
|
|
void setUncheckedColor(const QColor &color);
|
|
|
|
QColor uncheckedColor() const;
|
|
|
|
|
|
|
|
void setTextColor(const QColor &color);
|
|
|
|
QColor textColor() const;
|
|
|
|
|
|
|
|
void setDisabledColor(const QColor &color);
|
|
|
|
QColor disabledColor() const;
|
|
|
|
|
|
|
|
void setCheckedIcon(const QIcon &icon);
|
|
|
|
QIcon checkedIcon() const;
|
|
|
|
|
|
|
|
void setUncheckedIcon(const QIcon &icon);
|
|
|
|
QIcon uncheckedIcon() const;
|
|
|
|
|
|
|
|
void setIconSize(int size);
|
|
|
|
int iconSize() const;
|
|
|
|
|
2016-06-12 19:36:51 +00:00
|
|
|
QSize sizeHint() const;
|
|
|
|
|
2016-04-14 13:47:27 +00:00
|
|
|
protected:
|
2016-06-12 19:36:51 +00:00
|
|
|
bool event(QEvent *event) Q_DECL_OVERRIDE;
|
2016-04-14 13:47:27 +00:00
|
|
|
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
2016-06-12 16:02:45 +00:00
|
|
|
|
|
|
|
const QScopedPointer<RadioButtonPrivate> d_ptr;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(RadioButton)
|
|
|
|
Q_DECLARE_PRIVATE(RadioButton)
|
2016-04-14 13:47:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RADIOBUTTON_H
|