Solved How to get text from the scene in new class
-
Hello everyone ,
How to get text item form the scene
many Thanks -
Hi
QList<QGraphicsItem *> list = scene->items(); foreach( QGraphicsItem * item, list ) { if( QGraphicsTextItem * TextItem = qgraphicsitem_cast<QGraphicsTextItem *>( item ) ) { TextItem-> ..... } }
-
Sorry, but I have no idea what you are asking!
What is scene?
Which text? Where is this text stored? What do you mean by "new class"? -
@mrjj Thanks for reply... but I think Why we are not using list as list has all the items from the window scene like this
QList<QGraphicsItem *> list = scene->items(); foreach( QGraphicsItem * item, list ) { if( QGraphicsTextItem * TextItem = qgraphicsitem_cast<QGraphicsTextItem *>( list ) ) { TextItem-> ..... } }
-
@jsulm scene is my display window and if i write on my scene some text. I want to read that text when I read all the items() from the scene