{
/* Min rotate(-93)
* Max rotate(162)
* Mid rotate(36)
*/
boolPainter.
setRenderHint(QPainter::SmoothPixmapTransform);
boolPainter.drawPixmap(0, 0, pixmap.scaled(size().width(), size().height(),
Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
QTransform transform2;
transform2.translate(size().width()/2, size().height()/2);
transform2.rotate(m_rotation);
transform2.translate(-size().width()/2, -size().height()/2);
boolPainter.setTransform(transform2);
boolPainter.drawPixmap(0, 0, pixmap.scaled(size().width(), size().height(),
Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
}
void CDITachometer::paintEvent(QPaintEvent *)
{
/* Min rotate(-93)
* Max rotate(162)
* Mid rotate(36)
*/
QPainter boolPainter(this);
boolPainter.setRenderHint(QPainter::SmoothPixmapTransform);
QPixmap pixmap = *QPixmapCache::find(accessibleName());
boolPainter.drawPixmap(0, 0, pixmap.scaled(size().width(), size().height(),
Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
QTransform transform2;
transform2.translate(size().width()/2, size().height()/2);
transform2.rotate(m_rotation);
transform2.translate(-size().width()/2, -size().height()/2);
boolPainter.setTransform(transform2);
pixmap = *QPixmapCache::find(accessibleName().append("1"));
boolPainter.drawPixmap(0, 0, pixmap.scaled(size().width(), size().height(),
Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
}
To copy to clipboard, switch view to plain text mode
Bookmarks