#include<QtWidgets>
//该类用来设置背景图片
class StyleImge:public QCommonStyle{ Q_OBJECT //子类化 QCommonStyle 类#include<QtWidgets>
QPixmap m_Raised;
QPixmap m_Press;
QPixmap m_select;
//想优化内存的话可以用QMap<Key,T>,来装QPixmap,通过判断Key来区分或者有没有QPixmap
public:StyleImge(){}
StyleImge(QPixmap Raised ,QPixmap Press=QPixmap(),QPixmap select=QPixmap() ){
m_Raised=Raised;
if(Press.isNull()){
}else{
m_Press=Press;
}
if(select.isNull()){
}else{
m_select=select;
}
}
// //这个类的父类的析构不是虚函数,所以父类无法调用子类析构函数,例如:pare