| ID | ... | Creation date | June 9, 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): QDesktopWidget::availableGeometry(), QDesktopWidget::screenGeometry() |
This code snippets shows how to get screen coordinates/screen size in application. The API QDesktopWidget::screenGeometry() returns the application rect (screen size of device) and API QDesktopWidget::availableGeometry() returns client rect (screen size minus status pane). It is useful in UI applications that do not use layout managers by implementing virtual QWidget::resizeEvent().
This snippet can be self-signed. As it does not use any API which require developer/symbian signed certificate.
QDesktopWidget* desktopWidget = QApplication::desktop();
//get client rect.
QRect clientRect = desktopWidget->availableGeometry();
//get application rect.
QRect applicationRect = desktopWidget->screenGeometry();
You will get application rect.
Screen Coordinates for 640x360
Screen Coordinates for 360x640
No related wiki articles found