PDA

View Full Version : strange behavior of QGraphicsItemGroup in Qt Jambi



Febell
10th June 2011, 22:22
Hi,

I have made a class which extends QGraphicsItem and it adds himself to a QGraphicsGroup like this:



QGraphicsItemGroup group = new QGraphicsItemGroup();
scene().addItem(group);
group.addToGroup(this);
group.addToGroup(piece);


All workes perfektly until I overrides the funktion itemChange(GraphicsItemChange change, Object value) in my item. If I override it like this:



public Object itemChange(GraphicsItemChange change, Object value) {
return super.itemChange(change, value);
}


The API says that nothing should happen. But now my item is not moving together with the other item in the group (which it do when itemChange(..) is not overriden). I've looked at the events I am getting and I get the "ItemParentChanges" but not the "ItemParentHasChanged" event.

Suggestions what the problem could be?

Greetings Febell