26 #include <QTextCharFormat>
34 : weight(QFont::Normal), italic(
false), overline(
false), underline(
false), strikeout(
false), waveUnderline(
false)
38 : weight(QFont::Normal), italic(
false), overline(
false), underline(
false), strikeout(
false), waveUnderline(
false), foreground(c)
41 inline QFormat(
int w,
const QColor& c)
42 : weight(w), italic(
false), overline(
false), underline(
false), strikeout(
false), waveUnderline(
false), foreground(c)
45 inline QFormat(
int w,
bool i,
bool u,
bool s,
const QColor& c)
46 : weight(w), italic(i), overline(
false), underline(u), strikeout(s), waveUnderline(
false), foreground(c)
49 inline QFormat(
int w,
bool i,
bool o,
bool u,
bool s,
bool wu,
const QColor& c)
50 : weight(w), italic(i), overline(o), underline(u), strikeout(s), waveUnderline(wu), foreground(c)
54 : weight(f.weight), italic(f.italic),
55 overline(f.overline), underline(f.underline), strikeout(f.strikeout), waveUnderline(f.waveUnderline),
56 foreground(f.foreground), background(f.background), linescolor(f.linescolor)
63 overline = f.overline;
64 underline = f.underline;
65 strikeout = f.strikeout;
66 foreground = f.foreground;
67 background = f.background;
68 linescolor = f.linescolor;
69 waveUnderline = f.waveUnderline;
74 inline bool operator == (
const QFormat& f)
const
76 return (weight == f.weight)
80 (overline == f.overline)
82 (underline == f.underline)
84 (strikeout == f.strikeout)
86 (foreground == f.foreground)
88 (background == f.background)
90 (linescolor == f.linescolor)
92 (waveUnderline == f.waveUnderline)
96 inline bool operator != (
const QFormat& f)
const
98 return (weight != f.weight)
102 (overline != f.overline)
104 (underline != f.underline)
106 (strikeout != f.strikeout)
108 (foreground != f.foreground)
110 (background != f.background)
112 (linescolor != f.linescolor)
114 (waveUnderline != f.waveUnderline)
118 QTextCharFormat toTextCharFormat()
const
121 f.setFontWeight(weight);
122 f.setFontItalic(italic);
123 f.setFontOverline(overline);
124 f.setFontUnderline(underline);
125 f.setFontStrikeOut(strikeout);
126 f.setUnderlineColor(linescolor);
130 f.setUnderlineStyle(QTextCharFormat::WaveUnderline);
133 if ( foreground.isValid() )
134 f.setForeground(foreground);
136 if ( background.isValid() )
137 f.setBackground(background);
153 Q_DECLARE_TYPEINFO(
QFormat, Q_MOVABLE_TYPE);
158 : offset(0), length(0), format(0)
162 : offset(o), length(l), format(f)
166 {
return (offset == o.offset) && (length == o.length) && (format == o.format); }
169 {
return (offset != o.offset) || (length != o.length) || (format != o.format); }