Solved QGraphicsTextItem doesn't have methods: setDefaultTextColor and setPos
-
Hello guys!
I am writing first time using Qt, trying to modify Clementine music player and add some useful feature. I almost completed what I wanted to do. But now I need just add text to the window which isQGraphicsScene
, so I am trying to add text using method:addText("text")
It works, but then I need to change color and position of the text in this view. But Kdevelop doesn't recognize that this
QGraphicsTextItem
(returned by method addText) has methods:setDefaultTextColor
andsetPos
.According to documentation it should have.
Qt: 5-15.
-
Solution was easy. I had to add
#include <QGraphicsTextItem>
and it just works.