steadi
20th October 2012, 16:20
Hello,
Sorry for the short post but I am on my linux laptop. So, here is the problem that I am hoping someone could help me out with: In a previous post, I asked about placing an item where the mouse cursor is by using a scene. After finally getting this to work, I was able to place items but the mouse coordinates where way off to the right.
Here is the code that I am using:
mousepos.setX(ui->GraphicsMap->cursor().pos().x());
mousepos.setY(ui->GraphicsMap->cursor().pos().y());
This works but the items are placed wayy off from the coordinates.
So, is this code correct or is there a more precise way of doing this?
Sorry again for this being under-detailed and short but I am using my laptop and have somewhere to be.
Thanks guys,
Matt
Sorry for the short post but I am on my linux laptop. So, here is the problem that I am hoping someone could help me out with: In a previous post, I asked about placing an item where the mouse cursor is by using a scene. After finally getting this to work, I was able to place items but the mouse coordinates where way off to the right.
Here is the code that I am using:
mousepos.setX(ui->GraphicsMap->cursor().pos().x());
mousepos.setY(ui->GraphicsMap->cursor().pos().y());
This works but the items are placed wayy off from the coordinates.
So, is this code correct or is there a more precise way of doing this?
Sorry again for this being under-detailed and short but I am using my laptop and have somewhere to be.
Thanks guys,
Matt