J
J
jonikwm2015-09-07 21:27:27
Python
jonikwm, 2015-09-07 21:27:27

Pyqt. Passing items from QListView1 to QListView2?

Good day and thanks in advance!
People, please tell me how to implement such a design:
a0dd03fba87e4f7da2268e53fcb4373a.png
Due to my meager experience in this area, nothing good comes to mind.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail, 2015-09-17
@jonikwm

You can do this via QSortFilterProxyModel:

  1. Implemented by QAbstractListModel
  2. Two QSortFilterProxyModel clings to it
  3. Each of them clings to its own QListView
  4. Qt.ItemDataRole is added to the data in QAbstractListModel, which is responsible for the location in one of the lists
  5. Each of the QSortFilterProxyModel is set to filter by the value of the created role
  6. By pressing the < and > buttons, the value of the role changes
  7. ???
  8. PROFIT!!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question