diff --git a/src/widgets/qqtcheckbox.cpp b/src/widgets/qqtcheckbox.cpp index 2f9f50fd..302d28d3 100644 --- a/src/widgets/qqtcheckbox.cpp +++ b/src/widgets/qqtcheckbox.cpp @@ -169,8 +169,16 @@ void QQtCheckBox::paintEvent ( QPaintEvent* event ) //qDebug() << isEnabled() << mWorkState; QStylePainter p ( this ); +#if 0 p.drawItemPixmap ( rect(), Qt::AlignCenter, QIcon ( QPixmap::fromImage ( mImage ) ).pixmap ( rect().size(), QIcon::Normal, QIcon::On ) ); +#else + p.drawItemPixmap ( rect(), Qt::AlignLeft | Qt::AlignTop, + /*不.copy() 切出图片的中间部分使用*/ + QPixmap::fromImage ( mImage + .scaled ( rect().width(), rect().height(), Qt::IgnoreAspectRatio ) + ) ); +#endif QStyleOptionButton opt; initStyleOption ( &opt ); diff --git a/src/widgets/qqtpushbutton.cpp b/src/widgets/qqtpushbutton.cpp index c8297fd7..ce5861e9 100644 --- a/src/widgets/qqtpushbutton.cpp +++ b/src/widgets/qqtpushbutton.cpp @@ -169,11 +169,16 @@ void QQtPushButton::paintEvent ( QPaintEvent* event ) //qDebug() << isEnabled() << mWorkState; QStylePainter p ( this ); +#if 0 + p.drawItemPixmap ( rect(), Qt::AlignCenter, QIcon ( QPixmap::fromImage ( mImage ) ).pixmap ( rect().size(), + QIcon::Normal, QIcon::On ) ); +#else p.drawItemPixmap ( rect(), Qt::AlignLeft | Qt::AlignTop, /*不.copy() 切出图片的中间部分使用*/ QPixmap::fromImage ( mImage .scaled ( rect().width(), rect().height(), Qt::IgnoreAspectRatio ) ) ); +#endif QStyleOptionButton opt; initStyleOption ( &opt ); diff --git a/src/widgets/qqtradiobutton.cpp b/src/widgets/qqtradiobutton.cpp index 92349924..40681fd2 100644 --- a/src/widgets/qqtradiobutton.cpp +++ b/src/widgets/qqtradiobutton.cpp @@ -168,8 +168,16 @@ void QQtRadioButton::paintEvent ( QPaintEvent* event ) //qDebug() << isEnabled() << mWorkState; QStylePainter p ( this ); +#if 0 p.drawItemPixmap ( rect(), Qt::AlignCenter, QIcon ( QPixmap::fromImage ( mImage ) ).pixmap ( rect().size(), QIcon::Normal, QIcon::On ) ); +#else + p.drawItemPixmap ( rect(), Qt::AlignLeft | Qt::AlignTop, + /*不.copy() 切出图片的中间部分使用*/ + QPixmap::fromImage ( mImage + .scaled ( rect().width(), rect().height(), Qt::IgnoreAspectRatio ) + ) ); +#endif QStyleOptionButton opt; initStyleOption ( &opt );