Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qtextformat.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QTEXTFORMAT_H
5#define QTEXTFORMAT_H
6
7#include <QtGui/qbrush.h>
8#include <QtGui/qcolor.h>
9#include <QtGui/qfont.h>
10#include <QtGui/qpen.h>
11#include <QtGui/qtextoption.h>
12#include <QtGui/qtguiglobal.h>
13
14#include <QtCore/qlist.h>
15#include <QtCore/qshareddata.h>
16#include <QtCore/qvariant.h>
17
19
20
21class QString;
22class QVariant;
23class QFont;
24
28class QTextCharFormat;
29class QTextListFormat;
34class QTextFormat;
35class QTextObject;
36class QTextCursor;
37class QTextDocument;
38class QTextLength;
39
40#ifndef QT_NO_DEBUG_STREAM
41Q_GUI_EXPORT QDebug operator<<(QDebug, const QTextLength &);
42#endif
43
44class Q_GUI_EXPORT QTextLength
45{
46public:
47 enum Type { VariableLength = 0, FixedLength, PercentageLength };
48
49 inline QTextLength() : lengthType(VariableLength), fixedValueOrPercentage(0) {}
50
51 inline explicit QTextLength(Type type, qreal value);
52
53 inline Type type() const { return lengthType; }
54 inline qreal value(qreal maximumLength) const
55 {
56 switch (lengthType) {
57 case FixedLength: return fixedValueOrPercentage;
58 case VariableLength: return maximumLength;
59 case PercentageLength: return fixedValueOrPercentage * maximumLength / qreal(100);
60 }
61 return -1;
62 }
63
64 inline qreal rawValue() const { return fixedValueOrPercentage; }
65
66 inline bool operator==(const QTextLength &other) const
67 { return lengthType == other.lengthType
68 && qFuzzyCompare(fixedValueOrPercentage, other.fixedValueOrPercentage); }
69 inline bool operator!=(const QTextLength &other) const
70 { return lengthType != other.lengthType
71 || !qFuzzyCompare(fixedValueOrPercentage, other.fixedValueOrPercentage); }
72 operator QVariant() const;
73
74private:
75 Type lengthType;
76 qreal fixedValueOrPercentage;
77 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextLength &);
78 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextLength &);
79};
81
82inline QTextLength::QTextLength(Type atype, qreal avalue)
83 : lengthType(atype), fixedValueOrPercentage(avalue) {}
84
85#ifndef QT_NO_DEBUG_STREAM
86Q_GUI_EXPORT QDebug operator<<(QDebug, const QTextFormat &);
87#endif
88
89class Q_GUI_EXPORT QTextFormat
90{
92public:
94 InvalidFormat = -1,
95 BlockFormat = 1,
96 CharFormat = 2,
97 ListFormat = 3,
98 FrameFormat = 5,
99
100 UserFormat = 100
101 };
102 Q_ENUM(FormatType)
103
104 enum Property {
105 ObjectIndex = 0x0,
106
107 // paragraph and char
108 CssFloat = 0x0800,
109 LayoutDirection = 0x0801,
110
111 OutlinePen = 0x810,
112 BackgroundBrush = 0x820,
113 ForegroundBrush = 0x821,
114 // Internal to qtextlayout.cpp: ObjectSelectionBrush = 0x822
115 BackgroundImageUrl = 0x823,
116
117 // paragraph
118 BlockAlignment = 0x1010,
119 BlockTopMargin = 0x1030,
120 BlockBottomMargin = 0x1031,
121 BlockLeftMargin = 0x1032,
122 BlockRightMargin = 0x1033,
123 TextIndent = 0x1034,
124 TabPositions = 0x1035,
125 BlockIndent = 0x1040,
126 LineHeight = 0x1048,
127 LineHeightType = 0x1049,
128 BlockNonBreakableLines = 0x1050,
129 BlockTrailingHorizontalRulerWidth = 0x1060,
130 HeadingLevel = 0x1070,
131 BlockQuoteLevel = 0x1080,
132 BlockCodeLanguage = 0x1090,
133 BlockCodeFence = 0x1091,
134 BlockMarker = 0x10A0,
135
136 // character properties
137 FirstFontProperty = 0x1FE0,
138 FontCapitalization = FirstFontProperty,
139 FontLetterSpacing = 0x1FE1,
140 FontWordSpacing = 0x1FE2,
141 FontStyleHint = 0x1FE3,
142 FontStyleStrategy = 0x1FE4,
143 FontKerning = 0x1FE5,
144 FontHintingPreference = 0x1FE6,
145 FontFamilies = 0x1FE7,
146 FontStyleName = 0x1FE8,
147 FontLetterSpacingType = 0x1FE9,
148 FontStretch = 0x1FEA,
149#if QT_DEPRECATED_SINCE(6, 0)
150 FontFamily = 0x2000,
151#endif
152 FontPointSize = 0x2001,
153 FontSizeAdjustment = 0x2002,
154 FontSizeIncrement = FontSizeAdjustment, // old name, compat
155 FontWeight = 0x2003,
156 FontItalic = 0x2004,
157 FontUnderline = 0x2005, // deprecated, use TextUnderlineStyle instead
158 FontOverline = 0x2006,
159 FontStrikeOut = 0x2007,
160 FontFixedPitch = 0x2008,
161 FontPixelSize = 0x2009,
162 LastFontProperty = FontPixelSize,
163
164 TextUnderlineColor = 0x2020,
165 TextVerticalAlignment = 0x2021,
166 TextOutline = 0x2022,
167 TextUnderlineStyle = 0x2023,
168 TextToolTip = 0x2024,
169 TextSuperScriptBaseline = 0x2025,
170 TextSubScriptBaseline = 0x2026,
171 TextBaselineOffset = 0x2027,
172
173 IsAnchor = 0x2030,
174 AnchorHref = 0x2031,
175 AnchorName = 0x2032,
176
177 // Included for backwards compatibility with old QDataStreams.
178 // Should not be referenced in user code.
179 OldFontLetterSpacingType = 0x2033,
180 OldFontStretch = 0x2034,
181 OldTextUnderlineColor = 0x2010,
182 OldFontFamily = 0x2000, // same as FontFamily
183
184 ObjectType = 0x2f00,
185
186 // list properties
187 ListStyle = 0x3000,
188 ListIndent = 0x3001,
189 ListNumberPrefix = 0x3002,
190 ListNumberSuffix = 0x3003,
191 ListStart = 0x3004,
192
193 // table and frame properties
194 FrameBorder = 0x4000,
195 FrameMargin = 0x4001,
196 FramePadding = 0x4002,
197 FrameWidth = 0x4003,
198 FrameHeight = 0x4004,
199 FrameTopMargin = 0x4005,
200 FrameBottomMargin = 0x4006,
201 FrameLeftMargin = 0x4007,
202 FrameRightMargin = 0x4008,
203 FrameBorderBrush = 0x4009,
204 FrameBorderStyle = 0x4010,
205
206 TableColumns = 0x4100,
207 TableColumnWidthConstraints = 0x4101,
208 TableCellSpacing = 0x4102,
209 TableCellPadding = 0x4103,
210 TableHeaderRowCount = 0x4104,
211 TableBorderCollapse = 0x4105,
212
213 // table cell properties
214 TableCellRowSpan = 0x4810,
215 TableCellColumnSpan = 0x4811,
216
217 TableCellTopPadding = 0x4812,
218 TableCellBottomPadding = 0x4813,
219 TableCellLeftPadding = 0x4814,
220 TableCellRightPadding = 0x4815,
221
222 TableCellTopBorder = 0x4816,
223 TableCellBottomBorder = 0x4817,
224 TableCellLeftBorder = 0x4818,
225 TableCellRightBorder = 0x4819,
226
227 TableCellTopBorderStyle = 0x481a,
228 TableCellBottomBorderStyle = 0x481b,
229 TableCellLeftBorderStyle = 0x481c,
230 TableCellRightBorderStyle = 0x481d,
231
232 TableCellTopBorderBrush = 0x481e,
233 TableCellBottomBorderBrush = 0x481f,
234 TableCellLeftBorderBrush = 0x4820,
235 TableCellRightBorderBrush = 0x4821,
236
237 // image properties
238 ImageName = 0x5000,
239 ImageTitle = 0x5001,
240 ImageAltText = 0x5002,
241 ImageWidth = 0x5010,
242 ImageHeight = 0x5011,
243 ImageQuality = 0x5014,
244
245 // internal
246 /*
247 SuppressText = 0x5012,
248 SuppressBackground = 0x513
249 */
250
251 // selection properties
252 FullWidthSelection = 0x06000,
253
254 // page break properties
255 PageBreakPolicy = 0x7000,
256
257 // --
258 UserProperty = 0x100000
259 };
260 Q_ENUM(Property)
261
267
268 UserObject = 0x1000
269 };
270 Q_ENUM(ObjectTypes)
271
273 PageBreak_Auto = 0,
274 PageBreak_AlwaysBefore = 0x001,
275 PageBreak_AlwaysAfter = 0x010
276 // PageBreak_AlwaysInside = 0x100
277 };
278 Q_DECLARE_FLAGS(PageBreakFlags, PageBreakFlag)
279
280 QTextFormat();
281
282 explicit QTextFormat(int type);
283
284 QTextFormat(const QTextFormat &rhs);
285 QTextFormat &operator=(const QTextFormat &rhs);
286 ~QTextFormat();
287
289 { d.swap(other.d); std::swap(format_type, other.format_type); }
290
291 void merge(const QTextFormat &other);
292
293 inline bool isValid() const { return type() != InvalidFormat; }
294 inline bool isEmpty() const { return propertyCount() == 0; }
295
296 int type() const;
297
298 int objectIndex() const;
299 void setObjectIndex(int object);
300
301 QVariant property(int propertyId) const;
302 void setProperty(int propertyId, const QVariant &value);
303 void clearProperty(int propertyId);
304 bool hasProperty(int propertyId) const;
305
306 bool boolProperty(int propertyId) const;
307 int intProperty(int propertyId) const;
308 qreal doubleProperty(int propertyId) const;
309 QString stringProperty(int propertyId) const;
310 QColor colorProperty(int propertyId) const;
311 QPen penProperty(int propertyId) const;
312 QBrush brushProperty(int propertyId) const;
313 QTextLength lengthProperty(int propertyId) const;
314 QList<QTextLength> lengthVectorProperty(int propertyId) const;
315
316 void setProperty(int propertyId, const QList<QTextLength> &lengths);
317
319 int propertyCount() const;
320
321 inline void setObjectType(int type);
322 inline int objectType() const
323 { return intProperty(ObjectType); }
324
325 inline bool isCharFormat() const { return type() == CharFormat; }
326 inline bool isBlockFormat() const { return type() == BlockFormat; }
327 inline bool isListFormat() const { return type() == ListFormat; }
328 inline bool isFrameFormat() const { return type() == FrameFormat; }
329 inline bool isImageFormat() const { return type() == CharFormat && objectType() == ImageObject; }
330 inline bool isTableFormat() const { return type() == FrameFormat && objectType() == TableObject; }
331 inline bool isTableCellFormat() const { return type() == CharFormat && objectType() == TableCellObject; }
332
333 QTextBlockFormat toBlockFormat() const;
334 QTextCharFormat toCharFormat() const;
335 QTextListFormat toListFormat() const;
336 QTextTableFormat toTableFormat() const;
337 QTextFrameFormat toFrameFormat() const;
338 QTextImageFormat toImageFormat() const;
339 QTextTableCellFormat toTableCellFormat() const;
340
341 bool operator==(const QTextFormat &rhs) const;
342 inline bool operator!=(const QTextFormat &rhs) const { return !operator==(rhs); }
343 operator QVariant() const;
344
348 { return Qt::LayoutDirection(intProperty(QTextFormat::LayoutDirection)); }
349
350 inline void setBackground(const QBrush &brush)
351 { setProperty(BackgroundBrush, brush); }
352 inline QBrush background() const
353 { return brushProperty(BackgroundBrush); }
354 inline void clearBackground()
355 { clearProperty(BackgroundBrush); }
356
357 inline void setForeground(const QBrush &brush)
358 { setProperty(ForegroundBrush, brush); }
359 inline QBrush foreground() const
360 { return brushProperty(ForegroundBrush); }
361 inline void clearForeground()
362 { clearProperty(ForegroundBrush); }
363
364private:
366 qint32 format_type;
367
369 friend class QTextCharFormat;
370 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextFormat &);
371 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextFormat &);
372};
373
374Q_DECLARE_SHARED(QTextFormat)
375
376inline void QTextFormat::setObjectType(int atype)
377{ setProperty(ObjectType, atype); }
378
379Q_DECLARE_OPERATORS_FOR_FLAGS(QTextFormat::PageBreakFlags)
380
381class Q_GUI_EXPORT QTextCharFormat : public QTextFormat
382{
383public:
392 };
393 enum UnderlineStyle { // keep in sync with Qt::PenStyle!
402 };
403
405
406 bool isValid() const { return isCharFormat(); }
407
411 };
413 QFont font() const;
414
415#if QT_DEPRECATED_SINCE(6, 1)
416 QT_DEPRECATED_VERSION_X_6_1("Use setFontFamilies instead") inline void setFontFamily(const QString &family)
418 QT_DEPRECATED_VERSION_X_6_1("Use fontFamilies instead") inline QString fontFamily() const
419 { return property(FontFamilies).toStringList().first(); }
420#endif
421
422 inline void setFontFamilies(const QStringList &families)
423 { setProperty(FontFamilies, QVariant(families)); }
424#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
425 inline QVariant fontFamilies() const
426 { return property(FontFamilies); }
427#else
429 { return property(FontFamilies).toStringList(); }
430#endif
431
432 inline void setFontStyleName(const QString &styleName)
433 { setProperty(FontStyleName, styleName); }
434#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
435 inline QVariant fontStyleName() const
436 { return property(FontStyleName); }
437#else
439 { return property(FontStyleName).toStringList(); }
440#endif
441
444 inline qreal fontPointSize() const
445 { return doubleProperty(FontPointSize); }
446
447 inline void setFontWeight(int weight)
449 inline int fontWeight() const
451 inline void setFontItalic(bool italic)
452 { setProperty(FontItalic, italic); }
453 inline bool fontItalic() const
454 { return boolProperty(FontItalic); }
456 { setProperty(FontCapitalization, capitalization); }
458 { return static_cast<QFont::Capitalization>(intProperty(FontCapitalization)); }
459 inline void setFontLetterSpacingType(QFont::SpacingType letterSpacingType)
460 { setProperty(FontLetterSpacingType, letterSpacingType); }
462 { return static_cast<QFont::SpacingType>(intProperty(FontLetterSpacingType)); }
469 inline qreal fontWordSpacing() const
471
472 inline void setFontUnderline(bool underline)
474 bool fontUnderline() const;
475
476 inline void setFontOverline(bool overline)
477 { setProperty(FontOverline, overline); }
478 inline bool fontOverline() const
479 { return boolProperty(FontOverline); }
480
481 inline void setFontStrikeOut(bool strikeOut)
482 { setProperty(FontStrikeOut, strikeOut); }
483 inline bool fontStrikeOut() const
484 { return boolProperty(FontStrikeOut); }
485
486 inline void setUnderlineColor(const QColor &color)
488 inline QColor underlineColor() const
490
491 inline void setFontFixedPitch(bool fixedPitch)
492 { setProperty(FontFixedPitch, fixedPitch); }
493 inline bool fontFixedPitch() const
494 { return boolProperty(FontFixedPitch); }
495
496 inline void setFontStretch(int factor)
497 { setProperty(FontStretch, factor); }
498 inline int fontStretch() const
499 { return intProperty(FontStretch); }
500
504 { setProperty(FontStyleStrategy, strategy); }
506 { return static_cast<QFont::StyleHint>(intProperty(FontStyleHint)); }
508 { return static_cast<QFont::StyleStrategy>(intProperty(FontStyleStrategy)); }
509
511 {
512 setProperty(FontHintingPreference, hintingPreference);
513 }
514
516 {
518 }
519
520 inline void setFontKerning(bool enable)
522 inline bool fontKerning() const
523 { return boolProperty(FontKerning); }
524
527 { return static_cast<UnderlineStyle>(intProperty(TextUnderlineStyle)); }
528
532 { return static_cast<VerticalAlignment>(intProperty(TextVerticalAlignment)); }
533
534 inline void setTextOutline(const QPen &pen)
535 { setProperty(TextOutline, pen); }
536 inline QPen textOutline() const
537 { return penProperty(TextOutline); }
538
539 inline void setToolTip(const QString &tip)
540 { setProperty(TextToolTip, tip); }
541 inline QString toolTip() const
542 { return stringProperty(TextToolTip); }
543
544 inline void setSuperScriptBaseline(qreal baseline)
548
549 inline void setSubScriptBaseline(qreal baseline)
550 { setProperty(TextSubScriptBaseline, baseline); }
553
554 inline void setBaselineOffset(qreal baseline)
555 { setProperty(TextBaselineOffset, baseline); }
556 inline qreal baselineOffset() const
558
559 inline void setAnchor(bool anchor)
560 { setProperty(IsAnchor, anchor); }
561 inline bool isAnchor() const
562 { return boolProperty(IsAnchor); }
563
564 inline void setAnchorHref(const QString &value)
566 inline QString anchorHref() const
567 { return stringProperty(AnchorHref); }
568
569 inline void setAnchorNames(const QStringList &names)
571 QStringList anchorNames() const;
572
573 inline void setTableCellRowSpan(int tableCellRowSpan);
574 inline int tableCellRowSpan() const
575 { int s = intProperty(TableCellRowSpan); if (s == 0) s = 1; return s; }
577 inline int tableCellColumnSpan() const
578 { int s = intProperty(TableCellColumnSpan); if (s == 0) s = 1; return s; }
579
580protected:
581 explicit QTextCharFormat(const QTextFormat &fmt);
582 friend class QTextFormat;
583 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextCharFormat &);
584 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextCharFormat &);
585};
586
587Q_DECLARE_SHARED(QTextCharFormat)
588
589inline void QTextCharFormat::setTableCellRowSpan(int _tableCellRowSpan)
590{
591 if (_tableCellRowSpan <= 1)
592 clearProperty(TableCellRowSpan); // the getter will return 1 here.
593 else
594 setProperty(TableCellRowSpan, _tableCellRowSpan);
595}
596
597inline void QTextCharFormat::setTableCellColumnSpan(int _tableCellColumnSpan)
598{
599 if (_tableCellColumnSpan <= 1)
600 clearProperty(TableCellColumnSpan); // the getter will return 1 here.
601 else
602 setProperty(TableCellColumnSpan, _tableCellColumnSpan);
603}
604
605class Q_GUI_EXPORT QTextBlockFormat : public QTextFormat
606{
607public:
609 SingleHeight = 0,
610 ProportionalHeight = 1,
611 FixedHeight = 2,
612 MinimumHeight = 3,
613 LineDistanceHeight = 4
614 };
615
616 enum class MarkerType {
617 NoMarker = 0,
618 Unchecked = 1,
619 Checked = 2
620 };
621
623
624 bool isValid() const { return isBlockFormat(); }
625
626 inline void setAlignment(Qt::Alignment alignment);
627 inline Qt::Alignment alignment() const
628 { int a = intProperty(BlockAlignment); if (a == 0) a = Qt::AlignLeft; return QFlag(a); }
629
630 inline void setTopMargin(qreal margin)
631 { setProperty(BlockTopMargin, margin); }
632 inline qreal topMargin() const
633 { return doubleProperty(BlockTopMargin); }
634
635 inline void setBottomMargin(qreal margin)
636 { setProperty(BlockBottomMargin, margin); }
637 inline qreal bottomMargin() const
638 { return doubleProperty(BlockBottomMargin); }
639
640 inline void setLeftMargin(qreal margin)
641 { setProperty(BlockLeftMargin, margin); }
642 inline qreal leftMargin() const
643 { return doubleProperty(BlockLeftMargin); }
644
645 inline void setRightMargin(qreal margin)
646 { setProperty(BlockRightMargin, margin); }
647 inline qreal rightMargin() const
648 { return doubleProperty(BlockRightMargin); }
649
650 inline void setTextIndent(qreal aindent)
651 { setProperty(TextIndent, aindent); }
652 inline qreal textIndent() const
653 { return doubleProperty(TextIndent); }
654
655 inline void setIndent(int indent);
656 inline int indent() const
657 { return intProperty(BlockIndent); }
658
659 inline void setHeadingLevel(int alevel)
660 { setProperty(HeadingLevel, alevel); }
661 inline int headingLevel() const
662 { return intProperty(HeadingLevel); }
663
664 inline void setLineHeight(qreal height, int heightType)
665 { setProperty(LineHeight, height); setProperty(LineHeightType, heightType); }
666 inline qreal lineHeight(qreal scriptLineHeight, qreal scaling) const;
667 inline qreal lineHeight() const
668 { return doubleProperty(LineHeight); }
669 inline int lineHeightType() const
670 { return intProperty(LineHeightType); }
671
672 inline void setNonBreakableLines(bool b)
673 { setProperty(BlockNonBreakableLines, b); }
674 inline bool nonBreakableLines() const
675 { return boolProperty(BlockNonBreakableLines); }
676
677 inline void setPageBreakPolicy(PageBreakFlags flags)
678 { setProperty(PageBreakPolicy, int(flags.toInt())); }
679 inline PageBreakFlags pageBreakPolicy() const
680 { return PageBreakFlags(intProperty(PageBreakPolicy)); }
681
682 void setTabPositions(const QList<QTextOption::Tab> &tabs);
683 QList<QTextOption::Tab> tabPositions() const;
684
686 { setProperty(BlockMarker, int(marker)); }
687 inline MarkerType marker() const
688 { return MarkerType(intProperty(BlockMarker)); }
689
690protected:
691 explicit QTextBlockFormat(const QTextFormat &fmt);
692 friend class QTextFormat;
693 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextBlockFormat &);
694 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextBlockFormat &);
695};
696
697Q_DECLARE_SHARED(QTextBlockFormat)
698
699inline void QTextBlockFormat::setAlignment(Qt::Alignment aalignment)
700{ setProperty(BlockAlignment, int(aalignment.toInt())); }
701
702inline void QTextBlockFormat::setIndent(int aindent)
703{ setProperty(BlockIndent, aindent); }
704
705inline qreal QTextBlockFormat::lineHeight(qreal scriptLineHeight, qreal scaling = 1.0) const
706{
707 switch(intProperty(LineHeightType)) {
708 case SingleHeight:
709 return(scriptLineHeight);
711 return(scriptLineHeight * doubleProperty(LineHeight) / 100.0);
712 case FixedHeight:
713 return(doubleProperty(LineHeight) * scaling);
714 case MinimumHeight:
715 return(qMax(scriptLineHeight, doubleProperty(LineHeight) * scaling));
717 return(scriptLineHeight + doubleProperty(LineHeight) * scaling);
718 }
719 return(0);
720}
721
722class Q_GUI_EXPORT QTextListFormat : public QTextFormat
723{
724public:
726
727 bool isValid() const { return isListFormat(); }
728
729 enum Style {
730 ListDisc = -1,
731 ListCircle = -2,
732 ListSquare = -3,
733 ListDecimal = -4,
734 ListLowerAlpha = -5,
735 ListUpperAlpha = -6,
736 ListLowerRoman = -7,
737 ListUpperRoman = -8,
738 ListStyleUndefined = 0
739 };
740
741 inline void setStyle(Style style);
742 inline Style style() const
743 { return static_cast<Style>(intProperty(ListStyle)); }
744
745 inline void setIndent(int indent);
746 inline int indent() const
747 { return intProperty(ListIndent); }
748
749 inline void setNumberPrefix(const QString &numberPrefix);
750 inline QString numberPrefix() const
751 { return stringProperty(ListNumberPrefix); }
752
753 inline void setNumberSuffix(const QString &numberSuffix);
754 inline QString numberSuffix() const
755 { return stringProperty(ListNumberSuffix); }
756
757 inline void setStart(int indent);
758 inline int start() const { return intProperty(ListStart); }
759
760protected:
761 explicit QTextListFormat(const QTextFormat &fmt);
762 friend class QTextFormat;
763};
764
765Q_DECLARE_SHARED(QTextListFormat)
766
767inline void QTextListFormat::setStyle(Style astyle)
768{ setProperty(ListStyle, astyle); }
769
770inline void QTextListFormat::setIndent(int aindent)
771{ setProperty(ListIndent, aindent); }
772
775
778
779inline void QTextListFormat::setStart(int astart)
780{
781 setProperty(ListStart, astart);
782}
783
784class Q_GUI_EXPORT QTextImageFormat : public QTextCharFormat
785{
786public:
788
789 bool isValid() const { return isImageFormat(); }
790
791 inline void setName(const QString &name);
792 inline QString name() const
793 { return stringProperty(ImageName); }
794
795 inline void setWidth(qreal width);
796 inline qreal width() const
797 { return doubleProperty(ImageWidth); }
798
799 inline void setHeight(qreal height);
800 inline qreal height() const
801 { return doubleProperty(ImageHeight); }
802
803 inline void setQuality(int quality);
804#if QT_DEPRECATED_SINCE(6, 3)
805 QT_DEPRECATED_VERSION_X_6_3("Pass a quality value, the default is 100") inline void setQuality()
806 { setQuality(100); }
807#endif
808 inline int quality() const
809 { return intProperty(ImageQuality); }
810
811protected:
812 explicit QTextImageFormat(const QTextFormat &format);
813 friend class QTextFormat;
814 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextListFormat &);
815 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextListFormat &);
816};
817
818Q_DECLARE_SHARED(QTextImageFormat)
819
820inline void QTextImageFormat::setName(const QString &aname)
821{ setProperty(ImageName, aname); }
822
824{ setProperty(ImageWidth, awidth); }
825
827{ setProperty(ImageHeight, aheight); }
828
829inline void QTextImageFormat::setQuality(int aquality)
830{ setProperty(ImageQuality, aquality); }
831
832class Q_GUI_EXPORT QTextFrameFormat : public QTextFormat
833{
834public:
836
837 bool isValid() const { return isFrameFormat(); }
838
839 enum Position {
842 FloatRight
843 // ######
844// Absolute
845 };
846
858 BorderStyle_Outset
859 };
860
861 inline void setPosition(Position f)
862 { setProperty(CssFloat, f); }
863 inline Position position() const
864 { return static_cast<Position>(intProperty(CssFloat)); }
865
866 inline void setBorder(qreal border);
867 inline qreal border() const
868 { return doubleProperty(FrameBorder); }
869
870 inline void setBorderBrush(const QBrush &brush)
871 { setProperty(FrameBorderBrush, brush); }
872 inline QBrush borderBrush() const
873 { return brushProperty(FrameBorderBrush); }
874
875 inline void setBorderStyle(BorderStyle style)
876 { setProperty(FrameBorderStyle, style); }
878 { return static_cast<BorderStyle>(intProperty(FrameBorderStyle)); }
879
880 void setMargin(qreal margin);
881 inline qreal margin() const
882 { return doubleProperty(FrameMargin); }
883
884 inline void setTopMargin(qreal margin);
885 qreal topMargin() const;
886
887 inline void setBottomMargin(qreal margin);
888 qreal bottomMargin() const;
889
890 inline void setLeftMargin(qreal margin);
891 qreal leftMargin() const;
892
893 inline void setRightMargin(qreal margin);
894 qreal rightMargin() const;
895
896 inline void setPadding(qreal padding);
897 inline qreal padding() const
898 { return doubleProperty(FramePadding); }
899
900 inline void setWidth(qreal width);
901 inline void setWidth(const QTextLength &length)
902 { setProperty(FrameWidth, length); }
903 inline QTextLength width() const
904 { return lengthProperty(FrameWidth); }
905
906 inline void setHeight(qreal height);
907 inline void setHeight(const QTextLength &height);
908 inline QTextLength height() const
909 { return lengthProperty(FrameHeight); }
910
911 inline void setPageBreakPolicy(PageBreakFlags flags)
912 { setProperty(PageBreakPolicy, int(flags.toInt())); }
913 inline PageBreakFlags pageBreakPolicy() const
914 { return PageBreakFlags(intProperty(PageBreakPolicy)); }
915
916protected:
917 explicit QTextFrameFormat(const QTextFormat &fmt);
918 friend class QTextFormat;
919 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextFrameFormat &);
920 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextFrameFormat &);
921};
922
923Q_DECLARE_SHARED(QTextFrameFormat)
924
925inline void QTextFrameFormat::setBorder(qreal aborder)
926{ setProperty(FrameBorder, aborder); }
927
929{ setProperty(FramePadding, apadding); }
930
933
936inline void QTextFrameFormat::setHeight(const QTextLength &aheight)
937{ setProperty(FrameHeight, aheight); }
938
940{ setProperty(FrameTopMargin, amargin); }
941
943{ setProperty(FrameBottomMargin, amargin); }
944
946{ setProperty(FrameLeftMargin, amargin); }
947
949{ setProperty(FrameRightMargin, amargin); }
950
951class Q_GUI_EXPORT QTextTableFormat : public QTextFrameFormat
952{
953public:
955
956 inline bool isValid() const { return isTableFormat(); }
957
958 inline int columns() const
959 { int cols = intProperty(TableColumns); if (cols == 0) cols = 1; return cols; }
960 inline void setColumns(int columns);
961
962 inline void setColumnWidthConstraints(const QList<QTextLength> &constraints)
963 { setProperty(TableColumnWidthConstraints, constraints); }
964
966 { return lengthVectorProperty(TableColumnWidthConstraints); }
967
969 { clearProperty(TableColumnWidthConstraints); }
970
971 inline qreal cellSpacing() const
972 { return doubleProperty(TableCellSpacing); }
974 { setProperty(TableCellSpacing, spacing); }
975
976 inline qreal cellPadding() const
977 { return doubleProperty(TableCellPadding); }
978 inline void setCellPadding(qreal padding);
979
980 inline void setAlignment(Qt::Alignment alignment);
981 inline Qt::Alignment alignment() const
982 { return QFlag(intProperty(BlockAlignment)); }
983
984 inline void setHeaderRowCount(int count)
985 { setProperty(TableHeaderRowCount, count); }
986 inline int headerRowCount() const
987 { return intProperty(TableHeaderRowCount); }
988
989 inline void setBorderCollapse(bool borderCollapse)
990 { setProperty(TableBorderCollapse, borderCollapse); }
991 inline bool borderCollapse() const
992 { return boolProperty(TableBorderCollapse); }
993
994protected:
995 explicit QTextTableFormat(const QTextFormat &fmt);
996 friend class QTextFormat;
997};
998
999Q_DECLARE_SHARED(QTextTableFormat)
1000
1001inline void QTextTableFormat::setColumns(int acolumns)
1002{
1003 if (acolumns == 1)
1004 acolumns = 0;
1005 setProperty(TableColumns, acolumns);
1006}
1007
1009{ setProperty(TableCellPadding, apadding); }
1010
1011inline void QTextTableFormat::setAlignment(Qt::Alignment aalignment)
1012{ setProperty(BlockAlignment, int(aalignment.toInt())); }
1013
1014class Q_GUI_EXPORT QTextTableCellFormat : public QTextCharFormat
1015{
1016public:
1018
1019 inline bool isValid() const { return isTableCellFormat(); }
1020
1021 inline void setTopPadding(qreal padding);
1022 inline qreal topPadding() const;
1023
1024 inline void setBottomPadding(qreal padding);
1025 inline qreal bottomPadding() const;
1026
1027 inline void setLeftPadding(qreal padding);
1028 inline qreal leftPadding() const;
1029
1030 inline void setRightPadding(qreal padding);
1031 inline qreal rightPadding() const;
1032
1033 inline void setPadding(qreal padding);
1034
1036 { setProperty(TableCellTopBorder, width); }
1037 inline qreal topBorder() const
1038 { return doubleProperty(TableCellTopBorder); }
1039
1041 { setProperty(TableCellBottomBorder, width); }
1042 inline qreal bottomBorder() const
1043 { return doubleProperty(TableCellBottomBorder); }
1044
1046 { setProperty(TableCellLeftBorder, width); }
1047 inline qreal leftBorder() const
1048 { return doubleProperty(TableCellLeftBorder); }
1049
1051 { setProperty(TableCellRightBorder, width); }
1052 inline qreal rightBorder() const
1053 { return doubleProperty(TableCellRightBorder); }
1054
1055 inline void setBorder(qreal width);
1056
1058 { setProperty(TableCellTopBorderStyle, style); }
1060 { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellTopBorderStyle)); }
1061
1063 { setProperty(TableCellBottomBorderStyle, style); }
1065 { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellBottomBorderStyle)); }
1066
1068 { setProperty(TableCellLeftBorderStyle, style); }
1070 { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellLeftBorderStyle)); }
1071
1073 { setProperty(TableCellRightBorderStyle, style); }
1075 { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellRightBorderStyle)); }
1076
1077 inline void setBorderStyle(QTextFrameFormat::BorderStyle style);
1078
1079 inline void setTopBorderBrush(const QBrush &brush)
1080 { setProperty(TableCellTopBorderBrush, brush); }
1081 inline QBrush topBorderBrush() const
1082 { return brushProperty(TableCellTopBorderBrush); }
1083
1085 { setProperty(TableCellBottomBorderBrush, brush); }
1087 { return brushProperty(TableCellBottomBorderBrush); }
1088
1089 inline void setLeftBorderBrush(const QBrush &brush)
1090 { setProperty(TableCellLeftBorderBrush, brush); }
1092 { return brushProperty(TableCellLeftBorderBrush); }
1093
1095 { setProperty(TableCellRightBorderBrush, brush); }
1097 { return brushProperty(TableCellRightBorderBrush); }
1098
1099 inline void setBorderBrush(const QBrush &brush);
1100
1101protected:
1102 explicit QTextTableCellFormat(const QTextFormat &fmt);
1103 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextTableCellFormat &);
1104 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextTableCellFormat &);
1105 friend class QTextFormat;
1106};
1107
1108Q_DECLARE_SHARED(QTextTableCellFormat)
1109
1110inline void QTextTableCellFormat::setTopPadding(qreal padding)
1111{
1113}
1114
1116{
1118}
1119
1121{
1123}
1124
1126{
1128}
1129
1131{
1133}
1134
1136{
1138}
1139
1141{
1143}
1144
1146{
1148}
1149
1151{
1152 setTopPadding(padding);
1153 setBottomPadding(padding);
1154 setLeftPadding(padding);
1155 setRightPadding(padding);
1156}
1157
1159{
1164}
1165
1167{
1168 setTopBorderStyle(style);
1169 setBottomBorderStyle(style);
1170 setLeftBorderStyle(style);
1171 setRightBorderStyle(style);
1172}
1173
1175{
1180}
1181
1183
1184#endif // QTEXTFORMAT_H
\inmodule QtGui
Definition qbrush.h:30
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore\reentrant
Definition qdatastream.h:30
\inmodule QtCore
Definition qflags.h:17
\reentrant
Definition qfont.h:20
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
Definition qfont.h:23
Capitalization
Definition qfont.h:94
SpacingType
Definition qfont.h:103
HintingPreference
Definition qfont.h:52
StyleStrategy
The style strategy tells the \l{QFont}{font matching} algorithm what type of fonts should be used to ...
Definition qfont.h:36
@ PreferDefault
Definition qfont.h:37
@ Normal
Definition qfont.h:64
Definition qlist.h:74
Definition qmap.h:186
\inmodule QtGui
Definition qpen.h:25
\inmodule QtCore
Definition qshareddata.h:35
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
qreal bottomMargin() const
Returns the paragraph's bottom margin.
qreal topMargin() const
Returns the paragraph's top margin.
void setLeftMargin(qreal margin)
Sets the paragraph's left margin.
Qt::Alignment alignment() const
Returns the paragraph's alignment.
int headingLevel() const
MarkerType marker() const
void setPageBreakPolicy(PageBreakFlags flags)
void setMarker(MarkerType marker)
void setBottomMargin(qreal margin)
Sets the paragraph's bottom margin.
bool isValid() const
Returns true if this block format is valid; otherwise returns false.
void setLineHeight(qreal height, int heightType)
qreal lineHeight() const
PageBreakFlags pageBreakPolicy() const
void setNonBreakableLines(bool b)
If b is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable.
void setRightMargin(qreal margin)
Sets the paragraph's right margin.
void setIndent(int indent)
Sets the paragraph's indentation.
bool nonBreakableLines() const
Returns true if the lines in the paragraph are non-breakable; otherwise returns false.
int indent() const
Returns the paragraph's indent.
qreal leftMargin() const
Returns the paragraph's left margin.
qreal textIndent() const
Returns the paragraph's text indent.
void setHeadingLevel(int alevel)
qreal rightMargin() const
Returns the paragraph's right margin.
void setTopMargin(qreal margin)
Sets the paragraph's top margin.
int lineHeightType() const
void setTextIndent(qreal aindent)
Sets the indent for the first line in the block.
qreal fontLetterSpacing() const
VerticalAlignment
This enum describes the ways that adjacent characters can be vertically aligned.
bool fontFixedPitch() const
Returns true if the text format's font is fixed pitch; otherwise returns false.
bool isAnchor() const
Returns true if the text is formatted as an anchor; otherwise returns false.
void setSubScriptBaseline(qreal baseline)
QStringList anchorNames() const
int tableCellColumnSpan() const
int fontWeight() const
Returns the text format's font weight.
void setFontFamilies(const QStringList &families)
void setUnderlineStyle(UnderlineStyle style)
void setTextOutline(const QPen &pen)
Sets the pen used to draw the outlines of characters to the given pen.
qreal fontPointSize() const
Returns the font size used to display text in this format.
UnderlineStyle underlineStyle() const
QFont::StyleHint fontStyleHint() const
void setFontWordSpacing(qreal spacing)
bool fontStrikeOut() const
Returns true if the text format's font is struck out (has a horizontal line drawn through it); otherw...
QTextCharFormat()
Constructs a new character format object.
void setVerticalAlignment(VerticalAlignment alignment)
Sets the vertical alignment used for the characters with this format to the alignment specified.
void setSuperScriptBaseline(qreal baseline)
qreal fontWordSpacing() const
bool isValid() const
Returns true if this character format is valid; otherwise returns false.
QFont::Capitalization fontCapitalization() const
void setFontPointSize(qreal size)
Sets the text format's font size.
QFont::StyleStrategy fontStyleStrategy() const
QStringList fontFamilies() const
void setAnchor(bool anchor)
If anchor is true, text with this format represents an anchor, and is formatted in the appropriate wa...
void setFontUnderline(bool underline)
If underline is true, sets the text format's font to be underlined; otherwise it is displayed non-und...
void setAnchorNames(const QStringList &names)
QString anchorHref() const
Returns the text format's hypertext link, or an empty string if none has been set.
UnderlineStyle
This enum describes the different ways drawing underlined text.
qreal baselineOffset() const
int fontStretch() const
bool fontOverline() const
Returns true if the text format's font is overlined; otherwise returns false.
QColor underlineColor() const
Returns the color used to draw underlines, overlines and strikeouts on the characters with this forma...
VerticalAlignment verticalAlignment() const
Returns the vertical alignment used for characters with this format.
void setToolTip(const QString &tip)
void setFontKerning(bool enable)
void setTableCellColumnSpan(int tableCellColumnSpan)
QString toolTip() const
void setUnderlineColor(const QColor &color)
Sets the color used to draw underlines, overlines and strikeouts on the characters with this format t...
QFont::SpacingType fontLetterSpacingType() const
void setFontStyleHint(QFont::StyleHint hint, QFont::StyleStrategy strategy=QFont::PreferDefault)
void setFontFixedPitch(bool fixedPitch)
If fixedPitch is true, sets the text format's font to be fixed pitch; otherwise a non-fixed pitch fon...
int tableCellRowSpan() const
void setFontLetterSpacing(qreal spacing)
qreal subScriptBaseline() const
void setFontStyleStrategy(QFont::StyleStrategy strategy)
void setBaselineOffset(qreal baseline)
qreal superScriptBaseline() const
bool fontKerning() const
void setFontStrikeOut(bool strikeOut)
If strikeOut is true, sets the text format's font with strike-out enabled (with a horizontal line thr...
bool fontItalic() const
Returns true if the text format's font is italic; otherwise returns false.
void setFontHintingPreference(QFont::HintingPreference hintingPreference)
void setFontStretch(int factor)
bool fontUnderline() const
Returns true if the text format's font is underlined; otherwise returns false.
QStringList fontStyleName() const
void setAnchorHref(const QString &value)
Sets the hypertext link for the text format to the given value.
void setFontOverline(bool overline)
If overline is true, sets the text format's font to be overlined; otherwise the font is displayed non...
QFont::HintingPreference fontHintingPreference() const
QPen textOutline() const
Returns the pen used to draw the outlines of characters in this format.
void setFontLetterSpacingType(QFont::SpacingType letterSpacingType)
void setTableCellRowSpan(int tableCellRowSpan)
void setFontStyleName(const QString &styleName)
void setFontItalic(bool italic)
If italic is true, sets the text format's font to be italic; otherwise the font will be non-italic.
void setFontWeight(int weight)
Sets the text format's font weight to weight.
void setFontCapitalization(QFont::Capitalization capitalization)
void setFont(const QFont &font, FontPropertiesInheritanceBehavior behavior=FontPropertiesAll)
\reentrant \inmodule QtGui
Definition qtextcursor.h:30
\reentrant \inmodule QtGui
\reentrant
Definition qtextformat.h:90
bool isTableCellFormat() const
FormatType
This enum describes the text item a QTextFormat object is formatting.
Definition qtextformat.h:93
bool operator!=(const QTextFormat &rhs) const
Returns true if this text format is different from the other text format.
QBrush background() const
Returns the brush used to paint the document's background.
QString stringProperty(int propertyId) const
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QString ty...
Qt::LayoutDirection layoutDirection() const
Returns the document's layout direction.
bool isCharFormat() const
Returns true if this text format is a CharFormat; otherwise returns false.
void setForeground(const QBrush &brush)
Sets the foreground brush to the specified brush.
ObjectTypes
This enum describes what kind of QTextObject this format is associated with.
Property
This enum describes the different properties a format can have.
@ TextSubScriptBaseline
@ TextSuperScriptBaseline
@ FontLetterSpacingType
@ TableCellBottomPadding
@ TableCellRightPadding
@ TextVerticalAlignment
@ FontHintingPreference
bool isFrameFormat() const
Returns true if this text format is a FrameFormat; otherwise returns false.
int intProperty(int propertyId) const
Returns the value of the property specified by propertyId.
void clearForeground()
Clears the brush used to paint the document's foreground.
QColor colorProperty(int propertyId) const
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QColor typ...
void setBackground(const QBrush &brush)
Sets the brush use to paint the document's background to the brush specified.
bool boolProperty(int propertyId) const
Returns the value of the property specified by propertyId.
void clearBackground()
Clears the brush used to paint the document's background.
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.
bool isEmpty() const
bool isImageFormat() const
Returns true if this text format is an image format; otherwise returns false.
void setLayoutDirection(Qt::LayoutDirection direction)
Sets the document's layout direction to the specified direction.
bool isListFormat() const
Returns true if this text format is a ListFormat; otherwise returns false.
void setObjectType(int type)
Sets the text format's object type to type.
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false.
bool isValid() const
Returns true if the format is valid (i.e.
void swap(QTextFormat &other)
bool isBlockFormat() const
Returns true if this text format is a BlockFormat; otherwise returns false.
QPen penProperty(int propertyId) const
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QPen type,...
int objectType() const
Returns the text format's object type.
bool isTableFormat() const
Returns true if this text format is a TableFormat; otherwise returns false.
void clearProperty(int propertyId)
Clears the value of the property given by propertyId.
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.
QBrush foreground() const
Returns the brush used to render foreground details, such as text, frame outlines,...
Position position() const
Returns the positioning policy for frames with this frame format.
QBrush borderBrush() const
void setTopMargin(qreal margin)
void setWidth(qreal width)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setPosition(Position f)
Sets the policy for positioning frames with this frame format.
void setLeftMargin(qreal margin)
bool isValid() const
Returns true if the format description is valid; otherwise returns false.
void setBorderBrush(const QBrush &brush)
void setBorderStyle(BorderStyle style)
QTextLength width() const
Returns the width of the frame's border rectangle.
void setPadding(qreal padding)
Sets the width of the frame's internal padding in pixels.
void setBottomMargin(qreal margin)
QTextLength height() const
Returns the height of the frame's border rectangle.
qreal border() const
Returns the width of the border in pixels.
void setPageBreakPolicy(PageBreakFlags flags)
BorderStyle borderStyle() const
void setRightMargin(qreal margin)
void setHeight(qreal height)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setWidth(const QTextLength &length)
Sets the frame's border rectangle's width.
Position
This enum describes how a frame is located relative to the surrounding text.
qreal padding() const
Returns the width of the frame's internal padding in pixels.
qreal margin() const
Returns the width of the frame's external margin in pixels.
PageBreakFlags pageBreakPolicy() const
qreal width() const
Returns the width of the rectangle occupied by the image.
int quality() const
bool isValid() const
Returns true if this image format is valid; otherwise returns false.
qreal height() const
Returns the height of the rectangle occupied by the image.
void setHeight(qreal height)
Sets the height of the rectangle occupied by the image.
QString name() const
Returns the name of the image.
void setQuality(int quality)
void setWidth(qreal width)
Sets the width of the rectangle occupied by the image.
\reentrant
Definition qtextformat.h:45
bool operator==(const QTextLength &other) const
Returns true if this text length is the same as the other text length.
Definition qtextformat.h:66
QTextLength()
Constructs a new length object which represents a variable size.
Definition qtextformat.h:49
bool operator!=(const QTextLength &other) const
Returns true if this text length is different from the other text length.
Definition qtextformat.h:69
qreal rawValue() const
Returns the constraint value that is specific for the type of the length.
Definition qtextformat.h:64
qreal value(qreal maximumLength) const
Returns the effective length, constrained by the type of the length object and the specified maximumL...
Definition qtextformat.h:54
Type type() const
Returns the type of this length object.
Definition qtextformat.h:53
QString numberSuffix() const
bool isValid() const
Returns true if this list format is valid; otherwise returns false.
Style
This enum describes the symbols used to decorate list items:
void setIndent(int indent)
Sets the list format's indentation.
Style style() const
Returns the list format's style.
void setNumberSuffix(const QString &numberSuffix)
int start() const
void setNumberPrefix(const QString &numberPrefix)
QString numberPrefix() const
int indent() const
Returns the list format's indentation.
void setStart(int indent)
\reentrant
Definition qtextobject.h:25
void setLeftPadding(qreal padding)
void setBottomBorder(qreal width)
QBrush leftBorderBrush() const
void setPadding(qreal padding)
QTextFrameFormat::BorderStyle bottomBorderStyle() const
void setBottomPadding(qreal padding)
QTextFrameFormat::BorderStyle rightBorderStyle() const
QBrush rightBorderBrush() const
void setRightBorderStyle(QTextFrameFormat::BorderStyle style)
qreal rightBorder() const
qreal leftBorder() const
void setLeftBorder(qreal width)
qreal topPadding() const
void setRightBorderBrush(const QBrush &brush)
void setLeftBorderBrush(const QBrush &brush)
QBrush topBorderBrush() const
qreal bottomBorder() const
qreal leftPadding() const
void setTopPadding(qreal padding)
qreal rightPadding() const
void setBorderStyle(QTextFrameFormat::BorderStyle style)
void setTopBorder(qreal width)
QBrush bottomBorderBrush() const
void setBorder(qreal width)
void setLeftBorderStyle(QTextFrameFormat::BorderStyle style)
void setBottomBorderBrush(const QBrush &brush)
void setBorderBrush(const QBrush &brush)
void setTopBorderBrush(const QBrush &brush)
void setBottomBorderStyle(QTextFrameFormat::BorderStyle style)
QTextFrameFormat::BorderStyle leftBorderStyle() const
qreal bottomPadding() const
QTextFrameFormat::BorderStyle topBorderStyle() const
void setTopBorderStyle(QTextFrameFormat::BorderStyle style)
qreal topBorder() const
void setRightPadding(qreal padding)
void setRightBorder(qreal width)
qreal cellSpacing() const
Returns the table's cell spacing.
void setAlignment(Qt::Alignment alignment)
Sets the table's alignment.
void clearColumnWidthConstraints()
Clears the column width constraints for the table.
QList< QTextLength > columnWidthConstraints() const
Returns a list of constraints used by this table format to control the appearance of columns in a tab...
bool borderCollapse() const
qreal cellPadding() const
Returns the table's cell padding.
bool isValid() const
Returns true if this table format is valid; otherwise returns false.
int headerRowCount() const
Qt::Alignment alignment() const
Returns the table's alignment.
void setBorderCollapse(bool borderCollapse)
void setColumnWidthConstraints(const QList< QTextLength > &constraints)
Sets the column width constraints for the table.
int columns() const
Returns the number of columns specified by the table format.
void setHeaderRowCount(int count)
void setCellSpacing(qreal spacing)
Sets the cell spacing for the table.
void setCellPadding(qreal padding)
Sets the cell padding for the table.
\inmodule QtCore
Definition qvariant.h:64
qreal spacing
object setProperty("down", true)
employee setName("Richard Schmit")
uint alignment
direction
Combined button and popup list for selecting options.
@ AlignLeft
Definition qnamespace.h:143
LayoutDirection
Definition brush.cpp:5
static const QCssKnownValue properties[NumProperties - 1]
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:287
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
GLboolean GLboolean GLboolean b
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint border
GLfloat GLfloat f
GLuint GLuint GLfloat weight
GLsizei GLenum GLenum GLuint GLenum GLsizei * lengths
GLint GLsizei width
GLenum type
GLbitfield flags
GLboolean enable
const GLchar * marker
GLuint name
GLint GLsizei GLsizei GLenum format
GLuint GLuint * names
GLdouble s
[6]
Definition qopenglext.h:235
@ FontWeight
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1219
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define QT_DEPRECATED_VERSION_X_6_3(text)
#define QT_DEPRECATED_VERSION_X_6_1(text)
Q_GUI_EXPORT QDebug operator<<(QDebug, const QTextLength &)
#define Q_ENUM(x)
#define Q_GADGET
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:144
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:163
int qint32
Definition qtypes.h:44
double qreal
Definition qtypes.h:92
QVideoFrameFormat::PixelFormat fmt
const char property[13]
Definition qwizard.cpp:101
label setAlignment(Qt::AlignLeft|Qt::AlignTop)
[0]
QDataStream & operator<<(QDataStream &out, const MyClass &myObj)
[4]
QDataStream & operator>>(QDataStream &in, MyClass &myObj)
QSharedPointer< T > other(t)
[5]
widget setStyle(proxy)
Definition moc.h:24