更新文档
This commit is contained in:
@@ -36,16 +36,6 @@ void ImageSwitch::paintEvent(QPaintEvent *)
|
||||
painter.drawImage(point, img);
|
||||
}
|
||||
|
||||
bool ImageSwitch::getChecked() const
|
||||
{
|
||||
return isChecked;
|
||||
}
|
||||
|
||||
ImageSwitch::ButtonStyle ImageSwitch::getButtonStyle() const
|
||||
{
|
||||
return this->buttonStyle;
|
||||
}
|
||||
|
||||
QSize ImageSwitch::sizeHint() const
|
||||
{
|
||||
return QSize(87, 28);
|
||||
@@ -56,6 +46,11 @@ QSize ImageSwitch::minimumSizeHint() const
|
||||
return QSize(87, 28);
|
||||
}
|
||||
|
||||
bool ImageSwitch::getChecked() const
|
||||
{
|
||||
return isChecked;
|
||||
}
|
||||
|
||||
void ImageSwitch::setChecked(bool isChecked)
|
||||
{
|
||||
if (this->isChecked != isChecked) {
|
||||
@@ -65,6 +60,11 @@ void ImageSwitch::setChecked(bool isChecked)
|
||||
}
|
||||
}
|
||||
|
||||
ImageSwitch::ButtonStyle ImageSwitch::getButtonStyle() const
|
||||
{
|
||||
return this->buttonStyle;
|
||||
}
|
||||
|
||||
void ImageSwitch::setButtonStyle(const ImageSwitch::ButtonStyle &buttonStyle)
|
||||
{
|
||||
if (this->buttonStyle != buttonStyle) {
|
||||
|
||||
@@ -36,24 +36,24 @@ protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
|
||||
private:
|
||||
bool isChecked;
|
||||
ButtonStyle buttonStyle;
|
||||
bool isChecked; //是否选中
|
||||
ButtonStyle buttonStyle; //按钮样式
|
||||
|
||||
QString imgOffFile;
|
||||
QString imgOnFile;
|
||||
QString imgFile;
|
||||
QString imgOffFile; //关闭图片
|
||||
QString imgOnFile; //开启图片
|
||||
QString imgFile; //当前图片
|
||||
|
||||
public:
|
||||
bool getChecked() const;
|
||||
ButtonStyle getButtonStyle() const;
|
||||
//默认尺寸和最小尺寸
|
||||
QSize sizeHint() const;
|
||||
QSize minimumSizeHint() const;
|
||||
|
||||
QSize sizeHint() const;
|
||||
QSize minimumSizeHint() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
//设置是否选中
|
||||
//获取和设置是否选中
|
||||
bool getChecked() const;
|
||||
void setChecked(bool isChecked);
|
||||
//设置按钮样式
|
||||
|
||||
//获取和设置按钮样式
|
||||
ButtonStyle getButtonStyle() const;
|
||||
void setButtonStyle(const ImageSwitch::ButtonStyle &buttonStyle);
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
Reference in New Issue
Block a user