State:New|TargetRelease:No Target|icon_bug|icon_katana|database:public|Resolution:Fixed|BugID:239283|
Problem summary:
The UI4.Widgets.SortableListWidget class has been designed to work with UI4.Widgets.SortableListWidgetItem instances as items. When attempting to use functions of the underlying QtGui.QListWidget class, exceptions may occur due to the absence of certain functions on the items that are created.
Steps to reproduce:
sortableListWidget = UI4.Widgets.SortableListWidget(None)sortableListWidget.addItem('Item 1')sortableListWidget.show() The same problem affects items added via addItems(), e.g.
sortableListWidget = UI4.Widgets.SortableListWidget(None)sortableListWidget.addItems(['Item 1', 'Item 2', 'Item 3'])sortableListWidget.show() Expected behaviour:
The SortableListWidget is shown as a stand-alone widget in a window by itself, containing the items that were added.
Actual behaviour:
Exceptions are raised, with tracebacks similar to the following:
Traceback (most recent call last): File ".../bin/python/UI4/Widgets/SortableListWidget.py", line 392, in sizeHint return item.calcSizeHint() AttributeError: 'QListWidgetItem' object has no attribute 'calcSizeHint' Workaround:
Items in UI4.Widgets.SortableListWidget instances can be created as follows:
item1 = UI4.Widgets.SortableListWidgetItem(sortableListWidget, 'Item 1') Reproduced versions/platforms:
Customer version/platform:
2.5v3/Linux
We're sorry to hear that
Please tell us why