Hello,
as I didn't see it in the manual:
Is there no way to modify elements from a treeview other than deleting it?
The background is that I plan do sort messages I get by byte into a tree structure.
I get messages quite fast, they alway repeat and only show some differences in some data fields. I plan to display it by a treeview as it looks matching for my purpose.
So I don't want to add elements to the view, I want to modify existing ones. Is there a good way for this? From the C++-QT i remember this as possible..
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To modify the elements later you have to store them or you can use the following functions to iterate over the elements:
var item = UI_treeWidget.topLevelItem(index)
var itemBelow = UI_treeWidget.itemBelow(item)
var item2 = UI_treeWidget.itemAbove(itemBelow)
Last edit: Stefan Zieker 2021-02-23
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2021-02-24
Thank you for the quick answer!
I already saw this in the manual. What I'm missing is a command to get to a child. The only command I saw is "takeChild", but this one removes the item.
Like the command ScriptTreeWidgetItem* parent (void) for a child.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
as I didn't see it in the manual:
Is there no way to modify elements from a treeview other than deleting it?
The background is that I plan do sort messages I get by byte into a tree structure.
I get messages quite fast, they alway repeat and only show some differences in some data fields. I plan to display it by a treeview as it looks matching for my purpose.
So I don't want to add elements to the view, I want to modify existing ones. Is there a good way for this? From the C++-QT i remember this as possible..
Thanks!
Hi,
yes you can modify elements. Here is an example:
To modify the elements later you have to store them or you can use the following functions to iterate over the elements:
var item = UI_treeWidget.topLevelItem(index)
var itemBelow = UI_treeWidget.itemBelow(item)
var item2 = UI_treeWidget.itemAbove(itemBelow)
Last edit: Stefan Zieker 2021-02-23
Thank you for the quick answer!
I already saw this in the manual. What I'm missing is a command to get to a child. The only command I saw is "takeChild", but this one removes the item.
Like the command
ScriptTreeWidgetItem* parent (void)
for a child.