Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

Tutorial: Theming Files

Examples of the:

required to construct a new theme, are provided below.

Theme Project File

A project file in <qt-extended-root-dir>/etc/themes/<theme name>/qbuild.pro is required to define the files to be installed for the theme: For example, the Qtopia theme project file: <qt-extended-root-dir>/etc/themes/qtopia/qbuild.pro contains:

    STRING_LANGUAGE=en_US
    AVAILABLE_LANGUAGES=$$QTOPIA_AVAILABLE_LANGUAGES
    LANGUAGES=$$QTOPIA_LANGUAGES
    UNIFIED_NCT_LUPDATE=1

    pkg [
        name=qtopia-theme
        desc="Qtopia theme for Qt Extended."
        version=$$QTOPIA_VERSION
        license=$$QTOPIA_LICENSE
        maintainer=$$QTOPIA_MAINTAINER
    ]

    conf [
        hint=themecfg
        files=qtopia.conf
        path=/etc/themes
        trtarget=Theme-Qtopia
    ]

    data [
        hint=image
        files=*.xml *rc
        path=/etc/themes/qtopia
    ]

    pics [
        hint=pics
        files=pics/*
        path=/pics/themes/qtopia
    ]

    bgimage [
        hint=background
        files=\
            background.png\
            ladybug.png
        path=/pics/themes/qtopia
    ]

Theme Configuration File

A configuration file in <qt-extended-root-dir>/etc/themes/ is required to define a theme as follows:

    [Theme]
    Name = <name of theme (translatable)>
    Style = <name of the Style plug-in that handles widget drawing>
    ColorScheme = <list of color schemes associated with the theme>
    Backgrounds = <list of background images associated with the theme>
    TitleConfig = <path to the title configuration file>
    HomeConfig = <path to the home screen configuration file>
    ContextConfig = <path to the context bar configuration file>
    DialerConfig = <path to the touch screen dialer configuration file>
    CallScreenConfig = <path to the call screen configuration file>
    DecorationConfig = <path to the window decoration configuration file>
    SecondaryTitleConfig = <optional - path to the secondary title configuration file>
    SecondaryHomeConfig = <optional - path to the secondary home screen configuration file>
    BootChargerConfig = <path to the boot charger configuration file>
    IconPath = <list of semi-colon separated paths to substitute icons>

All paths are relative to the etc/themes directory except IconPath which is relative to <qt-extended-root-dir>.

For example, the Qtopia theme is defined by: <qt-extended-root-dir>/etc/themes/qtopia.conf:

    [Theme]
    Name[] = Qtopia
    Style = Qtopia
    HeaderSize = 0.145
    ContextSize = 0.09
    ColorScheme = Qtopia.scheme|Carmine.scheme|Crisp.scheme|Fern.scheme|Lavender.scheme|Saffron.scheme|SteelBlue.scheme
    Backgrounds = background|ladybug
    ExtendedFocusHighlight = 1
    FormStyle = QtopiaDefaultStyle
    PopupShadows = 0
    HideMenuIcons = 1
    FullWidthMenu = 1
    TitleConfig = qtopia/title.xml
    HomeConfig = qtopia/home.xml
    ContextConfig = qtopia/context.xml
    DialerConfig = qtopia/dialer.xml
    CallScreenConfig = qtopia/callscreen.xml
    DecorationConfig = qtopia/decorationrc
    SecondaryTitleConfig = qtopia/secondarytitle.xml
    SecondaryHomeConfig = qtopia/secondaryhome.xml
    BootChargerConfig = qtopia/bootcharger.xml
    [Translation]
    File=QtopiaThemes
    Context=Themes

The title, home screen, call screen, dialer and context bar share the same theming format while the window decoration and widget themes have their own formats.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3