PDA

View Full Version : Custom GraphicsItem



Mario777
27th March 2017, 05:05
Hello Everyone,

I have created a CustomGrahicsIitem Class for drawing Rectangle,Circle,Line.
Now I want to convert Rectangle to Circle using Context Menu option for Rectangle Item.
How to do this?

Santosh Reddy
27th March 2017, 06:41
You can re-implement
CustomItem::contextMenuEvent and add QAction options to convert to Circle / Line. Connect the those actions to a slot to hide / show the appropriate Circle/Line in the CustomItem.