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
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 ImageMaxWidth = 0x5015,
245
246 // internal
247 /*
248 SuppressText = 0x5012,
249 SuppressBackground = 0x513
250 */
251
252 // selection properties
253 FullWidthSelection = 0x06000,
254
255 // page break properties
256 PageBreakPolicy = 0x7000,
257
258 // --
259 UserProperty = 0x100000
260 };
261 Q_ENUM(Property)
262
271 Q_ENUM(ObjectTypes)
272
274 PageBreak_Auto = 0,
275 PageBreak_AlwaysBefore = 0x001,
276 PageBreak_AlwaysAfter = 0x010
277 // PageBreak_AlwaysInside = 0x100
278 };
279 Q_DECLARE_FLAGS(PageBreakFlags, PageBreakFlag)
280
281 QTextFormat();
282
283 explicit QTextFormat(int type);
284
285 QTextFormat(const QTextFormat &rhs);
286 QTextFormat &operator=(const QTextFormat &rhs);
287 ~QTextFormat();
288
290 { d.swap(other.d); std::swap(format_type, other.format_type); }
291
292 void merge(const QTextFormat &other);
293
294 inline bool isValid() const { return type() != InvalidFormat; }
295 inline bool isEmpty() const { return propertyCount() == 0; }
296
297 int type() const;
298
299 int objectIndex() const;
300 void setObjectIndex(int object);
301
302 QVariant property(int propertyId) const;
303 void setProperty(int propertyId, const QVariant &value);
304 void clearProperty(int propertyId);
305 bool hasProperty(int propertyId) const;
306
307 bool boolProperty(int propertyId) const;
308 int intProperty(int propertyId) const;
309 qreal doubleProperty(int propertyId) const;
310 QString stringProperty(int propertyId) const;
311 QColor colorProperty(int propertyId) const;
312 QPen penProperty(int propertyId) const;
313 QBrush brushProperty(int propertyId) const;
314 QTextLength lengthProperty(int propertyId) const;
315 QList<QTextLength> lengthVectorProperty(int propertyId) const;
316
317 void setProperty(int propertyId, const QList<QTextLength> &lengths);
318
319 QMap<int, QVariant> properties() const;
320 int propertyCount() const;
321
322 inline void setObjectType(int type);
323 inline int objectType() const
324 { return intProperty(ObjectType); }
325
326 inline bool isCharFormat() const { return type() == CharFormat; }
327 inline bool isBlockFormat() const { return type() == BlockFormat; }
328 inline bool isListFormat() const { return type() == ListFormat; }
329 inline bool isFrameFormat() const { return type() == FrameFormat; }
330 inline bool isImageFormat() const { return type() == CharFormat && objectType() == ImageObject; }
331 inline bool isTableFormat() const { return type() == FrameFormat && objectType() == TableObject; }
332 inline bool isTableCellFormat() const { return type() == CharFormat && objectType() == TableCellObject; }
333
334 QTextBlockFormat toBlockFormat() const;
335 QTextCharFormat toCharFormat() const;
336 QTextListFormat toListFormat() const;
337 QTextTableFormat toTableFormat() const;
338 QTextFrameFormat toFrameFormat() const;
339 QTextImageFormat toImageFormat() const;
340 QTextTableCellFormat toTableCellFormat() const;
341
342 bool operator==(const QTextFormat &rhs) const;
343 inline bool operator!=(const QTextFormat &rhs) const { return !operator==(rhs); }
344 operator QVariant() const;
345
350
351 inline void setBackground(const QBrush &brush)
352 { setProperty(BackgroundBrush, brush); }
353 inline QBrush background() const
354 { return brushProperty(BackgroundBrush); }
355 inline void clearBackground()
356 { clearProperty(BackgroundBrush); }
357
358 inline void setForeground(const QBrush &brush)
359 { setProperty(ForegroundBrush, brush); }
360 inline QBrush foreground() const
361 { return brushProperty(ForegroundBrush); }
362 inline void clearForeground()
363 { clearProperty(ForegroundBrush); }
364
365private:
366 QSharedDataPointer<QTextFormatPrivate> d;
367 qint32 format_type;
368
370 friend class QTextCharFormat;
371 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextFormat &);
372 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextFormat &);
373};
374
375Q_DECLARE_SHARED(QTextFormat)
376
377inline void QTextFormat::setObjectType(int atype)
378{ setProperty(ObjectType, atype); }
379
380Q_DECLARE_OPERATORS_FOR_FLAGS(QTextFormat::PageBreakFlags)
381
382class Q_GUI_EXPORT QTextCharFormat : public QTextFormat
383{
384public:
404
406
407 bool isValid() const { return isCharFormat(); }
408
414 QFont font() const;
415
416#if QT_DEPRECATED_SINCE(6, 1)
417 QT_DEPRECATED_VERSION_X_6_1("Use setFontFamilies instead") inline void setFontFamily(const QString &family)
419 QT_DEPRECATED_VERSION_X_6_1("Use fontFamilies instead") inline QString fontFamily() const
420 { return property(FontFamilies).toStringList().first(); }
421#endif
422
423 inline void setFontFamilies(const QStringList &families)
424 { setProperty(FontFamilies, QVariant(families)); }
425#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
426 inline QVariant fontFamilies() const
427 { return property(FontFamilies); }
428#else
430 { return property(FontFamilies).toStringList(); }
431#endif
432
433 inline void setFontStyleName(const QString &styleName)
434 { setProperty(FontStyleName, styleName); }
435#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
436 inline QVariant fontStyleName() const
437 { return property(FontStyleName); }
438#else
440 { return property(FontStyleName).toStringList(); }
441#endif
442
445 inline qreal fontPointSize() const
446 { return doubleProperty(FontPointSize); }
447
448 inline void setFontWeight(int weight)
450 inline int fontWeight() const
452 inline void setFontItalic(bool italic)
453 { setProperty(FontItalic, italic); }
454 inline bool fontItalic() const
455 { return boolProperty(FontItalic); }
457 { setProperty(FontCapitalization, capitalization); }
460 inline void setFontLetterSpacingType(QFont::SpacingType letterSpacingType)
461 { setProperty(FontLetterSpacingType, letterSpacingType); }
470 inline qreal fontWordSpacing() const
472
473 inline void setFontUnderline(bool underline)
475 bool fontUnderline() const;
476
477 inline void setFontOverline(bool overline)
478 { setProperty(FontOverline, overline); }
479 inline bool fontOverline() const
480 { return boolProperty(FontOverline); }
481
482 inline void setFontStrikeOut(bool strikeOut)
483 { setProperty(FontStrikeOut, strikeOut); }
484 inline bool fontStrikeOut() const
485 { return boolProperty(FontStrikeOut); }
486
489 inline QColor underlineColor() const
491
492 inline void setFontFixedPitch(bool fixedPitch)
493 { setProperty(FontFixedPitch, fixedPitch); }
494 inline bool fontFixedPitch() const
495 { return boolProperty(FontFixedPitch); }
496
497 inline void setFontStretch(int factor)
498 { setProperty(FontStretch, factor); }
499 inline int fontStretch() const
500 { return intProperty(FontStretch); }
501
510
512 {
513 setProperty(FontHintingPreference, hintingPreference);
514 }
515
520
521 inline void setFontKerning(bool enable)
523 inline bool fontKerning() const
524 { return boolProperty(FontKerning); }
525
528 { return static_cast<UnderlineStyle>(intProperty(TextUnderlineStyle)); }
529
534
535 inline void setTextOutline(const QPen &pen)
536 { setProperty(TextOutline, pen); }
537 inline QPen textOutline() const
538 { return penProperty(TextOutline); }
539
540 inline void setToolTip(const QString &tip)
541 { setProperty(TextToolTip, tip); }
542 inline QString toolTip() const
543 { return stringProperty(TextToolTip); }
544
545 inline void setSuperScriptBaseline(qreal baseline)
549
550 inline void setSubScriptBaseline(qreal baseline)
551 { setProperty(TextSubScriptBaseline, baseline); }
554
555 inline void setBaselineOffset(qreal baseline)
556 { setProperty(TextBaselineOffset, baseline); }
559
560 inline void setAnchor(bool anchor)
561 { setProperty(IsAnchor, anchor); }
562 inline bool isAnchor() const
563 { return boolProperty(IsAnchor); }
564
565 inline void setAnchorHref(const QString &value)
567 inline QString anchorHref() const
568 { return stringProperty(AnchorHref); }
569
572 QStringList anchorNames() const;
573
574 inline void setTableCellRowSpan(int tableCellRowSpan);
575 inline int tableCellRowSpan() const
576 { int s = intProperty(TableCellRowSpan); if (s == 0) s = 1; return s; }
578 inline int tableCellColumnSpan() const
579 { int s = intProperty(TableCellColumnSpan); if (s == 0) s = 1; return s; }
580
581protected:
582 explicit QTextCharFormat(const QTextFormat &fmt);
583 friend class QTextFormat;
584 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextCharFormat &);
585 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextCharFormat &);
586};
587
588Q_DECLARE_SHARED(QTextCharFormat)
589
590inline void QTextCharFormat::setTableCellRowSpan(int _tableCellRowSpan)
591{
592 if (_tableCellRowSpan <= 1)
593 clearProperty(TableCellRowSpan); // the getter will return 1 here.
594 else
595 setProperty(TableCellRowSpan, _tableCellRowSpan);
596}
597
598inline void QTextCharFormat::setTableCellColumnSpan(int _tableCellColumnSpan)
599{
600 if (_tableCellColumnSpan <= 1)
601 clearProperty(TableCellColumnSpan); // the getter will return 1 here.
602 else
603 setProperty(TableCellColumnSpan, _tableCellColumnSpan);
604}
605
606class Q_GUI_EXPORT QTextBlockFormat : public QTextFormat
607{
608public:
610 SingleHeight = 0,
611 ProportionalHeight = 1,
612 FixedHeight = 2,
613 MinimumHeight = 3,
614 LineDistanceHeight = 4
615 };
616
617 enum class MarkerType {
618 NoMarker = 0,
619 Unchecked = 1,
620 Checked = 2
621 };
622
624
625 bool isValid() const { return isBlockFormat(); }
626
627 inline void setAlignment(Qt::Alignment alignment);
628 inline Qt::Alignment alignment() const
629 { int a = intProperty(BlockAlignment); if (a == 0) a = Qt::AlignLeft; return QFlag(a); }
630
631 inline void setTopMargin(qreal margin)
632 { setProperty(BlockTopMargin, margin); }
633 inline qreal topMargin() const
634 { return doubleProperty(BlockTopMargin); }
635
636 inline void setBottomMargin(qreal margin)
637 { setProperty(BlockBottomMargin, margin); }
638 inline qreal bottomMargin() const
639 { return doubleProperty(BlockBottomMargin); }
640
641 inline void setLeftMargin(qreal margin)
642 { setProperty(BlockLeftMargin, margin); }
643 inline qreal leftMargin() const
644 { return doubleProperty(BlockLeftMargin); }
645
646 inline void setRightMargin(qreal margin)
647 { setProperty(BlockRightMargin, margin); }
648 inline qreal rightMargin() const
649 { return doubleProperty(BlockRightMargin); }
650
651 inline void setTextIndent(qreal aindent)
652 { setProperty(TextIndent, aindent); }
653 inline qreal textIndent() const
654 { return doubleProperty(TextIndent); }
655
656 inline void setIndent(int indent);
657 inline int indent() const
658 { return intProperty(BlockIndent); }
659
660 inline void setHeadingLevel(int alevel)
661 { setProperty(HeadingLevel, alevel); }
662 inline int headingLevel() const
663 { return intProperty(HeadingLevel); }
664
665 inline void setLineHeight(qreal height, int heightType)
666 { setProperty(LineHeight, height); setProperty(LineHeightType, heightType); }
667 inline qreal lineHeight(qreal scriptLineHeight, qreal scaling) const;
668 inline qreal lineHeight() const
669 { return doubleProperty(LineHeight); }
670 inline int lineHeightType() const
671 { return intProperty(LineHeightType); }
672
673 inline void setNonBreakableLines(bool b)
674 { setProperty(BlockNonBreakableLines, b); }
675 inline bool nonBreakableLines() const
676 { return boolProperty(BlockNonBreakableLines); }
677
678 inline void setPageBreakPolicy(PageBreakFlags flags)
679 { setProperty(PageBreakPolicy, int(flags.toInt())); }
680 inline PageBreakFlags pageBreakPolicy() const
681 { return PageBreakFlags(intProperty(PageBreakPolicy)); }
682
683 void setTabPositions(const QList<QTextOption::Tab> &tabs);
684 QList<QTextOption::Tab> tabPositions() const;
685
687 { setProperty(BlockMarker, int(marker)); }
688 inline MarkerType marker() const
689 { return MarkerType(intProperty(BlockMarker)); }
690
691protected:
692 explicit QTextBlockFormat(const QTextFormat &fmt);
693 friend class QTextFormat;
694 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextBlockFormat &);
695 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextBlockFormat &);
696};
697
698Q_DECLARE_SHARED(QTextBlockFormat)
699
700inline void QTextBlockFormat::setAlignment(Qt::Alignment aalignment)
701{ setProperty(BlockAlignment, int(aalignment.toInt())); }
702
703inline void QTextBlockFormat::setIndent(int aindent)
704{ setProperty(BlockIndent, aindent); }
705
706inline qreal QTextBlockFormat::lineHeight(qreal scriptLineHeight, qreal scaling = 1.0) const
707{
708 switch(intProperty(LineHeightType)) {
709 case SingleHeight:
710 return(scriptLineHeight);
712 return(scriptLineHeight * doubleProperty(LineHeight) / 100.0);
713 case FixedHeight:
714 return(doubleProperty(LineHeight) * scaling);
715 case MinimumHeight:
716 return(qMax(scriptLineHeight, doubleProperty(LineHeight) * scaling));
718 return(scriptLineHeight + doubleProperty(LineHeight) * scaling);
719 }
720 return(0);
721}
722
723class Q_GUI_EXPORT QTextListFormat : public QTextFormat
724{
725public:
727
728 bool isValid() const { return isListFormat(); }
729
730 enum Style {
731 ListDisc = -1,
732 ListCircle = -2,
733 ListSquare = -3,
734 ListDecimal = -4,
735 ListLowerAlpha = -5,
736 ListUpperAlpha = -6,
737 ListLowerRoman = -7,
738 ListUpperRoman = -8,
739 ListStyleUndefined = 0
740 };
741
742 inline void setStyle(Style style);
743 inline Style style() const
744 { return static_cast<Style>(intProperty(ListStyle)); }
745
746 inline void setIndent(int indent);
747 inline int indent() const
748 { return intProperty(ListIndent); }
749
750 inline void setNumberPrefix(const QString &numberPrefix);
751 inline QString numberPrefix() const
752 { return stringProperty(ListNumberPrefix); }
753
754 inline void setNumberSuffix(const QString &numberSuffix);
755 inline QString numberSuffix() const
756 { return stringProperty(ListNumberSuffix); }
757
758 inline void setStart(int indent);
759 inline int start() const { return intProperty(ListStart); }
760
761protected:
762 explicit QTextListFormat(const QTextFormat &fmt);
763 friend class QTextFormat;
764};
765
766Q_DECLARE_SHARED(QTextListFormat)
767
768inline void QTextListFormat::setStyle(Style astyle)
769{ setProperty(ListStyle, astyle); }
770
771inline void QTextListFormat::setIndent(int aindent)
772{ setProperty(ListIndent, aindent); }
773
776
779
780inline void QTextListFormat::setStart(int astart)
781{
782 setProperty(ListStart, astart);
783}
784
785class Q_GUI_EXPORT QTextImageFormat : public QTextCharFormat
786{
787public:
789
790 bool isValid() const { return isImageFormat(); }
791
792 inline void setName(const QString &name);
793 inline QString name() const
794 { return stringProperty(ImageName); }
795
796 inline void setWidth(qreal width);
797 inline qreal width() const
798 { return doubleProperty(ImageWidth); }
799
800 inline void setMaximumWidth(QTextLength maxWidth);
802 { return lengthProperty(ImageMaxWidth); }
803
804 inline void setHeight(qreal height);
805 inline qreal height() const
806 { return doubleProperty(ImageHeight); }
807
808 inline void setQuality(int quality);
809#if QT_DEPRECATED_SINCE(6, 3)
810 QT_DEPRECATED_VERSION_X_6_3("Pass a quality value, the default is 100") inline void setQuality()
811 { setQuality(100); }
812#endif
813 inline int quality() const
814 { return intProperty(ImageQuality); }
815
816protected:
817 explicit QTextImageFormat(const QTextFormat &format);
818 friend class QTextFormat;
819 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextListFormat &);
820 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextListFormat &);
821};
822
823Q_DECLARE_SHARED(QTextImageFormat)
824
825inline void QTextImageFormat::setName(const QString &aname)
826{ setProperty(ImageName, aname); }
827
829{ setProperty(ImageWidth, awidth); }
830
833
835{ setProperty(ImageHeight, aheight); }
836
837inline void QTextImageFormat::setQuality(int aquality)
838{ setProperty(ImageQuality, aquality); }
839
840class Q_GUI_EXPORT QTextFrameFormat : public QTextFormat
841{
842public:
844
845 bool isValid() const { return isFrameFormat(); }
846
847 enum Position {
850 FloatRight
851 // ######
852// Absolute
853 };
854
868
869 inline void setPosition(Position f)
870 { setProperty(CssFloat, f); }
871 inline Position position() const
872 { return static_cast<Position>(intProperty(CssFloat)); }
873
874 inline void setBorder(qreal border);
875 inline qreal border() const
876 { return doubleProperty(FrameBorder); }
877
878 inline void setBorderBrush(const QBrush &brush)
879 { setProperty(FrameBorderBrush, brush); }
880 inline QBrush borderBrush() const
881 { return brushProperty(FrameBorderBrush); }
882
883 inline void setBorderStyle(BorderStyle style)
884 { setProperty(FrameBorderStyle, style); }
886 { return static_cast<BorderStyle>(intProperty(FrameBorderStyle)); }
887
888 void setMargin(qreal margin);
889 inline qreal margin() const
890 { return doubleProperty(FrameMargin); }
891
892 inline void setTopMargin(qreal margin);
893 qreal topMargin() const;
894
895 inline void setBottomMargin(qreal margin);
896 qreal bottomMargin() const;
897
898 inline void setLeftMargin(qreal margin);
899 qreal leftMargin() const;
900
901 inline void setRightMargin(qreal margin);
902 qreal rightMargin() const;
903
904 inline void setPadding(qreal padding);
905 inline qreal padding() const
906 { return doubleProperty(FramePadding); }
907
908 inline void setWidth(qreal width);
909 inline void setWidth(const QTextLength &length)
910 { setProperty(FrameWidth, length); }
911 inline QTextLength width() const
912 { return lengthProperty(FrameWidth); }
913
914 inline void setHeight(qreal height);
915 inline void setHeight(const QTextLength &height);
916 inline QTextLength height() const
917 { return lengthProperty(FrameHeight); }
918
919 inline void setPageBreakPolicy(PageBreakFlags flags)
920 { setProperty(PageBreakPolicy, int(flags.toInt())); }
921 inline PageBreakFlags pageBreakPolicy() const
922 { return PageBreakFlags(intProperty(PageBreakPolicy)); }
923
924protected:
925 explicit QTextFrameFormat(const QTextFormat &fmt);
926 friend class QTextFormat;
927 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextFrameFormat &);
928 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextFrameFormat &);
929};
930
931Q_DECLARE_SHARED(QTextFrameFormat)
932
933inline void QTextFrameFormat::setBorder(qreal aborder)
934{ setProperty(FrameBorder, aborder); }
935
937{ setProperty(FramePadding, apadding); }
938
941
944inline void QTextFrameFormat::setHeight(const QTextLength &aheight)
945{ setProperty(FrameHeight, aheight); }
946
948{ setProperty(FrameTopMargin, amargin); }
949
952
955
958
959class Q_GUI_EXPORT QTextTableFormat : public QTextFrameFormat
960{
961public:
963
964 inline bool isValid() const { return isTableFormat(); }
965
966 inline int columns() const
967 { int cols = intProperty(TableColumns); if (cols == 0) cols = 1; return cols; }
968 inline void setColumns(int columns);
969
970 inline void setColumnWidthConstraints(const QList<QTextLength> &constraints)
971 { setProperty(TableColumnWidthConstraints, constraints); }
972
973 inline QList<QTextLength> columnWidthConstraints() const
974 { return lengthVectorProperty(TableColumnWidthConstraints); }
975
977 { clearProperty(TableColumnWidthConstraints); }
978
979 inline qreal cellSpacing() const
980 { return doubleProperty(TableCellSpacing); }
982 { setProperty(TableCellSpacing, spacing); }
983
984 inline qreal cellPadding() const
985 { return doubleProperty(TableCellPadding); }
986 inline void setCellPadding(qreal padding);
987
988 inline void setAlignment(Qt::Alignment alignment);
989 inline Qt::Alignment alignment() const
990 { return QFlag(intProperty(BlockAlignment)); }
991
992 inline void setHeaderRowCount(int count)
993 { setProperty(TableHeaderRowCount, count); }
994 inline int headerRowCount() const
995 { return intProperty(TableHeaderRowCount); }
996
997 inline void setBorderCollapse(bool borderCollapse)
998 { setProperty(TableBorderCollapse, borderCollapse); }
999 inline bool borderCollapse() const
1000 { return boolProperty(TableBorderCollapse); }
1001
1002protected:
1003 explicit QTextTableFormat(const QTextFormat &fmt);
1004 friend class QTextFormat;
1005};
1006
1007Q_DECLARE_SHARED(QTextTableFormat)
1008
1009inline void QTextTableFormat::setColumns(int acolumns)
1010{
1011 if (acolumns == 1)
1012 acolumns = 0;
1013 setProperty(TableColumns, acolumns);
1014}
1015
1017{ setProperty(TableCellPadding, apadding); }
1018
1019inline void QTextTableFormat::setAlignment(Qt::Alignment aalignment)
1020{ setProperty(BlockAlignment, int(aalignment.toInt())); }
1021
1022class Q_GUI_EXPORT QTextTableCellFormat : public QTextCharFormat
1023{
1024public:
1026
1027 inline bool isValid() const { return isTableCellFormat(); }
1028
1029 inline void setTopPadding(qreal padding);
1030 inline qreal topPadding() const;
1031
1032 inline void setBottomPadding(qreal padding);
1033 inline qreal bottomPadding() const;
1034
1035 inline void setLeftPadding(qreal padding);
1036 inline qreal leftPadding() const;
1037
1038 inline void setRightPadding(qreal padding);
1039 inline qreal rightPadding() const;
1040
1041 inline void setPadding(qreal padding);
1042
1044 { setProperty(TableCellTopBorder, width); }
1045 inline qreal topBorder() const
1046 { return doubleProperty(TableCellTopBorder); }
1047
1049 { setProperty(TableCellBottomBorder, width); }
1050 inline qreal bottomBorder() const
1051 { return doubleProperty(TableCellBottomBorder); }
1052
1054 { setProperty(TableCellLeftBorder, width); }
1055 inline qreal leftBorder() const
1056 { return doubleProperty(TableCellLeftBorder); }
1057
1059 { setProperty(TableCellRightBorder, width); }
1060 inline qreal rightBorder() const
1061 { return doubleProperty(TableCellRightBorder); }
1062
1063 inline void setBorder(qreal width);
1064
1066 { setProperty(TableCellTopBorderStyle, style); }
1068 { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellTopBorderStyle)); }
1069
1071 { setProperty(TableCellBottomBorderStyle, style); }
1073 { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellBottomBorderStyle)); }
1074
1076 { setProperty(TableCellLeftBorderStyle, style); }
1078 { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellLeftBorderStyle)); }
1079
1081 { setProperty(TableCellRightBorderStyle, style); }
1083 { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellRightBorderStyle)); }
1084
1085 inline void setBorderStyle(QTextFrameFormat::BorderStyle style);
1086
1087 inline void setTopBorderBrush(const QBrush &brush)
1088 { setProperty(TableCellTopBorderBrush, brush); }
1089 inline QBrush topBorderBrush() const
1090 { return brushProperty(TableCellTopBorderBrush); }
1091
1093 { setProperty(TableCellBottomBorderBrush, brush); }
1095 { return brushProperty(TableCellBottomBorderBrush); }
1096
1097 inline void setLeftBorderBrush(const QBrush &brush)
1098 { setProperty(TableCellLeftBorderBrush, brush); }
1100 { return brushProperty(TableCellLeftBorderBrush); }
1101
1103 { setProperty(TableCellRightBorderBrush, brush); }
1105 { return brushProperty(TableCellRightBorderBrush); }
1106
1107 inline void setBorderBrush(const QBrush &brush);
1108
1109protected:
1110 explicit QTextTableCellFormat(const QTextFormat &fmt);
1111 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextTableCellFormat &);
1112 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextTableCellFormat &);
1113 friend class QTextFormat;
1114};
1115
1116Q_DECLARE_SHARED(QTextTableCellFormat)
1117
1118inline void QTextTableCellFormat::setTopPadding(qreal padding)
1119{
1121}
1122
1127
1132
1137
1139{
1141}
1142
1147
1149{
1151}
1152
1157
1159{
1160 setTopPadding(padding);
1161 setBottomPadding(padding);
1162 setLeftPadding(padding);
1163 setRightPadding(padding);
1164}
1165
1173
1181
1189
1191
1192#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:46
\inmodule QtCore
Definition qflags.h:17
\reentrant
Definition qfont.h:22
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
Definition qfont.h:25
Capitalization
Definition qfont.h:97
SpacingType
Definition qfont.h:106
HintingPreference
Definition qfont.h:55
StyleStrategy
The style strategy tells the \l{QFont}{font matching} algorithm what type of fonts should be used to ...
Definition qfont.h:38
@ PreferDefault
Definition qfont.h:39
@ Normal
Definition qfont.h:67
\inmodule QtGui
Definition qpen.h:28
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
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.
@ 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.
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
QTextLength maximumWidth() const
Returns the maximum width of the rectangle occupied by the image.
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.
void setMaximumWidth(QTextLength maxWidth)
Sets the maximumWidth 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:65
qreal spacing
employee setName("Richard Schmit")
uint alignment
direction
Combined button and popup list for selecting options.
Definition qcompare.h:63
@ AlignLeft
Definition qnamespace.h:144
LayoutDirection
Definition brush.cpp:5
QList< QString > QStringList
Constructs a string list that contains the given string, str.
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:333
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
GLuint color
[2]
GLenum type
GLbitfield flags
GLboolean enable
const GLchar * marker
GLuint name
GLint GLsizei GLsizei GLenum format
GLdouble s
[6]
Definition qopenglext.h:235
GLuint GLuint * names
@ FontWeight
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
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:157
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
int qint32
Definition qtypes.h:49
double qreal
Definition qtypes.h:187
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)
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject- setProperty)("dynamicProperty", 3)
Definition moc.h:23