22 class KDReports::TextElementPrivate
29 , m_italicIsSet(false)
31 , m_underlineIsSet(false)
33 , m_strikeoutIsSet(false)
48 bool m_underlineIsSet;
50 bool m_strikeoutIsSet;
59 , d(new TextElementPrivate)
66 , d(new TextElementPrivate(*other.d))
86 QTextCursor &cursor = builder.
cursor();
87 const int charPosition = cursor.position();
88 QTextCharFormat charFormat = cursor.charFormat();
91 #if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
92 charFormat.setFont(d->m_font, QTextCharFormat::FontPropertiesSpecifiedOnly);
94 charFormat.setFont(d->m_font);
98 charFormat.setFontWeight(d->m_bold ? QFont::Bold : QFont::Normal);
100 charFormat.setFontItalic(d->m_italic);
101 if (d->m_underlineIsSet)
102 charFormat.setFontUnderline(d->m_underline);
103 if (d->m_strikeoutIsSet)
104 charFormat.setFontStrikeOut(d->m_strikeout);
105 if (d->m_pointSize > 0)
106 charFormat.setFontPointSize(d->m_pointSize);
107 if (!d->m_fontFamily.isEmpty())
108 charFormat.setFontFamily(d->m_fontFamily);
109 if (d->m_foreground.isValid())
110 charFormat.setForeground(d->m_foreground);
111 charFormat.setBackground(background());
112 cursor.setCharFormat(charFormat);
113 cursor.insertText(d->m_string);
114 if (!d->m_id.isEmpty())
120 d->m_string.append(str);
131 d->m_fontFamily = family;
137 d->m_boldIsSet =
true;
142 d->m_italic = italic;
143 d->m_italicIsSet =
true;
148 d->m_underline = underline;
149 d->m_underlineIsSet =
true;
154 d->m_strikeout = strikeout;
155 d->m_strikeoutIsSet =
true;
160 d->m_pointSize = size;
171 d->m_foreground = color;
176 return d->m_foreground;