mercredi 15 juin 2016

Why do I not see the drop indicator in a QTableView?

I use drag and drop in my QTableView (works). However, I do not see any drop indicator. I should see a line where the drop is supposed to be inserted, shouldn't I? At least here they say so.

My init is pretty much standard.

    // see model for implementing logic of drag
    this->viewport()->setAcceptDrops(allowDrop);
    this->setDragEnabled(allowDrag);
    this->setDropIndicatorShown(true);
    this->m_model->allowDrop(allowDrop);

I have no idea why I do not see the indicator. A style sheet is used with the views, could that be the reason. However, I have disabled the stylesheet and still do not see it.

The view uses entire rows for selection, not sure if this causes an issue. So any hint is appreciated.

-- Edit --

As of the comment below, tried all selection modes: single, multi or extended, no visual effect. Also tried cell instead of row selection, again no improvement.

2 commentaires: