Setting different text when user starts editing QTreeWidgetItem
Solved
General and Desktop
-
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
-