Skip to content

Commit

Permalink
data() should return QVariant
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Oct 1, 2024
1 parent 90b91e3 commit 04e394e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- core.DataFrameTableModel: data() should return QVariant
- core.ColoredDataFrameTableModel: types for data roles


Expand Down
4 changes: 2 additions & 2 deletions iblqt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def data(
if index.isValid() and role == Qt.ItemDataRole.DisplayRole:
data = self._dataFrame.iloc[index.row(), index.column()]
if isinstance(data, np.generic):
return data.item()
return QVariant(str(data))
return QVariant(data.item())
return QVariant(data)
return QVariant()

def setData(
Expand Down

0 comments on commit 04e394e

Please sign in to comment.