PDA

View Full Version : globally re-orient the co-ordinate system



tomg_66
21st October 2010, 17:32
I have a device that I would like to dynamically re-orient the co-ordinate system on. Like taking the ipad and turning it on it's side. How can I re-map the co-ordinate system so that instead of the geometry of the screen reporting the screen as, say 800x480 and the origin in the upper left hand corner, have it report the origin at one of the different corners, and the screen being 480x800, and have this happen -globally-? Otherwise it would take re-implementing -every single- widget's and -every single- button's paint event. Of course it wouldn't be difficult to shuffle around the screen when I got some signal that indicated that the orientation changed, but getting to that point seems to be the problem. I'm currently using Qt 4.6.3 (ok, I'll move to 4.7 soon) compiled for an embedded system, running on debian kernel 2.6.29 on an omap 4 chip.

TIA,

Tom

wysota
21st October 2010, 21:54
You can use Graphics View as the base for your ui and just rotate the scene but with a complex user interface it will get quite slow. The real and only solution is to implement it in the operating system. If the device is running X11, XRandR or something similar should be a viable solution.

tomg_66
21st October 2010, 23:49
hmmm... ok, thanks... since we are running qt embedded, it would seem as if I need to find an ioctl that will allow me to re-orient the screen. Thanks for the heads up. Might be something to think about in the future. It doesn't seem as if it would be -too- hard to make a global setting like that somewhere....