[SOLVED] - QTableView drop indicator appearance
-
Hi,
I have a QTableView with dragAndDrop (internalMove) that is working.
I would like the drop indicator to indicate a complete row instead of just a cell
like it is doing currently, see here:
https://www.dropbox.com/s/uzo94rnzoq46ths/dropIndicatorTooSmall.pngThe drop indicator is shown by my model class with the flag method :
@Qt::ItemFlags IntervalTableModel::flags(const QModelIndex &index) const
{Qt::ItemFlags defaultFlags = QAbstractTableModel::flags(index); if (index.isValid()) { if (index.column() == 0) { return Qt::ItemIsDragEnabled | defaultFlags; } else return Qt::ItemIsEditable | Qt::ItemIsDragEnabled | defaultFlags; } /// To show drop indicator else { return Qt::ItemIsDropEnabled; }
}
@Is there a way to show a full line instead of this small line,
also is there a way to modify the dropIndicator with stylesheets, it seems not thick enough I can hardly see it.Thank you!
-
Hi,
You could try with setSelectionBehavior and SelectRows
Hope it helps
-
Fixed using a custom QProxyStyle on my QTableView
Good example here :
http://stackoverflow.com/questions/7596584/qtreeview-draw-drop-indicatorThanks
-
Nice finding ! Thanks for sharing :)