what's the equivalent with DPtoLP in windows
I has used QPainter::setWindow to map my logic cooridnate system to meet with the view cooridnate, then at the slot of mousePress event, how can I map back the device cooridnate to logic cooridnate. I know in windows programing, the function LPtoDP do this. Is there an equivalent in Qt or any other method?
Thanks
Re: what's the equivalent with DPtoLP in windows
There is a family of "mapTo" and "mapFrom" methods in various classes. The painter always operates on "logic" coordinates. The widget should operate on "physical" ones.
Re: what's the equivalent with DPtoLP in windows
Quote:
Originally Posted by wysota
There is a family of "mapTo" and "mapFrom" methods in various classes. The painter always operates on "logic" coordinates. The widget should operate on "physical" ones.
Thank you. But I need a little more help. How can I get the display_id which is needed by QScreen constructor?
Re: what's the equivalent with DPtoLP in windows
Try leave it in 0 :rolleyes:
Re: what's the equivalent with DPtoLP in windows
Quote:
Originally Posted by cocalele
Thank you. But I need a little more help. How can I get the display_id which is needed by QScreen constructor?
What do you need a QScreen object for?
Re: what's the equivalent with DPtoLP in windows
Quote:
Originally Posted by wysota
What do you need a QScreen object for?
I want to use the member of QScreen mapFromDevice.
It seems QScreen is part of Qtopia, I even can't find the head file QScreen in my Qt installation directory
Re: what's the equivalent with DPtoLP in windows