summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/qstring/stringbuilder.cpp
blob: 90803e20bcafbfbf30bfc966000421025f49dbda (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

//! [0]
    QString foo;
    QString type = "long";

    foo->setText(QLatin1String("vector<") + type + QLatin1String(">::iterator"));

    if (foo.startsWith("(" + type + ") 0x"))
        ...
//! [0]

//! [3]
    #define QT_USE_FAST_CONCATENATION        
//! [3]

//! [4]
    #define QT_USE_FAST_CONCATENATION 
    #define QT_USE_FAST_OPERATOR_PLUS 
//! [4]

//! [5]
    #include <QStringBuilder>

    QString hello("hello");
    QStringRef el(&hello, 2, 3);
    QLatin1String world("world");
    QString message =  hello % el % world % QChar('!');
//! [5]