No, you guys are not seeing the bigger picture. The way I am doing this makes sense, and really fits my project. Does anyone have a suggestion about my question?
I will try again to explain what I am doing, which as I said, is working well, and doing exactly what I want.
On the main QGraphicsScene, there are many types of Items. One of them is something called a block, which has an icon. The icon is represented by a QGraphicsPixMap. When you double click on a block, you can open up a window which allows you to edit it's icon. This window is also a QGraphicsScene. I cannot, and do not want to represent this as anything other then a QGraphicsPixMapItem, as there can potentially be thousands of blocks on the main window.
For the most part, I don't care about the details of the Scene that was used to build the block, however, there are a couple of items on that scene that I do care about, and I need to save information about where those items are on the QPixMap when it is created. All I want to know is how to get the location (pos) of those items in the coordinates of the QPixMap, not the coordinates of the scene that made the QPixMap. Here is my latest try, which is not working yet.
This code is in the GrapphicsItem whose position I care about, and I am trying to create a position point that is offset by the location of the created QPixMap, but I don't have the logic right obviously.
// JSL - Calculate the location of the position of the item on the icon
point1 = mapToScene(pos());
point2 = scene()->itemsBoundingRect().center();
drawData.iconPos = point2 - point1;
QPointF point1, point2;
// JSL - Calculate the location of the position of the item on the icon
point1 = mapToScene(pos());
point2 = scene()->itemsBoundingRect().center();
drawData.iconPos = point2 - point1;
To copy to clipboard, switch view to plain text mode
Bookmarks