It will be much easier for you if you implement your main layout view using the G/V architecture. It provides signals or events that tell you which object are where on the screen, has built-in support for selection and moving them around under mouse control, collision detection, and so forth. To do it using QWidget only means you would have to re-invent all of that.
What I described above is a graphics item parent-child hierarchy something like this:
|- Left side handle item
|- Lower left corner handle item
|- Upper right corner handle item
|- Right side handle item
|- Lower right corner handle item
|- Top side handle item
|- Bottom side handle item
ResizableItem (derived from QGraphicsRectItem)
|- Custom widget item (derived from QGraphicsRectItem or QGraphicsPixmapItem)
|- Upper left corner handle item (derived from QGraphicsItem or QGraphicsRectItem)
|- Left side handle item
|- Lower left corner handle item
|- Upper right corner handle item
|- Right side handle item
|- Lower right corner handle item
|- Top side handle item
|- Bottom side handle item
To copy to clipboard, switch view to plain text mode
Note that the "corner handle" items can be all the same QGraphicsItem-based class - all you need to do it to change a rotation property so they are drawn with the right orientation. Likewise for the "side handle" items. So you need a total of 4 unique classes: ResizableItem, CustomItem, CornerItem, and SideItem. The ResizableItem needs to show / hide the handle items when selected / unselected, and needs to move the other "connected" handles when one of them is moved (for example, moving the left side handle means that the top and bottom left corner handles also need to be moved in the x direction).
Make yourself a little demo (prototype) program that contains just a QGraphicsScene / QGraphicsView and implement the 4 QGraphicsItem classes and all of the code needed for moving and sizing. That way, you can isolate this graphical part from all of the other logic until you get it right. Then you can integrate that into your Designer app.
Bookmarks