Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.14.1
-
None
-
Python 3.8.2
-
-
308aba2154699596e3fd0973501213423462a80b (pyside/pyside-setup/5.14)
Description
In this code, which inserts data into a QStandardItemModel (called resourcesModel) with QTableView:
item = QStandardItem() item.setData(123123, Qt.EditRole) resourcesModel.setItem(1, 1, item)
double-clicking on a cell presents a default QLineEdit (which you can put letters into), instead of QSpinBox, which would be expected since data is an integer.
Possible explanation (by user eyllanesc on StackOverflow):
What happens is that PySide2 converts the integer from python to LongLong (QVariant::LongLong=4) in C++ which is not handled by the default QItemEditorFactory by default making a QLineEdit used (in PyQt is converted to QMetaType::Int=2).
Attachments
Issue Links
- relates to
-
PYSIDE-2066 Unpredictable sorting of integers with QSortFilterProxyModel
- Reported
For Gerrit Dashboard: PYSIDE-1250 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
294941,3 | PySide2: Use int for QVariant conversion when possible | 5.14 | pyside/pyside-setup | Status: MERGED | +2 | 0 |