Made a small memory optimisation by making the fonts a class variable and not an instance variable.
This commit is contained in:
parent
563aab6204
commit
95d40dd30c
1 changed files with 4 additions and 4 deletions
|
@ -10,6 +10,10 @@ from .track import TrackItem
|
||||||
class PlaylistView(QTreeWidget):
|
class PlaylistView(QTreeWidget):
|
||||||
itemDropped = pyqtSignal(QTreeWidget, list)
|
itemDropped = pyqtSignal(QTreeWidget, list)
|
||||||
|
|
||||||
|
normal_font = QFont()
|
||||||
|
bold_font = QFont()
|
||||||
|
bold_font.setBold(True)
|
||||||
|
|
||||||
def __init__(self, playlist, parent=None):
|
def __init__(self, playlist, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
|
@ -18,10 +22,6 @@ class PlaylistView(QTreeWidget):
|
||||||
|
|
||||||
playlist.view = self
|
playlist.view = self
|
||||||
|
|
||||||
self.normal_font = QFont()
|
|
||||||
self.bold_font = QFont()
|
|
||||||
self.bold_font.setBold(True)
|
|
||||||
|
|
||||||
self.setDragDropMode(QAbstractItemView.DragDropMode.InternalMove)
|
self.setDragDropMode(QAbstractItemView.DragDropMode.InternalMove)
|
||||||
self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection)
|
self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue