2010-02-06 22 views

回答

2

张贴的问题后,我发现了以下解决方案:

path = QPainterPath(...) # Path we are testing against 
    point = QPointF(...)  # Current position 

    stroker = QPainterPathStroker() 
    stroker.setWidth(10)  # Distance which we consider "on" the path 
    stroke = stroker.createStroke(path) 

    if stroke.contains(point): 
     # point is on path