Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
1.2.x
-
1e5643d42eb7165aa6097bd5ccfcb4eb5e1477ac (pyside/pyside-setup/5.12)
Description
QComboBox doesn't seem to store the QPrinter instance as the item's user data.
In this example the assert fails because the item data for the first item is
None instead of an instance of QPrinter class.
class Window(QtGui.QMainWindow): def __init__(self): super(Window, self).__init__() self.combo = QtGui.QComboBox(self) self.setCentralWidget(self.combo) printer = QtGui.QPrinterInfo.availablePrinters()[0] self.combo.addItem(printer.printerName(), QtGui.QPrinter(printer)) # Fails assert(isinstance(self.combo.itemData(0), QtGui.QPrinter))
Attachments
Issue Links
- relates to
-
PYSIDE-1798 Cannot store enum Qt.PenStyle object as user data of QComboBox item (QVariant)
- Closed
For Gerrit Dashboard: PYSIDE-45 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
252522,3 | Return PyObject wrapper when not valid QVariant | 5.12 | pyside/pyside-setup | Status: MERGED | +2 | 0 |