What happens if you try resize()?
What happens if you try resize()?
==========================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.
I think I found the problem, it was an invisible parent widget sitting behind, when I refresh it then everything works ok.
Hmm, still I have to get out of full screen mode and then get back in for Qt to pick up changes in screen dimensions. It works, but redrawing looks really ugly with a lot of flashing. Not sure what I can do about it.
Ideas anyone?
There is a repaint() and paintEvent() pair.The widget is created and running always full screen. When the widget needs an update it calls repaint(), then in paintEvent it regenerates its screen image and paints it using QPainter.
The screen driver is based on QScreen. When the screen becomes landscape it starts reporting new height and width.
So the widget needs to go into a non-fullscreen state (resize itself for example) and the back to fullscreen to see the new width/height of the screen.
If the widget shows an image in portrait, then after changing the orientation of the device to landscape, the image is not shown completely until the resize/fullscreen is done.
repaint and paintEvent are completely unrelated to the problem. They have nothing to do with dimensions of your window.
OK. If the window receives showFullScreen() and it is in full screen it does nothing. It does not check that the screen has been changed. if it is sent resize(0,0) and then showFullScreen() then it occupies the full screen with new width and height.
The code is trivial. Hardware changed in the background, but the changes are not propagated. Do I need to inform some Qt class that the sceen has been transformed? If yes then how?
There are two methods in QScreen: isTransformed() and transformOrientation(). Both overwritten by my driver and return true/rotation corresponding the situation. No avail. I did a search through Qt and could see that those functions don't do much themselves, probably orientated on the transformation derived class functionality.
@wysota: appreciate your answers, thanks.
Last edited by Dzha; 4th November 2010 at 13:57.
OK. Is there a mechanism for informing the windows manager that the screen is changed?The window does not check anything. It's your (or the window manager's) duty to know the screen size has changed.
Well, all I was able to find while reading the window manager documentation was related to resizing the window, which I want to avoid.
I can not see any method of not leaving the full screen mode (thus avoiding additional repaint) that is described in Qt doc.
If you are aware of it, please tell me.
QWS, Qt for Embedded Linux.
Bookmarks