Details
Description
by methods addItem or setItemData of QComboBox,, I set a PenStyle object as user data to an item as below:
from PySide2.QtWidgets import * from PySide2.QtCore import Qt cb = QComboBox() cb.addItem("solid", Qt.SolidLine) cb.setItemData(0, Qt.SolidLine, Qt.UserRole+1)
However the user data given by itemData(0, Qt.UserRole) was integer value 1 instead of the object.
In any way, I couldn't extract the expected data.
BTW, in the case that I stored string instead of the object, it works.
I attached the short repro case code.
PYSIDE-45 may be a similar issue.
Attachments
Issue Links
- relates to
-
PYSIDE-45 Adding an instance of QPrinter as a combo box's user data return None
- Closed
- resulted in
-
PYSIDE-1870 Regression->6.2.4: Cannot set orientation by enum value through QMetaObject
- Closed
-
PYSIDE-1974 Regression: Usage of PySide6 enums via QVariant broken
- Closed
-
PYSIDE-1930 REG ->6.2.4: Cannot return Qt.CheckState enum values from QAbstractItemModel::flags()
- Closed