Qt Extended Home · Build System Home · Reference · User Guide · Internals codeless banner

installpic Algorithm

The installpic perl script is used when running "qbuild image" on a Qt Extended project, to install pictures for the project.

    For proper image installation you MUST do something like this:

        pics.files=mypics/*
        pics.path=/pics/myapp
        pics.hint=pics
        INSTALLS+=pics

    Given the above, the logic behind installing pictures is as follows:

    - Languages are handled by having an i18n directory.
      If you want to translate an image you MUST NOT have an image with the same name
      outside of the i18n directory.

      eg.

        mypics/foo.png
        mypics/i18n/de/foo.png   <-- This file will NEVER be used

      The correct way to handle translatable images is to put the default version in i18n/en_US.
      The default will be used when a file for the selected language cannot be found.

      eg.

        mypics/i18n/de/foo.png
        mypics/i18n/en_US/foo.png   <-- This will be used for languages other than 'de'.

    - Icons must be in a subdirectory called icons/<size>.
      The size can either be <width>x<height> or scalable.
      SVG icons should be placed in the scalable directory.
      Icons in other directories should be properly scaled.
      You can have multiple sizes available. Any icon not found for the selected
      size will be created by scaling a different size.

      eg.

        mypics/icons/14x14/foo.png
        mypics/icons/16x16/foo.png
        mypics/icons/16x16/bar.png

        If the selected size is 14x14 then 16x16/bar.png will be scaled down to 14x14.

      If a scalable icon exists, it will be used in preference to a sized icon.

      eg.

        mypics/icons/scalable/foo.svg
        mypics/icons/14x14/foo.png   <-- This file will NOT be installed

    - Icons can be translated too. The i18n direcory MUST be placed inside the icons directory.
      You CANNOT put an icons directory inside an i18n directory.
      Note that all of the restrictions relating to i18n and icons apply.

      eg.

        mypics/icon/14x14/i18n/en_US/foo.png
        mypics/icon/14x14/i18n/de/foo.png

    - Files that end in .ai are never installed.
      These are Adobe Illustrator files that serve as the source material for the .svg files.

    - Files that end in .xcf are never installed.
      These are GIMP files that serve as the source material for .png files.

    - If a file exists with multiple extensions, only 1 file will get installed.
      The priority order for extensions is configurable.

      eg.

        configure -image-extension-order png,xpm

      Note that .svg files ALWAYS have the highest priority.

    - Some files will be ignored if a .svg file exists.

      eg.

        mypics/foo.svg
        mypics/foo_16.png   <-- This file will be ignored
        mypics/foo_48.png   <-- This file will be ignored

See also Overviews and hint=pics.


Copyright © 2009 Trolltech
Qt Extended - Build System Documentation