// If the icon size changes, a longer delay is used. This prevents that
// the expensive re-generation of all previews is triggered repeatedly when
- // chaning the zoom level.
+ // changing the zoom level.
const int LongInterval = 300;
}
yCount = xCount;
}
- qreal dpr = scene()->views()[0]->devicePixelRatio();
+ const qreal dpr = scene()->views()[0]->devicePixelRatio();
// Draw the selected items into the grid cells.
- QPixmap dragPixmap(QSize(xCount * size + xCount, yCount * size + yCount)*dpr);
+ QPixmap dragPixmap(QSize(xCount * size + xCount, yCount * size + yCount) * dpr);
dragPixmap.setDevicePixelRatio(dpr);
dragPixmap.fill(Qt::transparent);
int x = 0;
int y = 0;
- foreach (int index, indexes) {
+ for (int index : indexes) {
QPixmap pixmap = model()->data(index).value("iconPixmap").value<QPixmap>();
if (pixmap.isNull()) {
QIcon icon = QIcon::fromTheme(model()->data(index).value("iconName").toString());