forked from Wobbl/Wobuzz
OOPed the way playlist views are created.
This commit is contained in:
parent
88b846f3b6
commit
028c38b1b6
7 changed files with 61 additions and 67 deletions
23
wobuzz/ui/track.py
Normal file
23
wobuzz/ui/track.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtCore import Qt
|
||||
from PyQt6.QtWidgets import QTreeWidgetItem
|
||||
|
||||
|
||||
class TrackItem(QTreeWidgetItem):
|
||||
def __init__(self, track, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.track = track
|
||||
track.item = self
|
||||
|
||||
self.setFlags(
|
||||
Qt.ItemFlag.ItemIsEnabled |
|
||||
Qt.ItemFlag.ItemIsSelectable |
|
||||
Qt.ItemFlag.ItemIsDragEnabled
|
||||
)
|
||||
|
||||
self.setText(2, track.tags.title)
|
||||
self.setText(3, track.tags.artist)
|
||||
self.setText(4, track.tags.album)
|
||||
self.setText(5, str(track.index_custom_sort))
|
Loading…
Add table
Add a link
Reference in a new issue