aboutsummaryrefslogtreecommitdiffstats
path: root/doc/codesnippets/doc/src/snippets/code/src_qt3support_other_q3mimefactory.cpp
blob: f00ad7363df261c35e7cfdebb2cf8d8c7b9e899d (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
//! [0]
static const char* myimage_data[]={
"...",
...
"..."};
//! [0]


//! [1]
Q3MimeSourceFactory::defaultFactory()->setImage("myimage", QImage(myimage_data));
//! [1]


//! [2]
QLabel* label = new QLabel(
    "Rich text with embedded image:<img source=\"myimage\">"
    "Isn't that <em>cute</em>?");
//! [2]


//! [3]
delete label;
Q3MimeSourceFactory::defaultFactory()->setData("myimage", 0);
//! [3]


//! [4]
setExtensionType("html", "text/html;charset=iso8859-1");
setExtensionType("htm", "text/html;charset=iso8859-1");
setExtensionType("txt", "text/plain");
setExtensionType("xml", "text/xml;charset=UTF-8");
//! [4]