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

# QEmbed - File and Image Embedder

The QEmbed tool, found in `qt/tools/qembed`, converts arbitrary files into C++ code. This is useful for including image files and other resources directly into your application rather than loading the data from external files.

QEmbed can also generate uncompressed versions of images that can be included directly into your application, thus avoiding both the external file and the need to parse the image file format. This is useful for small images such as icons for which compression is not a great gain.

## Usage

        qembed [ general-files ] [ --images image-files ]

- `general-files`

  These files can be any type of file.

- `--images image-files`

  These files must be in image formats supported by Qt.

## Output

The output from QEmbed is a C++ header file which you should include in a C++ source file. In the source file, you should make a wrapper function that suits your application. Two functions are provided; your wrapper function could just call one of these, or you can implement your own. Here's a simple example of usage for each of the supplied functions:

### qembed_findImage()

        #include "generated_qembed_file.h"

        QImage myFindImage(const char* name)
        {
            return qembed_findImage(name);
        }

Just call the generated function; name is the original image filename without the extension.

### qembed_findData()

        #include "generated_qembed_file.h"

        QByteArray myFindData(const char* name)
        {
            return qembed_findData(name);
        }

Just call the generated function; name is the original filename with the extension

Alternatively, look at the output from QEmbed and write a function tailored to your needs.