18 #include <QTextCharFormat>
21 : mTextColor( format.hasProperty( QTextFormat::ForegroundBrush ) ? format.foreground().color() : QColor() )
23 , mFontWeight( format.hasProperty( QTextFormat::FontWeight ) ? format.fontWeight() : -1 )
25 , mFontPointSize( format.hasProperty( QTextFormat::FontPointSize ) ? format.fontPointSize() : - 1 )
26 , mFontFamily( format.hasProperty( QTextFormat::FontFamily ) ? format.fontFamily() : QString() )
47 return mStrikethrough;
52 mStrikethrough = strikethrough;
77 Q_UNUSED( scaleFactor );
81 if ( mFontWeight != -1 )
82 font.setWeight( mFontWeight );
83 if ( !mFontFamily.isEmpty() )
84 font.setFamily( mFontFamily );
85 if ( mFontPointSize != -1 )
86 font.setPointSizeF( mFontPointSize );
108 int QgsTextCharacterFormat::fontWeight()
const
113 void QgsTextCharacterFormat::setFontWeight(
int fontWeight )
115 mFontWeight = fontWeight;
QColor textColor() const
Returns the character's text color, or an invalid color if no color override is set and the default f...
QgsTextCharacterFormat()=default
Constructor for QgsTextCharacterFormat.
void setStrikeOut(BooleanValue enabled)
Sets whether the format has strikethrough enabled.
void setOverline(BooleanValue enabled)
Sets whether the format has overline enabled.
BooleanValue
Status values for boolean format properties.
@ SetTrue
Property is set and true.
@ NotSet
Property is not set.
BooleanValue strikeOut() const
Returns whether the format has strikethrough enabled.
BooleanValue underline() const
Returns whether the format has underline enabled.
void setTextColor(const QColor &textColor)
Sets the character's text color.
void setUnderline(BooleanValue enabled)
Sets whether the format has underline enabled.
BooleanValue overline() const
Returns whether the format has overline enabled.
void updateFontForFormat(QFont &font, double scaleFactor=1.0) const
Updates the specified font in place, applying character formatting options which are applicable on a ...