Revision as of 18:23, 15 July 2012 by lpvalente (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Adding New Device Models in Qt Simulator

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Created: chintandave_er (04 Nov 2010)
Last edited: lpvalente (15 Jul 2012)



Qt Simulator contains predefined configuration files for several Nokia devices. You can add devices by creating configuration files that specify the screen size.

That is, the size of the area on which Qt Simulator draws the application.

You can also add an image of the device in PNG format. In the configuration file, specify the position of the screen within the image.

How to

The graphics and settings for the device models are stored in the models/ folder next to your Qt Simulator executable. The Full path is NokiaQtSDKInstallationDirectory/Simulator/Application/models.

To add a new device, create a subfolder and put a <your device name>.config file into it. It is easiest to copy and modify one of the existing files.

Sample Model created with name ‘NokiaN8’ by adding below files and .config file to NokiaN8 Folder.



Configuration File

Device configuration files have a key:value syntax, with the following valid keys. Sample code for created NokiaN8 model for Symbian device is as below. For Maemo Model last 4 keys are not required.


Descirption of Keys

• name:<string> - required. Name to show in the device selection drop down menu.

• resolutionWidth:<integer> - required. Width of the device screen.

• resolutionHeight:<integer> - required. Height of the device screen.

• diagonalInInch:<float> - required. Length of the screen diagonal in inches.

• mockup:<path> - required. Path to the image for the device. Relative to the .config file.

• offsetX:<integer> - required. Offset of the screen top left corner from the top left corner of the mockup image.

• offsetY:<integer> - required. Offset of the screen top left corner from the top left corner of the mockup image.

• defaultFontSize:<integer> - optional (default: 12). Font size the device uses if it is not set explicitly.

• forceDpi:<integer> - optional. Renders the screen by using this DPI value instead of the physical DPI computed from thediagonalInInch value.

• style:<string>,<string> - optional. The first string names the Qt style to be used for applications running in Qt Simulator. The second string is optional, only used for the s60 style and denotes the theme to be used. The only valid name is "nseriesblack"

• button:<key name>,<key text>,<x>,<y>,<width>,<height> - optional, may be used more than once. When the user clicks inside the rectangle defined by x,y,width,height send the key specified by key name and key text to the application. key name must be the name of a value in the Qt::Keys enum. key text is the value the text() member of the generated QKeyEvent returns. In order to make the comma key work the text has to be escaped. Just use "\," (without quotaion marks) here.

• menuPortrait/-Landscape:<string> - optional. Images to use as menu mockups for portrait or landscape orientation. The images may contain transparent areas to be aligned horizontally or vertically. The images are always positioned in the top left corner of the display. To make the menu appear to the right of the screen, add a transparent area on the left sidee of the image.

• availableGeometryPortrait/-Landscape:<x>,<y>,<width>,<height> - optional. Screen area which is available for an application when menus are shown. If no menus are specified or the window is shown in full screen mode, the whole display is used.


In addition, it is possible to run a script whenever your device is chosen in the device selection. Therefore just add a file named <name of your device (given in the .config file)>.qs to scripts/devices.

This page was last modified on 15 July 2012, at 18:23.
94 page views in the last 30 days.