|
Krita Source Code Documentation
|
#include <SvgTextLabel.h>
Inheritance diagram for SvgTextLabel:Public Slots | |
| void | setFontAxesValues (QVariantMap fontAxesValues) |
| void | setFontFamilies (QStringList fontFamilies) |
| void | setFontSize (qreal fontSize) |
| void | setFontSlant (qreal fontSlant) |
| void | setFontStyle (QFont::Style fontStyle) |
| void | setFontWeight (qreal fontWeight) |
| void | setFontWidth (qreal fontWidth) |
| void | setLanguage (QString language) |
| void | setOpenTypeFeatures (QVariantMap openTypeFeatures) |
| void | setPadding (int padding) |
| void | setText (QString text) |
| void | setTextColor (QColor textColor) |
Signals | |
| void | fontAxesValuesChanged (QVariantMap fontAxesValues) |
| void | fontFamiliesChanged (QStringList) |
| void | fontSizeChanged (qreal fontSize) |
| void | fontSlantChanged (qreal fontSlant) |
| void | fontStyleChanged (QFont::Style fontStyle) |
| void | fontWeightChanged (qreal fontWeight) |
| void | fontWidthChanged (qreal fontWidth) |
| void | languageChanged (QString language) |
| void | minimumRectChanged () |
| void | openTypeFeaturesChanged (QVariantMap openTypeFeatures) |
| void | paddingChanged (int padding) |
| void | textChanged (QString text) |
| void | textColorChanged (QColor textColor) |
Public Member Functions | |
| QVariantMap | fontAxesValues () const |
| QStringList | fontFamilies () const |
| qreal | fontSize () const |
| qreal | fontSlant () const |
| QFont::Style | fontStyle () const |
| qreal | fontWeight () const |
| qreal | fontWidth () const |
| QString | language () const |
| QRectF | minimumRect () const |
| QVariantMap | openTypeFeatures () const |
| int | padding () const |
| void | paint (QPainter *painter) override |
| Private () | |
| SvgTextLabel (QQuickItem *parent=nullptr) | |
| QString | text () const |
| QColor | textColor () const |
| ~Private () | |
| ~SvgTextLabel () | |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Public Attributes | |
| bool | addedShapeToPainter = false |
| int | bottomPadding = 2 |
| int | leftPadding = 2 |
| KoSvgTextProperties | props |
| int | rightPadding = 2 |
| QScopedPointer< KoSvgTextShape > | shape |
| QScopedPointer< KoShapePainter > | shapePainter |
| int | topPadding = 2 |
Public Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Protected Member Functions | |
| void | componentComplete () override |
| componentComplete called when all properties have been set. used to avoid relayout being called time and time again when the properties change. | |
Properties | |
| QVariantMap | fontAxesValues |
| QML_ELEMENTQStringList | fontFamilies |
| qreal | fontSize |
| qreal | fontSlant |
| QFont::Style | fontStyle |
| qreal | fontWeight |
| qreal | fontWidth |
| QString | language |
| QRectF | minimumRect |
| QVariantMap | openTypeFeatures |
| int | padding |
| QString | text |
| QColor | textColor |
Private Slots | |
| void | updateShape () |
Private Attributes | |
| const QScopedPointer< Private > | d |
SvgTextLabel makes it possible to paint a KoSvgTextShape as a QML item. It will position and scale the text centered in the bounds of the items.
This is nowhere near as fast as a regular Text item, as Qt has a glyph cache, while Krita's system paints paths directly.
Definition at line 15 of file SvgTextLabel.cpp.
|
inline |
Definition at line 24 of file SvgTextLabel.cpp.
| SvgTextLabel::SvgTextLabel | ( | QQuickItem * | parent = nullptr | ) |
Definition at line 44 of file SvgTextLabel.cpp.
References connect(), openTypeFeaturesChanged(), and updateShape().
| SvgTextLabel::~SvgTextLabel | ( | ) |
Definition at line 55 of file SvgTextLabel.cpp.
|
overrideprotected |
componentComplete called when all properties have been set. used to avoid relayout being called time and time again when the properties change.
Definition at line 294 of file SvgTextLabel.cpp.
References d, and updateShape().
| QVariantMap SvgTextLabel::fontAxesValues | ( | ) | const |
Definition at line 115 of file SvgTextLabel.cpp.
References d, and KoSvgTextProperties::FontVariationSettingsId.
|
signal |
| QStringList SvgTextLabel::fontFamilies | ( | ) | const |
Definition at line 89 of file SvgTextLabel.cpp.
References d, and KoSvgTextProperties::FontFamiliesId.
|
signal |
| qreal SvgTextLabel::fontSize | ( | ) | const |
Definition at line 120 of file SvgTextLabel.cpp.
References d, and KoSvgTextProperties::FontSizeId.
|
signal |
| qreal SvgTextLabel::fontSlant | ( | ) | const |
Definition at line 109 of file SvgTextLabel.cpp.
References KoSvgText::AutoValue::customValue, d, KoSvgTextProperties::FontStyleId, KoSvgText::AutoValue::isAuto, and KoSvgText::CssFontStyleData::slantValue.
|
signal |
| QFont::Style SvgTextLabel::fontStyle | ( | ) | const |
Definition at line 104 of file SvgTextLabel.cpp.
References d, and KoSvgTextProperties::FontStyleId.
|
signal |
| qreal SvgTextLabel::fontWeight | ( | ) | const |
Definition at line 94 of file SvgTextLabel.cpp.
References d, and KoSvgTextProperties::FontWeightId.
|
signal |
| qreal SvgTextLabel::fontWidth | ( | ) | const |
Definition at line 99 of file SvgTextLabel.cpp.
References d, and KoSvgTextProperties::FontStretchId.
|
signal |
| QString SvgTextLabel::language | ( | ) | const |
Definition at line 149 of file SvgTextLabel.cpp.
References d, and KoSvgTextProperties::TextLanguage.
|
signal |
| QRectF SvgTextLabel::minimumRect | ( | ) | const |
|
signal |
| QVariantMap SvgTextLabel::openTypeFeatures | ( | ) | const |
Definition at line 134 of file SvgTextLabel.cpp.
References d, and KoSvgTextProperties::FontFeatureSettingsId.
|
signal |
| int SvgTextLabel::padding | ( | ) | const |
|
signal |
|
override |
Definition at line 59 of file SvgTextLabel.cpp.
References d, and KIS_SAFE_ASSERT_RECOVER_RETURN.
|
inline |
Definition at line 17 of file SvgTextLabel.cpp.
|
slot |
Definition at line 209 of file SvgTextLabel.cpp.
References d, fontAxesValues, fontAxesValuesChanged(), and KoSvgTextProperties::FontVariationSettingsId.
|
slot |
Definition at line 154 of file SvgTextLabel.cpp.
References d, fontFamilies, fontFamiliesChanged(), and KoSvgTextProperties::FontFamiliesId.
|
slot |
Definition at line 219 of file SvgTextLabel.cpp.
References d, fontSize, fontSizeChanged(), KoSvgTextProperties::FontSizeId, qFuzzyCompare(), and KoSvgText::CssLengthPercentage::value.
|
slot |
Definition at line 195 of file SvgTextLabel.cpp.
References KoSvgText::AutoValue::customValue, d, fontSlant, fontSlantChanged(), KoSvgTextProperties::FontStyleId, KoSvgText::AutoValue::isAuto, and KoSvgText::CssFontStyleData::slantValue.
|
slot |
Definition at line 184 of file SvgTextLabel.cpp.
References d, fontStyle, fontStyleChanged(), KoSvgTextProperties::FontStyleId, and KoSvgText::CssFontStyleData::style.
|
slot |
Definition at line 164 of file SvgTextLabel.cpp.
References d, fontWeight, fontWeightChanged(), KoSvgTextProperties::FontWeightId, and qFuzzyCompare().
|
slot |
Definition at line 174 of file SvgTextLabel.cpp.
References d, KoSvgTextProperties::FontStretchId, fontWidth, fontWidthChanged(), and qFuzzyCompare().
|
slot |
Definition at line 284 of file SvgTextLabel.cpp.
References d, language, languageChanged(), and KoSvgTextProperties::TextLanguage.
|
slot |
Definition at line 248 of file SvgTextLabel.cpp.
References d, KoSvgTextProperties::FontFeatureSettingsId, openTypeFeatures, and openTypeFeaturesChanged().
|
slot |
Definition at line 270 of file SvgTextLabel.cpp.
References d, minimumRectChanged(), padding, and paddingChanged().
|
slot |
Definition at line 258 of file SvgTextLabel.cpp.
References d, length(), text, and textChanged().
|
slot |
Definition at line 230 of file SvgTextLabel.cpp.
References KoColorBackground::color(), d, KoSvgTextProperties::FillId, textColor, and textColorChanged().
| QString SvgTextLabel::text | ( | ) | const |
Definition at line 139 of file SvgTextLabel.cpp.
References d.
|
signal |
| QColor SvgTextLabel::textColor | ( | ) | const |
Definition at line 125 of file SvgTextLabel.cpp.
References KoColorBackground::color(), and d.
|
signal |
|
privateslot |
Definition at line 322 of file SvgTextLabel.cpp.
References d, and minimumRectChanged().
| bool SvgTextLabel::addedShapeToPainter = false |
Definition at line 41 of file SvgTextLabel.cpp.
| int SvgTextLabel::bottomPadding = 2 |
Definition at line 37 of file SvgTextLabel.cpp.
|
private |
Definition at line 136 of file SvgTextLabel.h.
| int SvgTextLabel::leftPadding = 2 |
Definition at line 38 of file SvgTextLabel.cpp.
| KoSvgTextProperties SvgTextLabel::props |
Definition at line 34 of file SvgTextLabel.cpp.
| int SvgTextLabel::rightPadding = 2 |
Definition at line 39 of file SvgTextLabel.cpp.
| QScopedPointer<KoSvgTextShape> SvgTextLabel::shape |
Definition at line 26 of file SvgTextLabel.cpp.
| QScopedPointer<KoShapePainter> SvgTextLabel::shapePainter |
The shape painter is initialized only after QML item loading is completed
Definition at line 32 of file SvgTextLabel.cpp.
| int SvgTextLabel::topPadding = 2 |
Definition at line 36 of file SvgTextLabel.cpp.
|
readwrite |
Definition at line 30 of file SvgTextLabel.h.
|
readwrite |
Definition at line 25 of file SvgTextLabel.h.
|
readwrite |
Definition at line 31 of file SvgTextLabel.h.
|
readwrite |
Definition at line 29 of file SvgTextLabel.h.
|
readwrite |
Definition at line 28 of file SvgTextLabel.h.
|
readwrite |
Definition at line 26 of file SvgTextLabel.h.
|
readwrite |
Definition at line 27 of file SvgTextLabel.h.
|
readwrite |
Definition at line 36 of file SvgTextLabel.h.
|
read |
Definition at line 37 of file SvgTextLabel.h.
|
readwrite |
Definition at line 33 of file SvgTextLabel.h.
|
readwrite |
Definition at line 35 of file SvgTextLabel.h.
|
readwrite |
Definition at line 34 of file SvgTextLabel.h.
|
readwrite |
Definition at line 32 of file SvgTextLabel.h.