[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mozilla-qt
Subject:    access to canvas items
From:       "Frank Grenzel" <Frank.Grenzel () web ! de>
Date:       2003-06-11 13:20:36
[Download RAW message or body]

Hi! 
If have a canvas(view) with some items of sprites and text (CanvasSprite 
and CanvasText). 
How can I change the text? With 

QCanvasItemList list = canvas()->collisions(e->pos()); 
   if ( !list.isEmpty() ) {
      QCanvasItem* item = list.first(); 
      // some code 
   } 

I can found and select the item touched by the mouse. But now I only have 
access to the CanvasItem Members like move. But I need to access text() 
and setText(), which is no element of QCanvasItem. 

To store some data with the sprite items I've written a subclass of 
QCanvasSprite, called MyCanvasSprite. Now I con store and read some 
informations like name or numbers to sprites. 
But I habe the same problem to access them like to access the text on 
text items. 

Any ideas to slove this problems (sorry, I'm a newbie on C++ and Qt)? 

Frank

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic