Nice, Eric and Matt; didn't know about setData(). On Wed, Jul 3, 2013 at 8:53 AM, Matthew Woehlke <matthew.woeh...@kitware.com> wrote:
On 2013-07-03 02:43, Sean Fisk wrote: > > Unfortunately, the QListWidget sorting algorithm sorts > > lexicographically, not numerically. > > IIRC it sorts by item data with some 'magic' depending on the data type. > At least I am pretty sure I've written lists with the built-in sorting > and gotten numeric sort. > > Try instead of setText, setData(Qt.DisplayRole), and make sure the data > you give is an int and not a string. > > -- > Matthew > > _______________________________________________ > PySide mailing list > PySide@qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > -- Sean Fisk
_______________________________________________ PySide mailing list PySide@qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside