Changeset View
Changeset View
Standalone View
Standalone View
src/qmlcontrols/draganddrop/DeclarativeDragArea.cpp
Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Line(s) | 354 | for (int i = 0; i < std::min(4, mimeData()->urls().size()); ++i) { | |||
---|---|---|---|---|---|
355 | icons << QStringLiteral("text-html"); | 355 | icons << QStringLiteral("text-html"); | ||
356 | } | 356 | } | ||
357 | } | 357 | } | ||
358 | if (!icons.isEmpty()) { | 358 | if (!icons.isEmpty()) { | ||
359 | QPixmap pm(imageSize * icons.count(), imageSize); | 359 | QPixmap pm(imageSize * icons.count(), imageSize); | ||
360 | pm.fill(Qt::transparent); | 360 | pm.fill(Qt::transparent); | ||
361 | QPainter p(&pm); | 361 | QPainter p(&pm); | ||
362 | int i = 0; | 362 | int i = 0; | ||
363 | foreach (const QString &ic, icons) { | 363 | for (const QString &ic : qAsConst(icons)) { | ||
364 | p.drawPixmap(QPoint(i * imageSize, 0), QIcon::fromTheme(ic).pixmap(imageSize)); | 364 | p.drawPixmap(QPoint(i * imageSize, 0), QIcon::fromTheme(ic).pixmap(imageSize)); | ||
365 | i++; | 365 | i++; | ||
366 | } | 366 | } | ||
367 | p.end(); | 367 | p.end(); | ||
368 | drag->setPixmap(pm); | 368 | drag->setPixmap(pm); | ||
369 | } | 369 | } | ||
370 | } | 370 | } | ||
371 | 371 | | |||
Show All 16 Lines |