Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Customizing a Skin for QVFb

Introduction

This document explains how to customize the QVFb skin for a specific project.

The virtual framebuffer is located in $QTDIR/tools/qvfb.

QVFb is a development tool only. No security issues have been considered in the virtual framebuffer design. It should not be used in a production environment and Qt for Embedded Linux should be configured with -no-gfx-qvfb in production libraries.

QVFb Skin Format

The files comprising a QVFb skin are placed in a directory with a .skin extension, for example devices/greenphone/Greenphone.skin/ in the Qt Extended source.

The file defining the skin has the same name as the directory containing it - Greenphone.skin in the above example.

The .skin file consists of the following:

  • [SkinFile] - this must be the first line.
  • The name of the images specifying the appearance of the device in different states. The states supported are:
    • Up - The normal appearance of the device with no buttons pressed.
    • Down - The appearance of the device with all buttons pressed.
    • Closed - For devices that have a closed state, such as a clamshell phone.
  • The size and position of the screen(s):
    • Screen - The position and size of the screen in the format x y w h
    • ClosedScreen - The position and size of the screen visible when the device is closed in the format x y w h
  • Last comes the button definition. The "Area" value specifies how many buttons are available followed by the buttons. The format is:
        "name" keycode <x y> <x y> [<x y> ...]}

Coordinates

The coordinates are a list of at least 2 points in a clockwise order that define a shape for the button. If only two points are provided they are treated as opposite corners of a rectangle. Any click inside the points will be treated as a click on that button. While pressed, the pixels for the button are redrawn from the "Down" image.

You can examine Trolltech-Keypad.skin and Trolltech-Touchscreen.skin in $QTDIR/tools/QVFb as examples.

defaultbuttons.conf

You can also include a defaultbuttons.conf file. This file customizes the launch screen applications and the ordering of the soft keys. There are also input method hints in this file.

See Keypad Button Behavior for more detailed documentation for defaultbuttons.conf

Specifying Screen Size Independent of Skin

QVFb allows the screen size to be specified independently of the skin. For example, you can use the SmartPhone.skin but specify a screen size of 240x320 pixels. The skin (if command-line arguments are used) or screen (if Configure is used) will be scaled accordingly. For example:

     QVFb -skin SmartPhone.skin -width 240 -height 320 -zoom 0.7

The above example uses the SmartPhone.skin (screen area 176x208 skin pixels) but with a 240x320 pixel virtual framebuffer (ie. what Qt Extended draws to). The screen is scaled down by 0.7 resulting in a display that is a smooth-scaled 168x224 pixels.

Note that the SmartPhone.skin is 176x208, not 3:4 which means that 3:4 pixel screens are slightly distorted (but still pixel-correct).

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web