Beispiel #1
0
 def itemChange (self, change,value):
     if change == QGraphicsItem.ItemSelectedChange :
         self.heros.setSelected(value,self.view.first_selection)
 #    return super(HerosItem,self).itemChange(change,value) 
     #if (change == QGraphicsItem.ItemPositionChange) and (self.pos().x()!= self.pos().y()) and (self.pos().x()!=0) :
         #self.heros.attribs['latitude'],self.heros.attribs['longitude'] = self.scene_coord.SceneToLatLon(self.pos().x(),self.pos().y())
         #print ('position changed',self.heros.attribs['latitude'],self.heros.attribs['longitude']) 
     return QGraphicsItem.itemChange(self,change,value)
Beispiel #2
0
 def itemChange(self, change, value):
     if change == QGraphicsItem.ItemPositionHasChanged :
         self.model.position = value
         #pos = self.view.mapToScene(value.x(),value.y())
         lat,lon = self.scene_coord.SceneToLatLon(value.x(),value.y())
         self.model.changePosition (lat,lon)
         print ('new position ',self.model.position)
     else:
         return QGraphicsItem.itemChange(self,change,value)