On 08/29/12 09:57, Sensei wrote:
> void txProjectView::dragMoveEvent(QDragMoveEvent *event)
> {
> if (indexAt(event->pos()).parent().isValid())
> {
> event->accept();
> }
> else
> {
> event->ignore();
> }
> }
>
>
> Unfortunately, I cannot drop on root!
>
> I am missing something really stupid here...
That's because root.parent() is an invalid index, and your code
explicitly rejects such drops. Try changing the else branch to
explicitly test for indexAt(event->pos()) == root and accept such events.
What's the idea behind "reject drops to indexes without a parent"? Looks
like you're also disabling drops to empty space.
Cheers,
Jan
--
Trojita, a fast e-mail client -- http://trojita.flaska.net/
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest