![]() ![]() |
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.
qembed [ general-files ] [ --images image-files ]
#include "generated_qembed_file.h"// Just call the generated function // "name" is the original image filename WITHOUT the extension QImage myFindImage(const char* name) { return qembed_findImage(name); }
// Just call the generated function // "name" is the original filename WITH the extension QByteArray myFindData(const char* name) { return qembed_findData(name); }
Alternatively, look at the output from QEmbed and write a function more tailored to the needs of your application.
Copyright © 2000 Trolltech | Trademarks | Qt version 2.3.1
|