/src/qtbase/src/gui/text/qstatictext.h
Line | Count | Source |
1 | | // Copyright (C) 2016 The Qt Company Ltd. |
2 | | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | | |
4 | | #ifndef QSTATICTEXT_H |
5 | | #define QSTATICTEXT_H |
6 | | |
7 | | #include <QtGui/qtguiglobal.h> |
8 | | #include <QtCore/qsize.h> |
9 | | #include <QtCore/qstring.h> |
10 | | #include <QtCore/qmetatype.h> |
11 | | |
12 | | #include <QtGui/qtransform.h> |
13 | | #include <QtGui/qfont.h> |
14 | | #include <QtGui/qtextoption.h> |
15 | | |
16 | | QT_BEGIN_NAMESPACE |
17 | | |
18 | | |
19 | | class QStaticTextPrivate; |
20 | | class Q_GUI_EXPORT QStaticText |
21 | | { |
22 | | public: |
23 | | enum PerformanceHint { |
24 | | ModerateCaching, |
25 | | AggressiveCaching |
26 | | }; |
27 | | |
28 | | QStaticText(); |
29 | | explicit QStaticText(const QString &text); |
30 | | QStaticText(const QStaticText &other); |
31 | 0 | QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QStaticText) |
32 | 0 | QStaticText &operator=(const QStaticText &); |
33 | 0 | ~QStaticText(); |
34 | 0 |
|
35 | 0 | void swap(QStaticText &other) noexcept { data.swap(other.data); } |
36 | | |
37 | | void setText(const QString &text); |
38 | | QString text() const; |
39 | | |
40 | | void setTextFormat(Qt::TextFormat textFormat); |
41 | | Qt::TextFormat textFormat() const; |
42 | | |
43 | | void setTextWidth(qreal textWidth); |
44 | | qreal textWidth() const; |
45 | | |
46 | | void setTextOption(const QTextOption &textOption); |
47 | | QTextOption textOption() const; |
48 | | |
49 | | QSizeF size() const; |
50 | | |
51 | | void prepare(const QTransform &matrix = QTransform(), const QFont &font = QFont()); |
52 | | |
53 | | void setPerformanceHint(PerformanceHint performanceHint); |
54 | | PerformanceHint performanceHint() const; |
55 | | |
56 | | bool operator==(const QStaticText &) const; |
57 | | bool operator!=(const QStaticText &) const; |
58 | | |
59 | | private: |
60 | | void detach(); |
61 | | |
62 | | QExplicitlySharedDataPointer<QStaticTextPrivate> data; |
63 | | friend class QStaticTextPrivate; |
64 | | }; |
65 | | |
66 | 0 | Q_DECLARE_SHARED(QStaticText) |
67 | 0 |
|
68 | 0 | QT_END_NAMESPACE |
69 | 0 |
|
70 | | QT_DECL_METATYPE_EXTERN(QStaticText, Q_GUI_EXPORT) Unexecuted instantiation: int qRegisterNormalizedMetaType<QStaticText>(QByteArray const&) Unexecuted instantiation: QMetaTypeId<QStaticText>::qt_metatype_id() |
71 | | |
72 | | #endif // QSTATICTEXT_H |