There is a method called QTableWidget::setSortingEnabled in Qt 4.1. This has been shifted to QTableView in Qt 4.2. Check it out to see what has to be done in order to enable sorting and disable selecting of rows/columns.
// ...
disconnect(horizontalHeader(), SIGNAL(sectionPressed(int)),
this, SLOT(selectColumn(int)));
connect(horizontalHeader(), SIGNAL(sectionClicked(int)),
this, SLOT(sortByColumn(int)));
/ ...
// ...
disconnect(horizontalHeader(), SIGNAL(sectionPressed(int)),
this, SLOT(selectColumn(int)));
connect(horizontalHeader(), SIGNAL(sectionClicked(int)),
this, SLOT(sortByColumn(int)));
/ ...
To copy to clipboard, switch view to plain text mode
Bookmarks