![]() Registered Member ![]()
|
Hello all,
I'm trying to capture all signals from a TreeWidget indicating that something in the logical structure of data displayed by widget is changed. Expanded and collapsed status don't care. In particular, I am looking for signals activated when 1: items are sorted 2: items are reordered by internal drag and drop 4: item added, deleted by external drag and drop 5: item added 6: item deleted 7: item changed The same problem with qt3 widget QListView. Thanks in advance for any help. |
![]() Mentor ![]()
|
Have a look at the signals emitted by the underlying model, especially the layoutChanged signal.
You can access the model via
where treeView is a instance of QTreeWidget class. ![]() [size=x-small]code | [url=cia.vc/stats/author/msoeken]cia.vc[/url] | [url=kde.org/support]donating KDE[/url] | [url=tinyurl.com/cto4ns]wishlist[/url][/size] |
![]() Registered Member ![]()
|
With these model signals "layoutChanged", "dataChanged", "headerDataChanged", "rowsInserted", "rowsRemoved", it works for sorting (sortingEnabled=True), but does not work with drag and drop.
Another question: if sorting is enabled, Qt4 applies sorting at every item change/insertion into the model. It is possible to sort only when user clicks on a column header (the same behavior of Qt3). |
![]() Mentor ![]()
|
Try to extend from QTreeView and override the drag and drop functions in here. ![]() [size=x-small]code | [url=cia.vc/stats/author/msoeken]cia.vc[/url] | [url=kde.org/support]donating KDE[/url] | [url=tinyurl.com/cto4ns]wishlist[/url][/size] |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell