Hello,
I am confused trying to understand the relationship and effects of using the setWindow and setViewport calls in the QPainter class.
I think I understand the setWindow part. From what I can gather, setWindow allows me to define a coordinate system that will be device independent and I can draw things using that coordinate system and it gets mapped to the device that I'm painting on.
The setViewport call is what is tripping me up. In the examples that use setViewport, they all define a viewport that is smaller than the device that I'm painting on.
Is it possible (or better yet advisable?) to define a viewport that is larger than the device I'm painting on?
Is it possible (or better yet advisable?) to define a viewport that is positioned outside of the device I'm painting on?
What I'm trying to do is graph some data. I define the window as using...
mypainter.setWindow( -30000, -30000, 60000, 60000);
mypainter.setWindow( -30000, -30000, 60000, 60000);
To copy to clipboard, switch view to plain text mode
I then set the scale so that the data is reasonably large but what I need is a way to ensure that a certain data point is drawn on (or as close to) a particular point in the device such as 3/4 of the way across and 1/3 of the way down.
Perhaps I am using setViewport incorrectly? I'm sure its just that I can't see the forest for the trees and the solution will be trivial but for the life of me I can't figure it out.
Any help would be appreciated.
Bookmarks