Dear QtCummunity,
I would like to draw a custom item like the attached image. Request your suggestion please.
Code:
{ // Please suggest me }
Printable View
Dear QtCummunity,
I would like to draw a custom item like the attached image. Request your suggestion please.
Code:
{ // Please suggest me }
Use QPainter::drawLine(), QPainter::drawRect(), and QPainter::drawPolygon() (for the triangle). Use whatever dimensions are the most convenient for your application, since all of the transformations to set position, scale, and rotation are done by the parent of your MyItem.
Do you want to paint it as a single item? then use QPainterPath(s)
You could also use multiple QGrpahicsLineItems, and use QPen and QBrush settings as needed.