Nominate our 2022 Qt Champions!

Is there any way to get previous data from treewidget after itemchanged?



  • Hello,
    I create a treewidget, which is binding to a group of 3D models.
    I want to change the name of an item in treewidget, and, then, the model's name is updated.
    itemChanged only send new name and doesn't send old name, so I can't find the model and give it a new name...
    How to get the old name? I try itemclicked, but it raise other issue...


  • Banned

    keep a reference to it in a dictionary based on say ItemId then when the name is changed you can cross-reference the ItemId to get the name that was prior to updating the name to what it will be once changed then update your cross-reference list accordingly.


Log in to reply