[PyQt] resizing polygon via bounding rectangle

Randy Heiland heiland at indiana.edu
Fri Dec 17 15:59:43 GMT 2010

Hello all,

I'd like to know how one could implement this functionality - resizing a polygon (QGraphicsPolygonItem) as is commonly done, for example, in PowerPoint.  Essentially, select the object to display its bounding rectangle and display the (minimally 4) handles at the corners.  Selecting a corner handle will let you resize the object (by leaving the opposite corner unchanged).  Providing a rotation handle would be useful as well, but first things first.

I've seen the following post, but it was for Qt/C++ and it's not obvious to me (mostly a newbie) how this translates to PyQt:

We can display the bounding rectangle on a selectable polygon, but I don't know if there is some hidden magic in the class methods to give this desired functionality, or if it's more manual work, e.g. create 4 additional polygons, grouping/re-parenting, etc.

thanks for any suggestions,

More information about the PyQt mailing list