View Full Version : QTableWidget Sorting Multiple Selection

3rd July 2006, 14:14
Hi! I have a question on how to move the items up and down from a QTableWidget with multiple slection. I have my sample code below..

int row = mTable->currentRow();
int indexTo = row - 1;
if (indexTo > 0) {
mTable->verticalHeader()->moveSection(mTable->currentRow(), indexTo);
mTable->setCurrentCell(indexTo, 1);

I can move my selecteditem up and down. but when i tried using the QTableWidgetSelectionRange the logicalIndex of my selected Item doesn't changed so the up and down is not working. Have you guys done this before? Thanks!

30th August 2006, 21:05
This piece of code (http://www.qtcentre.org/forum/p-qtablewidget-move-row-post18492/postcount4.html) should be easy enough to modify to achieve the wanted functionality.