NARCISO, Rui wrote:
Hi again

Your approach worked nicely but when I tried to enable sorting using:

         self.setSortingEnabled(True)
         self.sortByColumn(0, QtCore.Qt.AscendingOrder)
I get a segmentation fault.

If i disable the sortByColumn then it works.

How then to set the sorting using column 0 by default ?

actually, i now think my approach was too crude. the trouble with using rowsInserted is that it is called every time items are added or moved (or sorted).

what is really needed is a way to add special handling only for dropped items. unfortunately, there does not appear to be an obvious way to detect what items were dropped and where. so i think the only reliable way to get the behaviour you want is to reimplement qtreewidget's drop event handling (which is probably doable, but not easy).

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to