From b5bb6932e886a37ae9ec30e9c08882eb701b49c7 Mon Sep 17 00:00:00 2001 From: Jon Holba Date: Fri, 3 Jan 2025 09:12:20 +0100 Subject: [PATCH] fixup --- src/ert/gui/model/snapshot.py | 2 +- .../gui/tools/plot/customize/customize_plot_dialog.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ert/gui/model/snapshot.py b/src/ert/gui/model/snapshot.py index 70bc8a0a3ed..08c06c66152 100644 --- a/src/ert/gui/model/snapshot.py +++ b/src/ert/gui/model/snapshot.py @@ -471,7 +471,7 @@ def _fm_step_data( if role == FileRole: data_name = FM_STEP_COLUMNS[index.column()] if data_name in {ids.STDOUT, ids.STDERR}: - return node.data.get(data_name, None) + return node.data.get(data_name) if role == RealIens: return node.parent.id_ if node.parent else None diff --git a/src/ert/gui/tools/plot/customize/customize_plot_dialog.py b/src/ert/gui/tools/plot/customize/customize_plot_dialog.py index 1ebaa5ec2af..b8eceda5108 100644 --- a/src/ert/gui/tools/plot/customize/customize_plot_dialog.py +++ b/src/ert/gui/tools/plot/customize/customize_plot_dialog.py @@ -203,8 +203,8 @@ def __init__( self.current_key = key self._key_defs = key_defs - self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) # type: ignore - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) # type: ignore + self.setWindowFlag(Qt.WindowType.WindowContextHelpButtonHint, False) + self.setWindowFlag(Qt.WindowType.WindowCloseButtonHint, False) self._tab_map: dict[str, CustomizationView] = {} self._tab_order: list[str] = [] @@ -295,13 +295,13 @@ def keySelected(self, list_widget_item: QListWidgetItem) -> None: def currentPlotKeyChanged(self, new_key: str | None) -> None: self.current_key = new_key - def keyPressEvent(self, arg__1: QKeyEvent | None) -> None: + def keyPressEvent(self, arg__1: QKeyEvent) -> None: # Hide when pressing Escape instead of QDialog.keyPressEvent(KeyEscape) # which closes the dialog - if arg__1 is not None and arg__1.key() == Qt.Key.Key_Escape: + if arg__1.key() == Qt.Key.Key_Escape: self.hide() else: - QDialog.keyPressEvent(self, arg__1) # type: ignore[arg-type] + QDialog.keyPressEvent(self, arg__1) def addTab( self, attribute_name: str, title: str, widget: CustomizationView