How to add multiple lines of text from a single class to a scene [SOLVEÐ]
-
wrote on 20 Sept 2015, 07:01 last edited by nanoandrew4
I have been looking around at ways of solving the issue, but haven't found anything yet. What I want is to print speed, altitude, angle, etc... of my plane on the screen, on different lines, but can't manage to print more than one line. Can anyone point to any options I might have to get this done that does not involve creating many classes?
-
Hi,
Do you mean a QGraphicsScene ? If so QGraphicsTextItem is probably what you are looking for
-
Hi,
Do you mean a QGraphicsScene ? If so QGraphicsTextItem is probably what you are looking for
wrote on 20 Sept 2015, 21:46 last edited by@SGaist Thank you, just found out that I can make it work with pointers, don't know why it didn't work before.
-
What do you mean with "with pointers" ?
-
wrote on 20 Sept 2015, 22:01 last edited byThis post is deleted!
-
wrote on 20 Sept 2015, 22:08 last edited by
What I mean by with pointers is I make QGraphicsTextItem *text1 = new QGraphicsTextItem(); and set the text, font and size and add it to the scene.
-
Ok, so what happened before is that the item you added was destroyed before it could be shown
1/7