| 169 | } |
| 170 | |
| 171 | playlistItem *PlaylistTreeWidget::getDropTarget(const QPoint &pos) const |
| 172 | { |
| 173 | auto pItem = dynamic_cast<playlistItem *>(this->itemAt(pos)); |
| 174 | if (pItem != nullptr) |
| 175 | { |
| 176 | // check if dropped on or below/above pItem |
| 177 | auto rc = this->visualItemRect(pItem); |
| 178 | auto rcNew = QRect(rc.left(), rc.top() + 2, rc.width(), rc.height() - 4); |
| 179 | if (!rcNew.contains(pos, true)) |
| 180 | // dropped next to pItem |
| 181 | pItem = nullptr; |
| 182 | } |
| 183 | |
| 184 | return pItem; |
| 185 | } |
| 186 | |
| 187 | void PlaylistTreeWidget::dragMoveEvent(QDragMoveEvent *event) |
| 188 | { |