[Qt] Add constructor to XCheckBox that takes a text parameter
This commit is contained in:
parent
761f3a4735
commit
b2d7ea11f5
|
@ -13,6 +13,11 @@ XCheckBox::XCheckBox(QWidget* parent)
|
||||||
setFocusPolicy(Qt::TabFocus); // disable retaining focus through mouse click
|
setFocusPolicy(Qt::TabFocus); // disable retaining focus through mouse click
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XCheckBox::XCheckBox(const QString& title, QWidget* parent)
|
||||||
|
: Themeable<QCheckBox>("XCheckBox", title, parent) {
|
||||||
|
setFocusPolicy(Qt::TabFocus); // disable retaining focus through mouse click
|
||||||
|
}
|
||||||
|
|
||||||
void XCheckBox::paintEvent(QPaintEvent* e) {
|
void XCheckBox::paintEvent(QPaintEvent* e) {
|
||||||
QStyleOptionButton option;
|
QStyleOptionButton option;
|
||||||
initStyleOption(&option);
|
initStyleOption(&option);
|
||||||
|
|
|
@ -19,6 +19,7 @@ class XCheckBox : public Themeable<QCheckBox> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit XCheckBox(QWidget* parent = nullptr);
|
explicit XCheckBox(QWidget* parent = nullptr);
|
||||||
|
XCheckBox(const QString& text, QWidget* parent = nullptr);
|
||||||
|
|
||||||
bool custom() const { return custom_; }
|
bool custom() const { return custom_; }
|
||||||
void set_custom(bool value) { custom_ = value; }
|
void set_custom(bool value) { custom_ = value; }
|
||||||
|
|
Loading…
Reference in New Issue