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();
mTable->verticalHeader()->logicalIndex(row);
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!


Reply With Quote

Bookmarks