Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded |

# Resource Class Reference

The Resource class provides access to named resources. More...

`#include <qtopia/resource.h>`

List of all member functions.

## Public Members

- enum ResourceType { PixResource, SoundResource, AllResources }

## Static Public Members

- QImage loadImage ( const QString & name )
- QPixmap loadPixmap ( const QString & pix )
- QBitmap loadBitmap ( const QString & pix )
- QString findPixmap ( const QString & pix )
- QIconSet loadIconSet ( const QString & pix )
- QString findSound ( const QString & name )
- QStringList allSounds ()
- void setExtraPaths ( ResourceType t, const QStringList & extras )
- const QStringList & extraPaths ( ResourceType t )

## Detailed Description

The Resource class provides access to named resources.

The resources may be provided from files or other sources.

The allSounds() function returns a list of all the sounds available. A particular sound can be searched for using findSound().

Images can be loaded with loadImage(), loadPixmap(), loadBitmap() and loadIconSet().

See also Qtopia Classes.

## Member Type Documentation

### Resource::ResourceType

- `Resource::PixResource`
- `Resource::SoundResource`
- `Resource::AllResources`

## Member Function Documentation

### QStringList Resource::allSounds ()`[static]`

Returns a list of all sound names.

### const QStringList & Resource::extraPaths ( ResourceType t )`[static]`

Returns a list of extra paths for given resource as absolute paths

First availability: Qtopia 2.0

### QString Resource::findPixmap ( const QString & pix )`[static]`

Returns the filename of a pixmap called pix. You should avoid including any filename type extension (e.g. .png, .xpm).

Normally you will use loadPixmap() rather than this function.

### QString Resource::findSound ( const QString & name )`[static]`

Returns a sound file for a sound called name.

You should avoid including any filename type extension (e.g. .wav), as the system will search for only those fileformats which are supported by the library.

Currently, only WAV files are supported.

### QBitmap Resource::loadBitmap ( const QString & pix )`[static]`

Returns the QBitmap called pix. You should avoid including any filename type extension (e.g. .png, .xpm).

### QIconSet Resource::loadIconSet ( const QString & pix )`[static]`

Returns a QIconSet for the pixmap named pix. You should avoid including any filename type extension (eg. .png, .xpm). The icon size is determined by the Qtopia font setting.

First availability: Qtopia 1.6

### QImage Resource::loadImage ( const QString & name )`[static]`

Returns the QImage called name. You should avoid including any filename type extension (e.g. .png, .xpm).

### QPixmap Resource::loadPixmap ( const QString & pix )`[static]`

Returns the QPixmap called pix. You should avoid including any filename type extension (e.g. .png, .xpm).

### void Resource::setExtraPaths ( ResourceType t, const QStringList & extras )`[static]`

For a given resource type t append the paths contained in extras to resource search path. A given path choice may be either relative to $QPEDIR or an absolute path

First availability: Qtopia 2.0

This file is part of the Qtopia platform, copyright © 1995-2004 Trolltech, all rights reserved.