Pyside - Moving data between two list views



  • I am not sure that this is a Pyside/Python specific question or a more general Qt question. I am not expecting working code so much as a brief explanation of the preffered method of implementation in Qt.

    I wish to have two list views (either model-view or widget based) side by side. I want to populate the first list with a set of data and then allow the user to:

    • drag items from the left-hand list to the right, removing from the left-hand list and adding to the right.
    • drag items from right-hand list to the left, removing from the right and adding to the left.
    • re-order items in either list without duplicating them.

    I believe I can implement this functionality 'manually' by modifying the drag and drop events to modify the contents of the list. But I wondered if there was a better way to acheive this using more standard functionality, or if another widget would be able to acheive this already.

    I could get some way to enabling this by enabling the drag and drop handling events for both lists. However I would quickly end up with duplicates in the lists.

    I hope I have explained this suitably and I appologise in advance if I have missed a similar existing topic - I was having trouble finding a search term that accurately described what I was trying to acheive.

    Kind Regards
    Stephen


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.