Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QResource Class Reference

The QResource class provides access to application resource data. More...

    #include <QResource>

Note: All the functions in this class are reentrant.

- List of all members, including inherited members

### Public Functions

- QList<QResource *> children () const
- const uchar * data () const
- bool isContainer () const
- QString name () const
- const QResource * parent () const
- uint size () const

### Static Public Members

- void addSearchPath ( const QString & path )
- QResource * find ( const QString & resource )

## Detailed Description

The QResource class provides access to application resource data.

QResources are created and used internally although they can also be used for direct access to the application's current resources. Resources must be accessed using absolute paths. Compression and encryption are taken care of internally.

Use find() to find a resource. A resource has a name(), a size(), and either data() or children() (child resources). A resource may also have another resource as its parent().

## Member Function Documentation

### void QResource::addSearchPath ( const QString & path ) `[static]`

Adds path to the search paths searched in to find resources that are not specified with an absolute path. The default search path is to search only in the root ('/').

See also QResource::find().

### QList<QResource *> QResource::children () const

Returns a list of the resource's child nodes. If there are no children or isContainer() returns false, an empty list is returned.

See also isContainer().

### const uchar * QResource::data () const

Returns the resource's data (uncompressed).

See also isContainer() and children().

### QResource * QResource::find ( const QString & resource ) `[static]`

Returns the resource located at path resource, or 0 if no resource is found. Relative resources will be searched for through the search path. Resources are separated from their containing resource with forward slashes ('/') regardless of local file system.

See also QResource::addSearchPath().

### bool QResource::isContainer () const

Returns true if this resource contains at least one other resource (and thus has no data); otherwise returns false.

See also children() and parent().

### QString QResource::name () const

Returns the resource's node name, which is "/" if this resource is at the root of the resource system.

### const QResource * QResource::parent () const

Returns the resource that contains this resource, or 0 if this resource is at the root of the resource system.

### uint QResource::size () const

Returns the uncompressed size of the resource.