Results 1 to 3 of 3

Thread: QTable : rowMovingEnabled and swapRows

  1. #1
    Join Date
    Mar 2006
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTable : rowMovingEnabled and swapRows

    Hello !

    I use somme QTable and I would like to swap rows. For the moment, I have created a slot that uses swapRows(int, int) but I would prefer to use the property "rowMovingEnabled", which allows the user to move row while pressing "Ctrl" and clicking on the header's row. The problem is that I found no signals that would allow me to catch it and make the treatment I would like to do.

    Any suggestions ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTable : rowMovingEnabled and swapRows

    How about this?
    void QHeaderView::sectionMoved ( int logicalIndex, int oldVisualIndex, int newVisualIndex ) [signal]
    This signal is emitted when a section is moved. The section's logical index is specified by logicalIndex, the old index by oldVisualIndex, and the new index position by newVisualIndex.
    See also moveSection().

  3. #3
    Join Date
    Mar 2006
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTable : rowMovingEnabled and swapRows

    I forgot to say that this time I use Qt3... Sorry

    But you are right, I didn't think about using the QHeader class. I have now tried with the signal "QHeader::indexChange ( int, int, int )" and it has worked !
    Thank you, jacek!

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.