aboutsummaryrefslogtreecommitdiffstats
path: root/examples/external/pandas/dataframe_model.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-09-18 07:36:20 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-09-18 08:28:04 +0200
commite4199ec3881d8e556385af98084856be857e0dbe (patch)
tree77b264f5a21cff9f131a6b27e3b5142745faf91f /examples/external/pandas/dataframe_model.py
parentf48433db9a5be32c0b401c1d5203853abbff6c32 (diff)
type hints: Fix some typing bugs for mypy (forgiveness)
The new enums still support old syntax by the forgiveness mode. Nevertheless, when using mypy to check files, strict correctness is enforced. We correct a large number of forgiveness-induced errors, but there is still a whole lot of other complaints to fix. Task-number: PYSIDE-2846 Change-Id: If566187d268ef75bc09b8d86f73d2c7d19f284f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/external/pandas/dataframe_model.py')
-rw-r--r--examples/external/pandas/dataframe_model.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/external/pandas/dataframe_model.py b/examples/external/pandas/dataframe_model.py
index 142d4c722..bd741f977 100644
--- a/examples/external/pandas/dataframe_model.py
+++ b/examples/external/pandas/dataframe_model.py
@@ -43,7 +43,7 @@ class PandasModel(QAbstractTableModel):
if not index.isValid():
return None
- if role == Qt.DisplayRole:
+ if role == Qt.ItemDataRole.DisplayRole:
return str(self._dataframe.iloc[index.row(), index.column()])
return None
@@ -55,8 +55,8 @@ class PandasModel(QAbstractTableModel):
Return dataframe index as vertical header data and columns as horizontal header data.
"""
- if role == Qt.DisplayRole:
- if orientation == Qt.Horizontal:
+ if role == Qt.ItemDataRole.DisplayRole:
+ if orientation == Qt.Orientation.Horizontal:
return str(self._dataframe.columns[section])
if orientation == Qt.Vertical: