Adding New Device Models
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.
The graphics and settings for the device models are stored in the models/ folder next to your Qt Simulator executable. 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.
Device configuration files have a key:value syntax, with the following valid 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 the diagonalInInch 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 to that, 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.
[Previous: Scripting]
[Next: Known Issues]
|