CustomIconStyle.cpp 474 B

1234567891011121314151617181920212223242526272829
  1. #include "CustomIconStyle.h"
  2. CustomIconStyle::CustomIconStyle()
  3. {
  4. mSize = 30;
  5. }
  6. CustomIconStyle::~CustomIconStyle()
  7. {
  8. }
  9. void CustomIconStyle::SetCustomSize( int nSize )
  10. {
  11. mSize = nSize;
  12. }
  13. int CustomIconStyle::pixelMetric( PixelMetric metric, const QStyleOption * option, const QWidget * widget ) const
  14. {
  15. int s = QCommonStyle::pixelMetric(metric, option, widget);
  16. if (metric == QStyle::PM_SmallIconSize) {
  17. s = mSize;
  18. }
  19. return s;
  20. }