| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 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 |
#include <QtWidgets/QApplication> |
| 30 |
#include <QtGui> |
| 31 |
#include <QtCore> |
| 32 |
#include <QtWidgets/QLabel> |
| 33 |
#include <QtWidgets/QBoxLayout> |
| 34 |
int main(int argc, char **argv) |
| 35 |
{ |
| 36 |
QApplication a(argc, argv); |
| 37 |
|
| 38 |
|
| 39 |
QWidget w; |
| 40 |
QLabel label1(QObject::tr("abc", "ascii"), &w); |
| 41 |
QLabel label2(QObject::tr("æøå", "utf-8"), &w); |
| 42 |
QLabel label2a(QObject::tr("\303\246\303\270\303\245", "utf-8 oct"), &w); |
| 43 |
QLabel label3(QObject::tr("Für Élise", "trUtf8"), &w); // trUtf8 is obsolete |
| 44 |
QLabel label3a(QObject::tr("F\303\274r \303\211lise", "trUtf8 oct"), &w); // trUtf8 is obsolete |
| 45 |
|
| 46 |
QBoxLayout *ly = new QVBoxLayout(&w); |
| 47 |
ly->addWidget(&label1); |
| 48 |
ly->addWidget(&label2); |
| 49 |
ly->addWidget(&label2a); |
| 50 |
ly->addWidget(&label3); |
| 51 |
ly->addWidget(&label3a); |
| 52 |
|
| 53 |
w.show(); |
| 54 |
return a.exec(); |
| 55 |
} |