Hi all.
I'm having an issue with my QGraphicsItems. I want to put multiple QGraphicsItems next to eachother. What would be the best way to do that?
I used this code, which only works when the items are not transformed. But what should I use when the items are infact transformed? Because boundingRect() doesn't take the transformation into account.
for (int i = 0; i < itemList.size(); i++) {
itemList[i]->setTransformationMode(Qt::SmoothTransformation);
if (i > 0) itemList[i]->setPos(itemList[i-1]->x()+itemList[i-1]->boundingRect().width(), 0);
itemList[i]->setPos(itemList[i]->x(), (200-itemList[i]->boundingRect().height())/2.0);
}
for (int i = 0; i < itemList.size(); i++) {
itemList[i]->setTransformationMode(Qt::SmoothTransformation);
if (i > 0) itemList[i]->setPos(itemList[i-1]->x()+itemList[i-1]->boundingRect().width(), 0);
itemList[i]->setPos(itemList[i]->x(), (200-itemList[i]->boundingRect().height())/2.0);
}
To copy to clipboard, switch view to plain text mode
I hope someone here can help me.... Thanks!
Bookmarks