Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qstatictext.h
Go to the documentation of this file.
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
17
18
20class Q_GUI_EXPORT QStaticText
21{
22public:
25 AggressiveCaching
26 };
27
29 explicit QStaticText(const QString &text);
31 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QStaticText)
32 QStaticText &operator=(const QStaticText &);
34
35 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
59private:
60 void detach();
61
62 QExplicitlySharedDataPointer<QStaticTextPrivate> data;
63 friend class QStaticTextPrivate;
64};
65
66Q_DECLARE_SHARED(QStaticText)
67
69
71
72#endif // QSTATICTEXT_H
\reentrant
Definition qfont.h:22
\inmodule QtCore
Definition qsize.h:208
The QStaticText class enables optimized drawing of text when the text and its layout is updated rarel...
Definition qstatictext.h:21
void swap(QStaticText &other) noexcept
Definition qstatictext.h:35
PerformanceHint
This enum the different performance hints that can be set on the QStaticText.
Definition qstatictext.h:23
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\reentrant
Definition qtextoption.h:18
The QTransform class specifies 2D transformations of a coordinate system.
Definition qtransform.h:20
QString text
Combined button and popup list for selecting options.
TextFormat
constexpr bool operator!=(const timespec &t1, const timespec &t2)
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLenum matrix
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
double qreal
Definition qtypes.h:187
QSharedPointer< T > other(t)
[5]
insertRed setText("insert red text")