I wanted to know how we can change the order of columns in QtableView by dragging ? I currently have a class derived from FilterProxyModel as source to QtableView. I am using QT 4.8
Asked
Active
Viewed 7,334 times
1 Answers
24
Qt 5.x:
ui->tableView->horizontalHeader()->setSectionsMovable(true);
QHeaderView::setSectionsMovable()
Qt 4.x:
ui->tableView->horizontalHeader()->setMovable(true);

Chris
- 17,119
- 5
- 57
- 60
-
Seems like this is not available in Qt 4.8 which I am using – MistyD Sep 17 '13 at 18:05
-
For Qt 4.8 it should be [QHeaderView::setMovable ( bool movable )](http://qt-project.org/doc/qt-4.8/qheaderview.html#setMovable) – fbucek Sep 17 '13 at 20:39
-
Updated answer with 4.8 version – Chris Sep 17 '13 at 20:43