From 270bdf7472746ab19c51bca2eb0660c1ae78bd85 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Tue, 15 Dec 2020 09:06:11 +0200 Subject: [PATCH] Draw settings check and radio buttons and workaround background image issues (#856) IB-6572 Signed-off-by: Raul Metsma --- CMakeLists.txt | 2 +- client/CMakeLists.txt | 2 + client/dialogs/FirstRun.cpp | 2 +- client/dialogs/FirstRun.ui | 11 ++-- client/dialogs/SettingsDialog.cpp | 15 ++--- client/dialogs/SettingsDialog.h | 6 +- client/dialogs/SettingsDialog.ui | 93 +++++++++++---------------- client/dialogs/SmartIDDialog.cpp | 2 +- client/dialogs/SmartIDDialog.ui | 11 ++-- client/images/arrow_down.svg | 12 +--- client/images/arrow_down_selected.svg | 12 +--- client/images/arrow_up.svg | 11 +--- client/images/arrow_up_white.svg | 11 +--- client/widgets/CheckBox.cpp | 50 ++++++++++++++ client/widgets/CheckBox.h | 32 +++++++++ client/widgets/MainAction.cpp | 43 +++++++++++-- client/widgets/MainAction.h | 2 +- client/widgets/MainAction.ui | 2 +- client/widgets/RadioButton.cpp | 48 ++++++++++++++ client/widgets/RadioButton.h | 32 +++++++++ 20 files changed, 271 insertions(+), 128 deletions(-) create mode 100644 client/widgets/CheckBox.cpp create mode 100644 client/widgets/CheckBox.h create mode 100644 client/widgets/RadioButton.cpp create mode 100644 client/widgets/RadioButton.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 635d83f7f..bc912f379 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ include( VersionInfo ) find_package( PKCS11 ) find_package( LibDigiDocpp 3.14.4 REQUIRED ) find_package( LDAP REQUIRED ) -find_package( Qt5 COMPONENTS Core Widgets Network PrintSupport Svg LinguistTools REQUIRED ) +find_package( Qt5 5.9.0 REQUIRED COMPONENTS Core Widgets Network PrintSupport Svg LinguistTools ) set_env( TSL_URL "https://ec.europa.eu/tools/lotl/eu-lotl.xml" CACHE STRING "TSL trust list primary URL" ) set_env( TSL_INCLUDE "EE" CACHE STRING "TSL list include in binary" ) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 53f3524f9..1fbc84e87 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -99,6 +99,7 @@ add_executable( ${PROGNAME} WIN32 MACOSX_BUNDLE widgets/AddressItem.cpp widgets/CardWidget.cpp widgets/CardPopup.cpp + widgets/CheckBox.cpp widgets/ContainerPage.cpp widgets/ComboBox.cpp widgets/DropdownButton.cpp @@ -113,6 +114,7 @@ add_executable( ${PROGNAME} WIN32 MACOSX_BUNDLE widgets/NoCardInfo.cpp widgets/OtherData.cpp widgets/PageIcon.cpp + widgets/RadioButton.cpp widgets/SignatureItem.cpp widgets/StyledWidget.cpp widgets/VerifyCert.cpp diff --git a/client/dialogs/FirstRun.cpp b/client/dialogs/FirstRun.cpp index 05f4e98d6..11b713ccf 100644 --- a/client/dialogs/FirstRun.cpp +++ b/client/dialogs/FirstRun.cpp @@ -65,7 +65,7 @@ FirstRun::FirstRun(QWidget *parent) else ui->lang->setCurrentIndex(0); - connect( ui->lang, static_cast(&QComboBox::currentIndexChanged), this, [this](int index) { + connect(ui->lang, QOverload::of(&QComboBox::currentIndexChanged), this, [this](int index) { switch(index) { case 1: emit langChanged(QStringLiteral("en")); break; diff --git a/client/dialogs/FirstRun.ui b/client/dialogs/FirstRun.ui index 700ca470b..f69f9072a 100644 --- a/client/dialogs/FirstRun.ui +++ b/client/dialogs/FirstRun.ui @@ -99,16 +99,15 @@ QComboBox QWidget#content { /* rows */ QComboBox QPushButton { margin: 3px; - padding: 0px 4px 0px 8px; + padding: 0px 8px 0px 4px; border: 0px; color: #353739; text-align: left; + qproperty-iconSize: 14px 9px; + qproperty-layoutDirection: RightToLeft; } QComboBox QPushButton#selected { - background-image: url(:/images/arrow_up.svg); - background-position: right center; - background-repeat: none; - background-origin: content; + qproperty-icon: url(:/images/arrow_up.svg); } /* hover row */ @@ -117,7 +116,7 @@ QComboBox QPushButton:hover { color: #FFFFFF; } QComboBox QPushButton:hover#selected { - background-image: url(:/images/arrow_up_white.svg); + qproperty-icon: url(:/images/arrow_up_white.svg); } /* drop-down button*/ diff --git a/client/dialogs/SettingsDialog.cpp b/client/dialogs/SettingsDialog.cpp index 1468f45fb..1c7ff1ce2 100644 --- a/client/dialogs/SettingsDialog.cpp +++ b/client/dialogs/SettingsDialog.cpp @@ -49,12 +49,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -245,7 +245,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) ui->pageGroup->setId(ui->btnMenuProxy, NetworkSettings); ui->pageGroup->setId(ui->btnMenuDiagnostics, DiagnosticsSettings); ui->pageGroup->setId(ui->btnMenuInfo, LicenseSettings); - connect(ui->pageGroup, static_cast(&QButtonGroup::buttonClicked), this, &SettingsDialog::changePage); + connect(ui->pageGroup, QOverload::of(&QButtonGroup::buttonClicked), this, &SettingsDialog::changePage); initFunctionality(); updateVersion(); @@ -258,7 +258,6 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent) showPage(page); } - SettingsDialog::~SettingsDialog() { QApplication::restoreOverrideCursor(); @@ -359,7 +358,7 @@ void SettingsDialog::initFunctionality() if(!dir.isEmpty()) { ui->rdGeneralSpecifyDirectory->setChecked(true); - setValueEx(QStringLiteral("DefaultDir"), dir, QString()); + setValueEx(QStringLiteral("DefaultDir"), dir); ui->txtGeneralDirectory->setText(dir); } }); @@ -373,7 +372,7 @@ void SettingsDialog::initFunctionality() if(ui->txtGeneralDirectory->text().isEmpty()) ui->rdGeneralSameDirectory->setChecked(true); connect(ui->txtGeneralDirectory, &QLineEdit::textChanged, this, [](const QString &text) { - setValueEx(QStringLiteral("DefaultDir"), text, QString()); + setValueEx(QStringLiteral("DefaultDir"), text); }); #endif @@ -444,8 +443,8 @@ void SettingsDialog::initFunctionality() ui->rdMIDUUIDCustom->setChecked(s.value(QStringLiteral("MIDUUID-CUSTOM"), s.contains(QStringLiteral("MIDUUID"))).toBool()); ui->txtMIDUUID->setText(s.value(QStringLiteral("MIDUUID")).toString()); connect(ui->txtMIDUUID, &QLineEdit::textChanged, this, [](const QString &text) { - setValueEx(QStringLiteral("MIDUUID"), text, QString()); - setValueEx(QStringLiteral("SIDUUID"), text, QString()); + setValueEx(QStringLiteral("MIDUUID"), text); + setValueEx(QStringLiteral("SIDUUID"), text); }); connect(ui->helpRevocation, &QToolButton::clicked, this, []{ QDesktopServices::openUrl(tr("https://www.id.ee/en/article/access-certificate-what-is-it/")); @@ -531,7 +530,7 @@ void SettingsDialog::saveProxy() void SettingsDialog::setValueEx(const QString &key, const QVariant &value, const QVariant &def) { - if(value == def) + if(value == def || (def.isNull() && value.isNull())) QSettings().remove(key); else QSettings().setValue(key, value); diff --git a/client/dialogs/SettingsDialog.h b/client/dialogs/SettingsDialog.h index 70809749d..97d2407dc 100644 --- a/client/dialogs/SettingsDialog.h +++ b/client/dialogs/SettingsDialog.h @@ -21,6 +21,8 @@ #include +#include + namespace digidoc { class Conf; } namespace Ui { @@ -29,7 +31,7 @@ class SettingsDialog; class QAbstractButton; -class SettingsDialog : public QDialog +class SettingsDialog final: public QDialog { Q_OBJECT @@ -48,7 +50,7 @@ class SettingsDialog : public QDialog void showPage(int page); static void loadProxy( const digidoc::Conf *conf ); - static void setValueEx( const QString &key, const QVariant &value, const QVariant &def ); + static void setValueEx(const QString &key, const QVariant &value, const QVariant &def = {}); signals: void langChanged(const QString& lang); diff --git a/client/dialogs/SettingsDialog.ui b/client/dialogs/SettingsDialog.ui index 0ffe2d002..453be698a 100644 --- a/client/dialogs/SettingsDialog.ui +++ b/client/dialogs/SettingsDialog.ui @@ -233,6 +233,12 @@ QLineEdit { background-color: #FFFFFF; min-height: 31px; } +QCheckBox, QRadioButton { + min-height: 31px; +} +QCheckBox:disabled { + color: #75787B; +} QCheckBox::indicator, QRadioButton::indicator { width: 14px; height: 14px; @@ -286,7 +292,7 @@ QRadioButton::indicator::checked { - + Eesti @@ -299,7 +305,7 @@ QRadioButton::indicator::checked { - + Русский @@ -309,7 +315,7 @@ QRadioButton::indicator::checked { - + English @@ -334,7 +340,7 @@ QRadioButton::indicator::checked { - + Online TSL digest check @@ -344,14 +350,14 @@ QRadioButton::indicator::checked { - + Show print summary - + Ask role and address info on signing @@ -373,10 +379,10 @@ QRadioButton::indicator::checked { 2 - 20 + 0 - + Same folder @@ -386,7 +392,7 @@ QRadioButton::indicator::checked { - + Select the default directory @@ -398,7 +404,7 @@ QRadioButton::indicator::checked { - + @@ -420,13 +426,13 @@ QRadioButton::indicator::checked { - + - + I would like to sign with Lithuanian, Latvian ID-card @@ -454,9 +460,6 @@ QPushButton { padding-bottom:1px; text-align: middle; min-height: 30px; -} -QRadioButton, QCheckBox { - min-height: 31px; } @@ -609,7 +612,7 @@ QRadioButton, QCheckBox { - + Ignore server access certificate (IP based access) @@ -687,7 +690,7 @@ QRadioButton, QCheckBox { - + Use default access @@ -700,7 +703,7 @@ QRadioButton, QCheckBox { - + Use manually configured access @@ -772,7 +775,7 @@ QRadioButton, QCheckBox { - + Use default access @@ -785,7 +788,7 @@ QRadioButton, QCheckBox { - + Use manually configured access @@ -846,13 +849,7 @@ QRadioButton, QCheckBox { 20 - - - - 0 - 31 - - + No proxy @@ -862,26 +859,14 @@ QRadioButton, QCheckBox { - - - - 0 - 31 - - + Use system proxy settings - - - - 0 - 31 - - + Manual proxy configuration @@ -950,19 +935,7 @@ QRadioButton, QCheckBox { - - - - 0 - 31 - - - - QCheckBox:disabled { - color: #75787B; -} - - + Enable proxy for SSL connections @@ -1022,7 +995,7 @@ QScrollBar::sub-line:vertical { - + Enable one-time log generation @@ -1387,6 +1360,16 @@ QPushButton:disabled {
QtSvg/QSvgWidget
1 + + CheckBox + QCheckBox +
widgets/CheckBox.h
+
+ + RadioButton + QRadioButton +
widgets/RadioButton.h
+
diff --git a/client/dialogs/SmartIDDialog.cpp b/client/dialogs/SmartIDDialog.cpp index cead9b389..38cf68066 100644 --- a/client/dialogs/SmartIDDialog.cpp +++ b/client/dialogs/SmartIDDialog.cpp @@ -67,7 +67,7 @@ SmartIDDialog::SmartIDDialog(QWidget *parent) ui->idCode->setValidator(country() == EE ? ik : nullptr); bool checked = ui->cbRemember->isChecked(); SettingsDialog::setValueEx(QStringLiteral("SmartIDSettings"), checked, true); - SettingsDialog::setValueEx(QStringLiteral("SmartID"), checked ? idCode() : QString(), QString()); + SettingsDialog::setValueEx(QStringLiteral("SmartID"), checked ? idCode() : QString()); SettingsDialog::setValueEx(QStringLiteral("SmartIDCountry"), checked ? country() : EE, EE); ui->sign->setToolTip(QString()); if(!idCode().isEmpty() && country() == EE && !IKValidator::isValid(idCode())) diff --git a/client/dialogs/SmartIDDialog.ui b/client/dialogs/SmartIDDialog.ui index 7c7d49e03..3270dc23e 100644 --- a/client/dialogs/SmartIDDialog.ui +++ b/client/dialogs/SmartIDDialog.ui @@ -33,23 +33,22 @@ background-color: #FFFFFF; } QComboBox QPushButton { margin: 3px; -padding: 0px 4px 0px 8px; +padding: 0px 8px 0px 4px; border: 0px; color: #353739; text-align: left; +qproperty-iconSize: 14px 9px; +qproperty-layoutDirection: RightToLeft; } QComboBox QPushButton#selected { -background-image: url(:/images/arrow_up.svg); -background-position: right center; -background-repeat: none; -background-origin: content; +qproperty-icon: url(:/images/arrow_up.svg); } QComboBox QPushButton:hover { background-color: #006EB5; color: #FFFFFF; } QComboBox QPushButton:hover#selected { -background-image: url(:/images/arrow_up_white.svg); +qproperty-icon: url(:/images/arrow_up_white.svg); } QComboBox::drop-down { background-color: #FFFFFF; diff --git a/client/images/arrow_down.svg b/client/images/arrow_down.svg index 20f0a8706..a764a0279 100644 --- a/client/images/arrow_down.svg +++ b/client/images/arrow_down.svg @@ -1,14 +1,4 @@ - - Accordion_arrow Copy 2 - Created with Sketch. - - - - - - - - + \ No newline at end of file diff --git a/client/images/arrow_down_selected.svg b/client/images/arrow_down_selected.svg index 20340abdb..632c92dac 100644 --- a/client/images/arrow_down_selected.svg +++ b/client/images/arrow_down_selected.svg @@ -1,14 +1,4 @@ - - Accordion_arrow Copy 2 - Created with Sketch. - - - - - - - - + \ No newline at end of file diff --git a/client/images/arrow_up.svg b/client/images/arrow_up.svg index 6b4adf2a7..d0c8cf108 100644 --- a/client/images/arrow_up.svg +++ b/client/images/arrow_up.svg @@ -1,13 +1,4 @@ - Accordion_arrow Copy 2 - - - - - - - - - + \ No newline at end of file diff --git a/client/images/arrow_up_white.svg b/client/images/arrow_up_white.svg index 651803211..f4147bf1c 100644 --- a/client/images/arrow_up_white.svg +++ b/client/images/arrow_up_white.svg @@ -1,13 +1,4 @@ - Accordion_arrow Copy 2 - - - - - - - - - + \ No newline at end of file diff --git a/client/widgets/CheckBox.cpp b/client/widgets/CheckBox.cpp new file mode 100644 index 000000000..f666f0d02 --- /dev/null +++ b/client/widgets/CheckBox.cpp @@ -0,0 +1,50 @@ +/* + * QDigiDoc4 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "CheckBox.h" + +#include +#include +#include + +CheckBox::CheckBox(QWidget *parent) + : QCheckBox(parent) +{} + +void CheckBox::paintEvent(QPaintEvent *event) +{ + QCheckBox::paintEvent(event); + QRect rect(0, 0, 14, 14); + rect.moveCenter(QPoint(rect.center().x() + 1, event->rect().center().y())); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + painter.setRenderHint(QPainter::HighQualityAntialiasing); + painter.fillRect(rect, Qt::white); + painter.setPen(QStringLiteral("#AAADAD")); + painter.drawRoundedRect(rect, 2.0, 2.0); + if (isChecked()) + { + rect.adjust(3, 3, -3, -3); + painter.setPen(QPen(QColor(QStringLiteral("#0C5AA6")), 2, Qt::SolidLine, Qt::RoundCap)); + QPainterPath path(QPointF(rect.left(), rect.center().y())); + path.lineTo(rect.center().x(), rect.bottom()); + path.lineTo(rect.right(), rect.top()); + painter.drawPath(path); + } +} diff --git a/client/widgets/CheckBox.h b/client/widgets/CheckBox.h new file mode 100644 index 000000000..ec4b8015f --- /dev/null +++ b/client/widgets/CheckBox.h @@ -0,0 +1,32 @@ +/* + * QDigiDoc4 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#pragma once + +#include + +class CheckBox : public QCheckBox +{ + Q_OBJECT +public: + explicit CheckBox(QWidget *parent = nullptr); + +private: + void paintEvent(QPaintEvent *event) override; +}; diff --git a/client/widgets/MainAction.cpp b/client/widgets/MainAction.cpp index 3567dbfc5..3c6054422 100644 --- a/client/widgets/MainAction.cpp +++ b/client/widgets/MainAction.cpp @@ -23,6 +23,8 @@ #include "dialogs/SettingsDialog.h" #include +#include +#include using namespace ria::qdigidoc4; @@ -40,6 +42,7 @@ MainAction::MainAction(QWidget *parent) ui->setupUi(this); ui->mainAction->setFont(Styles::font(Styles::Condensed, 16)); ui->otherCards->hide(); + ui->otherCards->installEventFilter(this); parent->installEventFilter(this); move(parent->width() - width(), parent->height() - height()); @@ -75,12 +78,12 @@ void MainAction::hideDropdown() setStyleSheet(QStringLiteral("QPushButton { border-top-left-radius: 2px; }")); } -bool MainAction::eventFilter(QObject *o, QEvent *e) +bool MainAction::eventFilter(QObject *watched, QEvent *event) { - switch(e->type()) + switch(event->type()) { case QEvent::Resize: - if(o == parentWidget()) + if(watched == parentWidget()) { move(parentWidget()->width() - width(), parentWidget()->height() - height()); int i = 1; @@ -88,9 +91,41 @@ bool MainAction::eventFilter(QObject *o, QEvent *e) other->move(pos() + QPoint(0, (-height() - 1) * (i++))); } break; + case QEvent::MouseButtonPress: + if(watched == ui->otherCards) + ui->otherCards->setProperty("pressed", true); + break; + case QEvent::MouseButtonRelease: + if(watched == ui->otherCards) + ui->otherCards->setProperty("pressed", false); + break; + case QEvent::Paint: + if(watched == ui->otherCards) + { + QPaintEvent *paintEvent = static_cast(event); + QToolButton *button = qobject_cast(watched); + QPainter painter(button); + painter.setRenderHint(QPainter::Antialiasing); + painter.setRenderHint(QPainter::HighQualityAntialiasing); + if(ui->otherCards->property("pressed").toBool()) + painter.fillRect(paintEvent->rect(), QStringLiteral("#41B6E6")); + else if(paintEvent->rect().contains(button->mapFromGlobal(QCursor::pos()))) + painter.fillRect(paintEvent->rect(), QStringLiteral("#008DCF")); + else + painter.fillRect(paintEvent->rect(), QStringLiteral("#006EB5")); + QRect rect(0, 0, 13, 6); + rect.moveCenter(paintEvent->rect().center()); + painter.setPen(QPen(Qt::white, 2)); + QPainterPath path(rect.bottomLeft()); + path.lineTo(rect.center().x(), rect.top()); + path.lineTo(rect.bottomRight()); + painter.drawPath(path); + return true; + } + break; default: break; } - return QWidget::eventFilter(o, e); + return QWidget::eventFilter(watched, event); } diff --git a/client/widgets/MainAction.h b/client/widgets/MainAction.h index 790337c0c..80349614c 100644 --- a/client/widgets/MainAction.h +++ b/client/widgets/MainAction.h @@ -40,7 +40,7 @@ class MainAction final : public QWidget private: void changeEvent(QEvent* event) override; - bool eventFilter(QObject *o, QEvent *e) override; + bool eventFilter(QObject *watched, QEvent *event) override; QString label(ria::qdigidoc4::Actions action) const; void showDropdown(); void update(); diff --git a/client/widgets/MainAction.ui b/client/widgets/MainAction.ui index 97037364e..9c00d7548 100644 --- a/client/widgets/MainAction.ui +++ b/client/widgets/MainAction.ui @@ -34,7 +34,7 @@ background-color: #1a7dbc; - 166 + 0 65 diff --git a/client/widgets/RadioButton.cpp b/client/widgets/RadioButton.cpp new file mode 100644 index 000000000..bfb0006f8 --- /dev/null +++ b/client/widgets/RadioButton.cpp @@ -0,0 +1,48 @@ +/* + * QDigiDoc4 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "RadioButton.h" + +#include +#include +#include + +RadioButton::RadioButton(QWidget *parent) + : QRadioButton(parent) +{} + +void RadioButton::paintEvent(QPaintEvent *event) +{ + QRadioButton::paintEvent(event); + QRect rect(0, 0, 14, 14); + rect.moveCenter(QPoint(rect.center().x() + 1, event->rect().center().y())); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + painter.setRenderHint(QPainter::HighQualityAntialiasing); + painter.fillRect(rect, Qt::white); + painter.setPen(QStringLiteral("#AAADAD")); + painter.drawEllipse(rect); + if (isChecked()) + { + rect.adjust(3, 3, -3, -3); + painter.setPen(QStringLiteral("#0C5AA6")); + painter.setBrush(painter.pen().color()); + painter.drawEllipse(rect); + } +} diff --git a/client/widgets/RadioButton.h b/client/widgets/RadioButton.h new file mode 100644 index 000000000..3a3623ab9 --- /dev/null +++ b/client/widgets/RadioButton.h @@ -0,0 +1,32 @@ +/* + * QDigiDoc4 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#pragma once + +#include + +class RadioButton : public QRadioButton +{ + Q_OBJECT +public: + explicit RadioButton(QWidget *parent = nullptr); + +private: + void paintEvent(QPaintEvent *event) override; +};