summaryrefslogtreecommitdiffstats
path: root/doc/qembed.doc
blob: 8b5e7e23b976bf2fe2f4338d0f838712204abae8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*!
\page qembed.html

\title QEmbed - File and Image Embedder

The QEmbed tool, found in \c{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.

\section1 Usage

\code
    qembed [ general-files ] [ --images image-files ]
\endcode

\list
\i \c{general-files}

These files can be any type of file.

\i \c{--images image-files}

These files must be in image formats supported by Qt.
\endlist

\section1 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:

\section2 qembed_findImage()

\code
    #include "generated_qembed_file.h"

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

Just call the generated function; \e name is the original image
filename <b>without</b> the extension.

\section2 qembed_findData()

\code
    #include "generated_qembed_file.h"

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

Just call the generated function; \e name is the original filename
<b>with</b> the extension

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