[SOLVED] move column in qtable view
-
In Java swingx, a user can move columns of a jtable and change columns position.
Is it possible with Qt C++ QTableView ? And QTableViewModel ?
Or is there another datagrid class to do that?
Maybe I don't have the right term of this feature to search in google... I found nothing about this.
-
Hi and welcome to devnet,
It's a bit more hidden. Try this:
@
QTableView * tableView = new QTableView(this);
tableView->horizontalHeader()->setMovable(true);
@Hope it helps
-
error: 'class QHeaderView' has no member named 'setMovable'
-
You put me on the right way... and I found:
void QHeaderView::setMovable(bool movable)
Use setSectionsMovable instead.
@
headerView->setSectionsMovable(true);
@Now, it's working :)
Thanks a lot!
E.
-
Right, QHeaderView has changed a bit in the transition to Qt 5.
You're welcome !
Now that you have it working, please, update the thread title prepending [solved] so other forum users may know a solution has been found :)