devdon
5th October 2011, 11:00
I'm placing the symbols in a musical key signature on a musical staff. This part is successful. All the symbols are successfully placed individually using scene->addItem(mySigItem); mySigItem->setPos(tx,ty);
But I'd like the first symbol to be the parent item and the rest of the symbols be child items so that the key signature can be moved as a single piece. When I change the lines to mySigItem2->setParentItem(mySigItem1) then the position of the second item is FAR to the right and down the screen. I have tried setting the flag ItemIgnoresTransformations, mapTo/FromScene, mapFrom/ToParent, etc. and everything else I can think of or find in the docs. The coordinates work individually placed but simply setting the item as a child breaks them and they wander off.
Please help me figure out what I'm doing wrong. Thanks.
But I'd like the first symbol to be the parent item and the rest of the symbols be child items so that the key signature can be moved as a single piece. When I change the lines to mySigItem2->setParentItem(mySigItem1) then the position of the second item is FAR to the right and down the screen. I have tried setting the flag ItemIgnoresTransformations, mapTo/FromScene, mapFrom/ToParent, etc. and everything else I can think of or find in the docs. The coordinates work individually placed but simply setting the item as a child breaks them and they wander off.
Please help me figure out what I'm doing wrong. Thanks.