Hi,

I'm trying to make a small playlist for an audio player, that should support internal drag and drop to change the order of tracks and adding tracks via drag and drop from a folder. It should be like Winamp's playlist, just showing a few tracks in the order they will be played, not a huge list like in iTunes, displaying tons of information in a table. I'm using PyQt4 on Windows and at the moment, I'm only interested in Windows-compatibility.
So far, I've set up a QListView and a custom model deriving from QAbstractListModel, and my idea was to have a class "Song", to represent the individual tracks, that would provide a string for the data()-function in Qt.DisplayRole and store a few other things like duration and albumcover as member variables. By throwing together lines from numerous examples, I managed to get the internal drag and drop somewhat working, the only problem being that once an item has been moved, it's no longer of the type 'Song', but a QString instead. I also tried to get the “external” darg and drop working, by overwriting the dragEnterEvent of the QListView and filtering with "if event.mimeData().hasFormat('audio/mpeg'):", which of course broke the internal drag and drop.
Instead of thinking about also looking for my "Song" objects somehow, I'm now wondering if I should have a completely different approach. Or how and when I have to convert the items to "Song"-objects or something else. I find the documentation on Model-/View-Programming quite confusing and have the feeling the more I reread everything, the more confused I get. So I'm not even sure anymore, if I should use QListView or QListWidget instead. And I'm clueless how to store/pass the item data around. And if I'm supposed to provide indices myself (parent() and index() functions (and more?)) and how to do it. Are there any resources on the model/underlying data part of Model/View Programming, that could clarify things for me, preferably using PyQt?

Thanks in advance,
Jay-D