Hi,
I need to add a text mark on to a graphics scene, just like Words, or the attached picture.
Does anyone know if there is a free such QGraphicsItem around?
Thanks!
Hi,
I need to add a text mark on to a graphics scene, just like Words, or the attached picture.
Does anyone know if there is a free such QGraphicsItem around?
Thanks!
No - you will have to make one your self, based on the basic graphic items available.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
What is so basic or common a bout it?
Where except in your application and maybe comics applications you might see something like that?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Not a GraphicsItem, but you could show a QWhatsThis at the appropriate position. It's like a hint, but stays visible, until the user clicks somewhere.
Otherwise, really just implement this yourself. Inherit from QGraphicsItem. Introduce text and size attributes and a position for the starting point of the text mark. Whenever an updated is required (due to attribute changes or on first show) create a QPainterPath for your bubble, using arcTo and lineTo. Return that as shape of your item and its boundingRect as boundingrect.. You can draw the path and the text in the paintEvent of your item using the QPainter.
HIH
Joh
Bookmarks