diff options
| author | David Edmundson <[email protected]> | 2015-03-30 13:39:17 +0200 |
|---|---|---|
| committer | David Edmundson <[email protected]> | 2015-03-30 13:39:17 +0200 |
| commit | 4ed0b82b02aa787ba25bdc5a5e5a99037fdb6efa (patch) | |
| tree | dac01c877cd1b93a721ff7a7e5873fb173eb58b0 /src/kitemviews/kfileitemlistview.cpp | |
| parent | fba5dd58a55e191a3368cc85735826c2b9e18a8b (diff) | |
| parent | 1b6ee5d6cd918b81c59a5163c9d6371f35f9885c (diff) | |
Merge branch 'davidedmundson/highdpi'
REVIEW: 123137
Diffstat (limited to 'src/kitemviews/kfileitemlistview.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemlistview.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kitemviews/kfileitemlistview.cpp b/src/kitemviews/kfileitemlistview.cpp index d912a6c5c..a740a3a23 100644 --- a/src/kitemviews/kfileitemlistview.cpp +++ b/src/kitemviews/kfileitemlistview.cpp @@ -29,6 +29,8 @@ #include <QPainter> #include <QTimer> +#include <QGraphicsScene> +#include <QGraphicsView> // #define KFILEITEMLISTVIEW_DEBUG @@ -154,8 +156,10 @@ QPixmap KFileItemListView::createDragPixmap(const KItemSet& indexes) const yCount = xCount; } + const qreal dpr = scene()->views()[0]->devicePixelRatio(); // Draw the selected items into the grid cells. - QPixmap dragPixmap(xCount * size + xCount, yCount * size + yCount); + QPixmap dragPixmap(QSize(xCount * size + xCount, yCount * size + yCount) * dpr); + dragPixmap.setDevicePixelRatio(dpr); dragPixmap.fill(Qt::transparent); QPainter painter(&dragPixmap); @@ -168,7 +172,7 @@ QPixmap KFileItemListView::createDragPixmap(const KItemSet& indexes) const QIcon icon = QIcon::fromTheme(model()->data(index).value("iconName").toString()); pixmap = icon.pixmap(size, size); } else { - KPixmapModifier::scale(pixmap, QSize(size, size)); + KPixmapModifier::scale(pixmap, QSize(size, size) * dpr); } painter.drawPixmap(x, y, pixmap); |
