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

# QFileEngineHandler Class Reference

The QFileEngineHandler class allows custom QFileEngines to be plugged into Qt. More...

    #include <QFileEngineHandler>

Note: All the functions in this class are reentrant.

- List of all members, including inherited members

### Protected Functions

- QFileEngineHandler ()
- virtual ~QFileEngineHandler ()
- virtual QFileEngine * createFileEngine ( const QString & path ) = 0

## Detailed Description

The QFileEngineHandler class allows custom QFileEngines to be plugged into Qt.

You can create your own QFileEngine subclass to handle the files in particular paths. To make Qt aware of your QFileEngine subclass, create a QFileEngineHandler subclass and reimplement createFileEngine() to return an instance of your QFileEngine for the paths you are interested in. This will add your QFileEngine to Qt's list of file handlers and will ensure that your QFileEngine is used for files with paths that your createFileEngine() recognises.

One way to instantiate your QFileEngineHandler is to make it a global static.

## Member Function Documentation

### QFileEngineHandler::QFileEngineHandler () `[protected]`

Constructs a QFileEngineHandler. Once created this handler's createFileEngine() function will be called (along with all the other handlers) for any paths used. The first handler (most recently created) that handles the given path (i.e. that returns a QFileEngine) is used for the new path.

See also createFileEngine().

### QFileEngineHandler::~QFileEngineHandler () `[virtual protected]`

Destroys a QFileEngineHandler. This will automatically remove the handler from the list of known handlers.

### QFileEngine * QFileEngineHandler::createFileEngine ( const QString & path ) `[pure virtual protected]`

This function is called when a new path is used. If path is a path for your QFileEngine subclass your reimplementation of this function must return a new instance of your subclass; the caller will take ownership and be responsible for the instance's destruction. If path is not a path that is handled by your subclass simply return 0; in this case a default QFileEngine will be used to handle the path.

This virtual function must be reimplemented by all QFileEngineHandler subclasses.