diff --git a/app/infotabs.py b/app/infotabs.py index aba9280..a82e359 100644 --- a/app/infotabs.py +++ b/app/infotabs.py @@ -27,8 +27,7 @@ class InfoTabs(QTabWidget): widget = QWebEngineView() widget.setZoomFactor(Config.WEB_ZOOM_FACTOR) self.last_update[widget] = datetime.now() - tab_index = self.addTab(widget, "") - + _ = self.addTab(widget, "") def open_in_songfacts(self, title): """Search Songfacts for title""" diff --git a/app/playlists.py b/app/playlists.py index 477f598..5c1de4c 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -92,7 +92,7 @@ class EscapeDelegate(QStyledItemDelegate): super().__init__(parent) def createEditor( - self, parent: QWidget, option: QStyleOptionViewItem, index: QModelIndex + self, parent: Optional[QWidget], option: QStyleOptionViewItem, index: QModelIndex ): """ Intercept createEditor call and make row just a little bit taller @@ -107,9 +107,12 @@ class EscapeDelegate(QStyledItemDelegate): return QPlainTextEdit(parent) return super().createEditor(parent, option, index) - def eventFilter(self, editor: QObject, event: QEvent) -> bool: + def eventFilter(self, editor: Optional[QObject], event: Optional[QEvent]) -> bool: """By default, QPlainTextEdit doesn't handle enter or return""" + if editor is None or event is None: + return False + if event.type() == QEvent.Type.KeyPress: key_event = cast(QKeyEvent, event) if key_event.key() == Qt.Key.Key_Return: