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:
Qt Code:
  1. QPainterPath MyLineGraphicsItem::shape() const
  2. {
  3. stroker.setWidth(qMax(4, pen().width() + 3));
  4. path.moveTo(line().p1());
  5. path.lineTo(line().p2());
  6. return stroker.createStroke(path);
  7. }
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