Results 1 to 2 of 2

Thread: QTableWidget Sorting Multiple Selection

  1. #1
    Join Date
    Jun 2006
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QTableWidget Sorting Multiple Selection

    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!

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTableWidget Sorting Multiple Selection

    This piece of code should be easy enough to modify to achieve the wanted functionality.
    J-P Nurmi

Similar Threads

  1. Multiple selection in QTextEdit
    By munna in forum Qt Programming
    Replies: 4
    Last Post: 1st July 2006, 08:58
  2. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 06:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.