Code clean, and code style error fix.

This commit is contained in:
Krad
2022-04-22 17:16:45 +08:00
parent 7cee364fc3
commit 27487fdf3c
21 changed files with 198 additions and 240 deletions

View File

@@ -45,7 +45,7 @@ ImageSwitch::ButtonStyle ImageSwitch::getButtonStyle() const
QSize ImageSwitch::sizeHint() const
{
return QSize(100, 50);
return {100, 50};
}
QSize ImageSwitch::minimumSizeHint() const
@@ -53,19 +53,19 @@ QSize ImageSwitch::minimumSizeHint() const
return sizeHint();
}
void ImageSwitch::setChecked(bool isChecked)
void ImageSwitch::setChecked(bool value)
{
if (this->isChecked != isChecked) {
this->isChecked = isChecked;
if (this->isChecked != value) {
this->isChecked = value;
imgFile = isChecked ? imgOnFile : imgOffFile;
this->update();
}
}
void ImageSwitch::setButtonStyle(const ImageSwitch::ButtonStyle& buttonStyle)
void ImageSwitch::setButtonStyle(const ImageSwitch::ButtonStyle& style)
{
if (this->buttonStyle != buttonStyle) {
this->buttonStyle = buttonStyle;
if (this->buttonStyle != style) {
this->buttonStyle = style;
if (buttonStyle == ButtonStyle_1) {
imgOffFile = ":/icons/imageswitch/btncheckoff1.png";