Within a QTreeView, I would like to copy rows around by drag and drop. The corresponding Drag & drop settings look like:
this->setDragDropMode( QAbstractItemView::DragDrop );
this->setDropIndicatorShown( true );
This works fine unsing for the columns of the underlying QStandardItemModel which are visualised by the QTreeView. But not all columns of the model are visualised (see Hide future columns of QStandardItemModel in QTreeView):
void MyViewClass::columnCountChanged(int p_nOldCount , int p_nNewCount )
{
QTreeView::columnCountChanged( p_nOldCount, p_nNewCount );
for ( int i = MyViewClass::m_nColumnType; i < p_nNewCount; ++i )
{
setColumnHidden( i, true );
}
}
How can I copy the whole row of a QStandardItemModel by drag and drop in the QTreeView when not all columns are visualised by the QTreeView?