Minor tidying
This commit is contained in:
parent
c078fa69e7
commit
ee391e42e7
@ -27,8 +27,7 @@ class InfoTabs(QTabWidget):
|
|||||||
widget = QWebEngineView()
|
widget = QWebEngineView()
|
||||||
widget.setZoomFactor(Config.WEB_ZOOM_FACTOR)
|
widget.setZoomFactor(Config.WEB_ZOOM_FACTOR)
|
||||||
self.last_update[widget] = datetime.now()
|
self.last_update[widget] = datetime.now()
|
||||||
tab_index = self.addTab(widget, "")
|
_ = self.addTab(widget, "")
|
||||||
|
|
||||||
|
|
||||||
def open_in_songfacts(self, title):
|
def open_in_songfacts(self, title):
|
||||||
"""Search Songfacts for title"""
|
"""Search Songfacts for title"""
|
||||||
|
|||||||
@ -92,7 +92,7 @@ class EscapeDelegate(QStyledItemDelegate):
|
|||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
def createEditor(
|
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
|
Intercept createEditor call and make row just a little bit taller
|
||||||
@ -107,9 +107,12 @@ class EscapeDelegate(QStyledItemDelegate):
|
|||||||
return QPlainTextEdit(parent)
|
return QPlainTextEdit(parent)
|
||||||
return super().createEditor(parent, option, index)
|
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"""
|
"""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:
|
if event.type() == QEvent.Type.KeyPress:
|
||||||
key_event = cast(QKeyEvent, event)
|
key_event = cast(QKeyEvent, event)
|
||||||
if key_event.key() == Qt.Key.Key_Return:
|
if key_event.key() == Qt.Key.Key_Return:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user