80 if (!
d->interface || !
d->provider)
return;
83 if (props.isEmpty())
return;
85 QSet<KoSvgTextProperties::PropertyId> propIds;
87 for (
auto it = props.begin(); it != props.end(); it++) {
89 for (
int i = 0; i <
p.properties().size(); i++) {
90 propIds.insert(
p.properties().at(i));
98 d->lastSetTextData = textData;
99 d->provider->setTextPropertyData(textData);
105 if (!
d->interface || !
d->provider)
return;
106 if (
d->lastSetTextData ==
d->provider->textPropertyData())
return;
111 QSet<KoSvgTextProperties::PropertyId> removeProperties;
114 oldPropIds.append(
d->lastSetTextData.tristate.values());
115 for (
auto it = oldPropIds.begin(); it != oldPropIds.end(); it++) {
118 removeProperties.insert(
p);
122 if (newProps.
isEmpty() && removeProperties.isEmpty())
return;
123 d->interface->setPropertiesOnSelected(newProps, removeProperties);
KoSvgTextPropertyData textDataProperties(QList< KoSvgTextProperties > props, QSet< KoSvgTextProperties::PropertyId > propIds)
KisTextPropertiesManager(QObject *parent=nullptr)
void setTextPropertiesInterface(KoSvgTextPropertiesInterface *interface)
setTextPropertiesInterface set the text properties interface. This should be done on tool activation....
QScopedPointer< Private > d
void slotInterfaceSelectionChanged()
void slotTextPropertiesChanged()
void setCanvasResourceProvider(KisCanvasResourceProvider *provider)
setCanvasResourceProvider set the canvas resource provider.
~KisTextPropertiesManager()
The KoSvgTextPropertiesInterface class.
void removeProperty(PropertyId id)
QVariant property(PropertyId id, const QVariant &defaultValue=QVariant()) const
bool hasProperty(PropertyId id) const
KoSvgTextProperties ownProperties(const KoSvgTextProperties &parentProperties, bool keepFontSize=false) const
KoSvgTextPropertyData lastSetTextData
KisSignalAutoConnectionsStore interfaceConnectionStore
KisSignalAutoConnectionsStore providerConnectionStore
KisCanvasResourceProvider * provider
The KoSvgTextPropertyData struct.
KoSvgTextProperties commonProperties
The properties common between all the selected text.
QSet< KoSvgTextProperties::PropertyId > tristate
The properties that are not common (tri-state) between the selected text.
bool spanSelection
Whether we're currently selecting a span of text as opposed to editing the whole paragraph.
KoSvgTextProperties inheritedProperties
The properties that are inherited, so that widgets may be set correctly.