[Qt] Add constructor to XCheckBox that takes a text parameter

This commit is contained in:
Satori 2020-09-26 23:26:37 +01:00
parent 761f3a4735
commit b2d7ea11f5
2 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,11 @@ XCheckBox::XCheckBox(QWidget* parent)
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) {
QStyleOptionButton option;
initStyleOption(&option);

View File

@ -19,6 +19,7 @@ class XCheckBox : public Themeable<QCheckBox> {
public:
explicit XCheckBox(QWidget* parent = nullptr);
XCheckBox(const QString& text, QWidget* parent = nullptr);
bool custom() const { return custom_; }
void set_custom(bool value) { custom_ = value; }