| ID | Creation date | June 26, 2009 | |
| Platform | S60 3rd Edition, FP1, FP2 S60 5th Edition | Tested on devices | Nokia 5800 XpressMusic |
| Category | Qt for Symbian | Subcategory | UI |
| Keywords (APIs, classes, methods, functions): QWidget::resizeEvent() |
This code snippets shows how to get notification screen mode from portrait to landscape and vise-versa. Sometime we need to resize our custom control with change in screen mode. Basically QWidget::resizeEvent() get called when user change screen mode, so you have to implement that virtual method in your class.
This snippet can be self-signed. As it does not use any API which require developer/symbian signed certificate.
//resizeEvent() method get called when user change screen mode.
void ResizeEvent::resizeEvent (QResizeEvent* event)
{
QSize widgetSize = event->size();
//Resize your custom control according to new size.
QMainWindow::resizeEvent(event);
}
The code snippet is expected to notify change in screen mode.
Screen after changing mode to portrait