Setting different text when user starts editing QTreeWidgetItem
-
I have a tree which has item named like "abc (id=10, type=xyz)" Tree node is editable. I want user to allow only rename but not modify id and type part. So when user enters in edit mode user should see only "abc" which is editable.
Any suggestion how to do it.
-
I have a tree which has item named like "abc (id=10, type=xyz)" Tree node is editable. I want user to allow only rename but not modify id and type part. So when user enters in edit mode user should see only "abc" which is editable.
Any suggestion how to do it.
@Gitesh-Yeole
You can get theQString
from theindex
and show only required part ofQString
(may be using split) . When editing is completed just set back the newname and previous text (--+ (id=10, type=xyz)).But I prefer
QTableView
overQTreeWidget
for this. -
One way I know is using QItemDelegate just want to check any other simple way
-
@Gitesh-Yeole
You can get theQString
from theindex
and show only required part ofQString
(may be using split) . When editing is completed just set back the newname and previous text (--+ (id=10, type=xyz)).But I prefer
QTableView
overQTreeWidget
for this.@Ratzz Yes this is what I want to do but where should I do as I am not aware of any signal which is emitted just before opening editor
-
@Ratzz Yes this is what I want to do but where should I do as I am not aware of any signal which is emitted just before opening editor