Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.0.2, 5.1.0 , 5.9.0 Beta 1
-
None
-
Windows 7
Visual Studio 2012
qt-everywhere-opensource-src-5.0.2 (built from source)
Description
QPainterPath::intersects doesn't detect an intersection with a rectangle properly for certain common combinations of lines and curves in a QPainterPath:
int main(int argc, char *argv[]) { QApplication app(argc, argv); QGraphicsView view; QGraphicsScene *scene = new QGraphicsScene; view.setScene(scene); view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); QPainterPath p; p.addRoundedRect(-10, 10, 40, 40, 10, 10); QRectF r(0, 0, 100, 100); scene->addRect(r); scene->addPath(p); qDebug() << p.intersects(r); // false, should be true view.show(); return app.exec(); }
The bigger rectangle cuts 1/4 of a smaller rounded rectangle so they obviously do intersect, but p.intersects(r) reports they don't.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-31551 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
192133,3 | Fix painterpath rect intersections with points on the rect | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |