Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.2
-
None
Description
I am using QGraphicsView to draw some dependency diagram like things. It contains boxes and arrows between them. The arrows can be solid or dotted. The coordinates for those boxes and arrows can grow admittedly very large (x=100k) in some cases but with transformations it doesn't matter and everything can be shown just fine. However, in some very specific cases, some of the dotted arrows take a second to generate, which is prohibitively expensive.
The time is taken in this code line: QPainterPathStroker( pen ).createStroke( arrowLine ).united( arrowHead );
Deleting the "united" restores performance in the milliseconds range.
Changing the pen line style to solid also restores performance to milliseconds range.
The most surprising influence, which does not make sense to me is the pen width. Change the pen width from 4 to 3 also restores milliseconds performance.
I have attached a minimal reproducing example / benchmark, which shows all these observations.
According to perf, the time is spent in QPathClipper::doClip or QPathClipper::handleCrossingEdges.