Ok, leave it commented out, so that we can easily find the problem.
In the screenshot you posted, there are 4 pixmaps - you get all 4 even with only one for loop in your paintEvent()?
Ok, leave it commented out, so that we can easily find the problem.
In the screenshot you posted, there are 4 pixmaps - you get all 4 even with only one for loop in your paintEvent()?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Thats what I talked about in the last post.If you look at the "collisionimages" you'll see that they're also on the wrong position.
EDIT:
Yeah I get 4 images if I leave it commented.The result is the same.
I am sorry, how your answer is answering my question?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Sorry.
The result is the same as shown above in the image I posted.
This means that there is more code influencing your vector tiles, since more is drawn then is filled in the code you posted so far.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
LuckyBlade (13th January 2011)
Holy maccaroni!
I fixed it.
I changed
Qt Code:
for(int i = 0;i != goal;i++) { sourceVector->append(new Tile(rect,i,originalImage.copy(rect))); if(rect.x() + 32 >= originalImage.width()) { rect.setY(rect.y() + 32); rect.setX(0); }else rect.setX(rect.x() + 32); }To copy to clipboard, switch view to plain text mode
to
Everything works fine!Qt Code:
for(int i = 0;i != goal;i++) { sourceVector->append(new Tile(rect,i,originalImage.copy(rect))); if(rect.x() + 32 >= originalImage.width()) { rect.moveTop(32 + rect.y()); rect.moveLeft(0); }else rect.moveLeft(32 + rect.x()); }To copy to clipboard, switch view to plain text mode
If you had used my code from post 4 you'd had that solved since I was using setTopLeft().
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Yeah you're right. I just didn't thought that setX() or setY() would cause the problem.
Well...Now I know better
Bookmarks