PDA

View Full Version : How to get screen resize event?



kamlesh.sangani
6th June 2009, 10:15
Hi,

I am trying to get resize event of screen using QDesktopWidget::resized() signals, but not able to get events. Then how can i get notification when screen size is changed?

I am using Qt for S60, 4.5 garden release.

Thanks,
kamlesh

wysota
7th June 2009, 09:56
Can we see your code? Note that S60 support is still in beta, not everything might work.

nish
7th June 2009, 11:05
Hi,

I am trying to get resize event of screen using QDesktopWidget::resized() signals, but not able to get events. Then how can i get notification when screen size is changed?

I am using Qt for S60, 4.5 garden release.

Thanks,
kamlesh

btw, i dont remember when i resized my Nokia phone screen. Do tell me how did u do it.

wysota
7th June 2009, 11:18
btw, i dont remember when i resized my Nokia phone screen. Do tell me how did u do it.

You can switch it from vertical to horizontal mode.

nish
7th June 2009, 11:40
You can switch it from vertical to horizontal mode.

well then there must be S60 specific api for it. I dont remember exactly but when i was working on QtWinCE, on Windows Mobile 5, i got the orientation from the windows api. may be he should look into orientation kinda stuff:)

kamlesh.sangani
11th June 2009, 14:04
Thanks to all for taking interest in my thread.


btw, i dont remember when i resized my Nokia phone screen. Do tell me how did u do it.

Basically screen size will be changed when user change mode from portrait to landscape or vice-versa. For example, Nokia N95 has resolution 240x320 in portrait mode but if user change it to landscape mode than resolution will be 320x240.


Can we see your code? Note that S60 support is still in beta, not everything might work.

I resolved that issue. Actually QWidget::resizeEvent() is get called on mode change. Now its working fine for me. :)

Again thanks to all.

kamlesh

abk883
9th March 2010, 18:55
Hey Kamlesh.. i am facing some problem regarding use of resizeevent()

could you put in some sample code which you use to resize on receiving this event

Kevin Hoang
10th March 2010, 04:10
void YourWidgetname::resizeEvent(QResizeEvent *event)
{
//Add your code here
QWidget::resizeEvent(event);
}

abk883
10th March 2010, 09:46
Thanks Kevin

i was also using the same way as you mentioned ..but when I debug ...no event gets generated on changing Portrait to Landscape mode ....

Do we also need to set this Resize Event on some widget .....