I set the item name as the tooltip for QGraphicsItem by default. But in my program, users can change this item name, so I want to show the correct tooltip after they change the name. But setToolTip() only accept const QString, is there any way to accept a dynamic changing member property as input?
I do not want to just use setToolTip(QString) everytime user change the item name, since I may include many other member properties into the tooltip, not just the name.
Thank you!
Sice you can always get the updated item name, you can add a signal which gets emitted whenever there is a change in the item name and connect this signal with a slot which can be used to set the tooltip to the updated item name along with other member properties you would like to set it to.
Hope this helps.