File indexing completed on 2025-01-18 10:08:16
0001
0002
0003
0004 #ifndef QSTATICTEXT_H
0005 #define QSTATICTEXT_H
0006
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qsize.h>
0009 #include <QtCore/qstring.h>
0010 #include <QtCore/qmetatype.h>
0011
0012 #include <QtGui/qtransform.h>
0013 #include <QtGui/qfont.h>
0014 #include <QtGui/qtextoption.h>
0015
0016 QT_BEGIN_NAMESPACE
0017
0018
0019 class QStaticTextPrivate;
0020 class Q_GUI_EXPORT QStaticText
0021 {
0022 public:
0023 enum PerformanceHint {
0024 ModerateCaching,
0025 AggressiveCaching
0026 };
0027
0028 QStaticText();
0029 explicit QStaticText(const QString &text);
0030 QStaticText(const QStaticText &other);
0031 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QStaticText)
0032 QStaticText &operator=(const QStaticText &);
0033 ~QStaticText();
0034
0035 void swap(QStaticText &other) noexcept { data.swap(other.data); }
0036
0037 void setText(const QString &text);
0038 QString text() const;
0039
0040 void setTextFormat(Qt::TextFormat textFormat);
0041 Qt::TextFormat textFormat() const;
0042
0043 void setTextWidth(qreal textWidth);
0044 qreal textWidth() const;
0045
0046 void setTextOption(const QTextOption &textOption);
0047 QTextOption textOption() const;
0048
0049 QSizeF size() const;
0050
0051 void prepare(const QTransform &matrix = QTransform(), const QFont &font = QFont());
0052
0053 void setPerformanceHint(PerformanceHint performanceHint);
0054 PerformanceHint performanceHint() const;
0055
0056 bool operator==(const QStaticText &) const;
0057 bool operator!=(const QStaticText &) const;
0058
0059 private:
0060 void detach();
0061
0062 QExplicitlySharedDataPointer<QStaticTextPrivate> data;
0063 friend class QStaticTextPrivate;
0064 };
0065
0066 Q_DECLARE_SHARED(QStaticText)
0067
0068 QT_END_NAMESPACE
0069
0070 QT_DECL_METATYPE_EXTERN(QStaticText, Q_GUI_EXPORT)
0071
0072 #endif