mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
更新3按钮的绘图部分
This commit is contained in:
parent
68b6a8a110
commit
de4c4eadfd
@ -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 );
|
||||
|
@ -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 );
|
||||
|
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user