How to achieve multiple tooltip on QGraphicsItem ?
Unsolved
General and Desktop
-
I want to set multiple tooltip on QGraphicsItem.
Initially I will have name in tooltip.On Right mouse button I will have 1 option like "Enable attribute Info " When I will click that, on hover over QGraphicsItem , I should see attribute info.
When that option will be disabled, on hover I should be able to see rectangle name.For that , in eventFilter() I have tried like this.
case QEvent::MouseMove: { QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event); QPointF mousePoint = _view->mapToScene(mouseEvent->pos()); QGraphicsItem* currentItem = _scene->itemAt(mousePoint, QTransform()); myRect* rItem = dynamic_cast<myRect*>(currentItem); if(rItem){ rItem->setToolTip(_attributeTableInfo); } break; }
It is working properly. But issue is, once I set above tooltip my original tooltip of name is not there. I always get attribute info as a tooltip.
I want attribute info tooltip, only when it is enable from Right mouse button, when it is disable I should get Name as tooltip.
In short how to achieve, multiple tooltip ?
-