PDA

View Full Version : How can i make widget automatically adjust screen size



kapoorsudhish
23rd October 2009, 12:44
Hi,
I want to make the widget automatically adjust to the size of the screen. I am using setGeometry() but that is causing the problem when in auto adjusting on the screen if the resolution is changed. Please can some body help me on this issue please.

rokkamraja
23rd October 2009, 12:54
use QDesktopWidget and then detect screensize changes by polling every few seconds using a separate QThread and appropriately resize your widget.

This is 1 method which I could think immediately. Not sure if it is good enough as it wud waste CPU cycles.

kapoorsudhish
23rd October 2009, 13:08
i tried to resize the parent widget but the child widget inside are not getting resized, so in this case how can i scale the parent and the child widget both to adjust the screen??

^NyAw^
23rd October 2009, 15:21
Hi,

Insert the children into parent layout and it will autoresize.