Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions

Error in getting QGraphicsItem's coords for mouse events



  • I add several QPainterPath-s to my graphics view and then use setPos() to place them in the right place on my view. But in mousePressEvent, when I use the following code:

    @if (textPath->contains(e->posF())) {
    // do something
    }@

    it always returns false. How do I fix this?


Log in to reply