Hi,
I have made a class which extends QGraphicsItem and it adds himself to a QGraphicsGroup like this:
scene().addItem(group);
group.addToGroup(this);
group.addToGroup(piece);
QGraphicsItemGroup group = new QGraphicsItemGroup();
scene().addItem(group);
group.addToGroup(this);
group.addToGroup(piece);
To copy to clipboard, switch view to plain text mode
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);
}
public Object itemChange(GraphicsItemChange change, Object value) {
return super.itemChange(change, value);
}
To copy to clipboard, switch view to plain text mode
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
Bookmarks