WIP trying things

This commit is contained in:
Keith Edmunds 2022-08-17 13:30:45 +01:00
parent 7b2b7fada5
commit d267b32c0d

View File

@ -88,15 +88,15 @@ class NoSelectDelegate(QStyledItemDelegate):
def createEditor(self, parent, option, index):
editor = super().createEditor(parent, option, index)
if isinstance(editor, QLineEdit):
def deselect():
# Important! First disconnect, otherwise editor.deselect()
# will call again this function
editor.selectionChanged.disconnect(deselect)
editor.deselect()
editor.selectionChanged.connect(deselect)
# def deselect():
# # Important! First disconnect, otherwise editor.deselect()
# # will call again this function
# editor.selectionChanged.disconnect(deselect)
# editor.deselect()
# editor.selectionChanged.connect(deselect)
# self.old_editor = editor
# textedit = QTextEdit(parent)
# textedit.setPlainText(editor.text())
textedit = QTextEdit(parent)
textedit.setPlainText(editor.text())
return textedit
# def destroyEditor(self, editor, index):
@ -594,12 +594,12 @@ class PlaylistTab(QTableWidget):
# As we have track info, any notes should be contained in
# the notes column
temp_item = QTableWidgetItem()
self.setItem(row, columns['row_notes'].idx, temp_item)
notes_item = QTextEdit(row_data.note)
minimum_size = QSize(25, 25)
notes_item.setMinimumSize(minimum_size)
self.setCellWidget(row, columns['row_notes'].idx, notes_item)
notes_item = QTableWidgetItem(row_data.note)
self.setItem(row, columns['row_notes'].idx, notes_item)
# notes_item = QTextEdit(row_data.note)
# minimum_size = QSize(25, 25)
# notes_item.setMinimumSize(minimum_size)
# self.setCellWidget(row, columns['row_notes'].idx, notes_item)
last_playtime = Playdates.last_played(session, row_data.track.id)
last_played_str = get_relative_date(last_playtime)