Please nominate your Qt Champions for 2021!

Extend rectangle size by click

  • Hello everybody,

    I have a class which inehits of QGraphicsWidget which enables to build rectangles. I would like to be able to extend the rectangle when I click near the border to change the lenght. I mean : left click on the right border for example, stay on click, move the mouse to where you want to extend, then release. (kind of drag and drop)
    What is the best way to do that in your opinion?

  • Take a look into my "fork": in github, however it works ONLY with QGraphicsRectItem and QGraphicsEllipseItem. You may use it as a reference.

Log in to reply