PDA

View Full Version : Drawing curve legend



lni
14th February 2010, 13:14
Hi,

I need to create a legend item to show various curves on screen. I am thinking to use one single QGraphicsTextItem as it supports line break (\n), so I can create several line breaks to show different curves by their names, but I also need to draw a small segment of the curve in front of their names using the same pen to distinguish which curve is which.

How can I draw a line segment in front of a text insider QGraphicsTextItem? Of course I also need a tab space for the line segment...

Thanks...

ecanela
16th February 2010, 03:42
maybe try to create a a QGraphicsText item as set the text using a HTML using the function QGraphicsTextItem::setHtml ()