#include "kfileitemlistwidget.h"
#include "kfileitemmodel.h"
#include "kfileitemmodelrolesupdater.h"
+#include "private/kitemviewsutils.h"
#include "private/kpixmapmodifier.h"
#include <KIconLoader>
yCount = xCount;
}
- const qreal dpr = scene()->views()[0]->devicePixelRatio();
+ const qreal dpr = KItemViewsUtils::devicePixelRatio(this);
// Draw the selected items into the grid cells.
QPixmap dragPixmap(QSize(xCount * size + xCount, yCount * size + yCount) * dpr);
dragPixmap.setDevicePixelRatio(dpr);
if (current) {
m_modelRolesUpdater = new KFileItemModelRolesUpdater(static_cast<KFileItemModel *>(current), this);
m_modelRolesUpdater->setIconSize(availableIconSize());
+ m_modelRolesUpdater->setDevicePixelRatio(KItemViewsUtils::devicePixelRatio(this));
applyRolesToModel();
}
}
m_modelRolesUpdater->setIconSize(availableIconSize());
+ m_modelRolesUpdater->setDevicePixelRatio(KItemViewsUtils::devicePixelRatio(this));
// Update the visible index range (which has most likely changed after the
// icon size change) before unpausing m_modelRolesUpdater.
roles.insert("expandedParentsCount");
}
- // Assure that the role that is used for sorting will be determined
+ // Assure that the roles used for sorting and grouping will be determined
roles.insert(fileItemModel->sortRole());
+ roles.insert(fileItemModel->groupRole());
fileItemModel->setRoles(roles);
m_modelRolesUpdater->setRoles(roles);