Hi,
I have a QGraphicsView/QGraphicsScene setup with several QGraphicsLineItem:s. Now I would like to increase the margin for detecting tooltip events (QEvent::ToolTip) of these line items.
I was able to affect the margin for detecting mousePressEvent:s by returning a "wider line" from the shape(), like this:
{
stroker.setWidth(qMax(4, pen().width() + 3));
path.moveTo(line().p1());
path.lineTo(line().p2());
return stroker.createStroke(path);
}
QPainterPath MyLineGraphicsItem::shape() const
{
QPainterPath path;
QPainterPathStroker stroker;
stroker.setWidth(qMax(4, pen().width() + 3));
path.moveTo(line().p1());
path.lineTo(line().p2());
return stroker.createStroke(path);
}
To copy to clipboard, switch view to plain text mode
However, this does not seem to affect the detection of tooltip events. Anyone knows what determines that event if shape() does not?
Many thanks in advance.
/U
Bookmarks