Commit 7390798b authored by Denis Mingulov's avatar Denis Mingulov Committed by Thorbjørn Lindeijer
Browse files

ImageViewer: Use smooth transformation



Merge-request: 2165
Reviewed-by: default avatarThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
parent 797955ce
......@@ -75,6 +75,7 @@ ImageView::ImageView(QWidget *parent)
setDragMode(ScrollHandDrag);
setViewportUpdateMode(FullViewportUpdate);
setFrameShape(QFrame::NoFrame);
setRenderHint(QPainter::SmoothPixmapTransform);
// Prepare background check-board pattern
QPixmap tilePixmap(64, 64);
......@@ -126,7 +127,9 @@ bool ImageView::openFile(QString fileName)
d_ptr->imageItem = new QGraphicsSvgItem(fileName);
} else {
QPixmap pixmap(fileName);
d_ptr->imageItem = new QGraphicsPixmapItem(pixmap);
QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(pixmap);
pixmapItem->setTransformationMode(Qt::SmoothTransformation);
d_ptr->imageItem = pixmapItem;
}
d_ptr->imageItem->setFlags(QGraphicsItem::ItemClipsToShape);
d_ptr->imageItem->setCacheMode(QGraphicsItem::NoCache);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment