|
2 | 2 |
|
3 | 3 | import numpy as np
|
4 | 4 | from larray_editor.utils import (get_font, from_qvariant, to_qvariant, to_text_string,
|
5 |
| - is_float, is_number, LinearGradient, SUPPORTED_FORMATS, scale_to_01range) |
| 5 | + is_float, is_number, LinearGradient, SUPPORTED_FORMATS, scale_to_01range, |
| 6 | + Product) |
6 | 7 | from qtpy.QtCore import Qt, QModelIndex, QAbstractTableModel
|
7 | 8 | from qtpy.QtGui import QColor
|
8 | 9 | from qtpy.QtWidgets import QMessageBox
|
@@ -132,8 +133,9 @@ def __init__(self, parent=None, data=None, readonly=False, font=None):
|
132 | 133 | def _set_data(self, data, changes=None):
|
133 | 134 | if data is None:
|
134 | 135 | data = [[]]
|
135 |
| - if not isinstance(data, (list, tuple)): |
136 |
| - QMessageBox.critical(self.dialog, "Error", "Expected list or tuple.") |
| 136 | + # TODO: use sequence instead |
| 137 | + if not isinstance(data, (list, tuple, Product)): |
| 138 | + QMessageBox.critical(self.dialog, "Error", "Expected list, tuple or Product") |
137 | 139 | data = [[]]
|
138 | 140 | self._data = data
|
139 | 141 | self.total_rows = len(data[0])
|
|
0 commit comments