thnx...
btw suppose i still want to use QPainter's and QWidgets schema....
is it possible from QWidget :: paintEvent() to trigger using SIGNALs and SLOTs each myCustomPaintEvent of each entity?? ex. myShape :: myCustomPaintEvent() ???
![]()
thnx...
btw suppose i still want to use QPainter's and QWidgets schema....
is it possible from QWidget :: paintEvent() to trigger using SIGNALs and SLOTs each myCustomPaintEvent of each entity?? ex. myShape :: myCustomPaintEvent() ???
![]()
You can create one widget subclass for each shape you want to draw.
This is the easiest way if you want to use widgets for this.
Or you can create a single QWidget subclass with methods that draw all the shapes you need, taking as parameter a QPainter pointer. Also you have to add an enum specifying the shape type.
In the paint event of this widget you can test the shape type and call the right method.
Bookmarks