According to the documentation:
QPainterPath QPainterPath::intersected ( const QPainterPath & p ) const
Returns a path which is the intersection of this path's fill area and p's fill area.
Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.
Since your line has no fill area, it would seem like this function would not work for you.
If you are using a QGraphicsScene to display your QPainterPath you can use the method collidingItems:
QList QGraphicsScene::collidingItems ( const QGraphicsItem * item, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape ) const
Returns a list of all items that collide with item. Collisions are determined by calling QGraphicsItem::collidesWithItem(); the collision detection is determined by mode. By default, all items whose shape intersects item or is contained inside item's shape are returned.
The items are returned in descending stacking order (i.e., the first item in the list is the uppermost item, and the last item is the lowermost item).
Unfortunately, QPainter does not seem to have the same function. I think that your method of creating a long rectangle might be an easier way of doing this.