Changeset View
Changeset View
Standalone View
Standalone View
treeview.cpp
Show First 20 Lines • Show All 701 Lines • ▼ Show 20 Line(s) | 701 | { | |||
---|---|---|---|---|---|
702 | QList<QTreeWidgetItem *> items; | 702 | QList<QTreeWidgetItem *> items; | ||
703 | items << selectedItem(); | 703 | items << selectedItem(); | ||
704 | QMimeData *data = mimeData(items); | 704 | QMimeData *data = mimeData(items); | ||
705 | if (!data) { | 705 | if (!data) { | ||
706 | return; | 706 | return; | ||
707 | } | 707 | } | ||
708 | 708 | | |||
709 | QDrag *drag = new QDrag(this); | 709 | QDrag *drag = new QDrag(this); | ||
710 | int iconSize = KIconLoader::global()->currentSize(KIconLoader::Small); | 710 | const int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize); | ||
711 | drag->setPixmap(selectedItem()->icon(0).pixmap(iconSize, iconSize)); | 711 | drag->setPixmap(selectedItem()->icon(0).pixmap(iconSize, iconSize)); | ||
712 | drag->setMimeData(data); | 712 | drag->setMimeData(data); | ||
713 | drag->exec(supportedActions, Qt::MoveAction); | 713 | drag->exec(supportedActions, Qt::MoveAction); | ||
714 | } | 714 | } | ||
715 | 715 | | |||
716 | QMimeData *TreeView::mimeData(const QList<QTreeWidgetItem *> items) const | 716 | QMimeData *TreeView::mimeData(const QList<QTreeWidgetItem *> items) const | ||
717 | { | 717 | { | ||
718 | if (items.isEmpty()) { | 718 | if (items.isEmpty()) { | ||
▲ Show 20 Lines • Show All 1174 Lines • Show Last 20 Lines |