Code clean, and code style error fix.
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user