ID 239284 - Exception when calling `UI4.Widgets.SortableListWidget.sort()`

Follow

Problem summary:

The sort() function of the UI4.Widgets.SortableListWidget class calls a sort function on the underlying QtGui.QListWidget class with a wrong function name, leading to an exception.

Steps to reproduce:

  1. Execute the following line of code in a Python tab:
    • 
      UI4.Widgets.SortableListWidget(None).sort()

Expected behaviour:

The sort() function is meant to sort items in a SortableListWidget instance. In this example with no items present, nothing should happen.

Actual behaviour:

An exception is raised, with a traceback similar to the following:


    Traceback (most recent call last):
      File ".../bin/python/UI4/Widgets/SortableListWidget.py", line 77, in sort
        QtGui.QListWidget.sort(self, ascending)
    AttributeError: type object 'QListWidget' has no attribute 'sort'

Workaround:

The QListWidget.sortItems() function can be called directly.

Reproduced versions/platforms:

  • 1.0v1/Linux
  • 2.5v3/Linux

Customer version/platform:

2.5v3/Linux

    We're sorry to hear that

    Please tell us why