NameUtils QML Type (Singleton)

Some utilities for processing names. More...

Import Statement: import org.kde.kirigami.primitives

Note: This type is a QML singleton. There is only one instance of this type in the QML engine.

Methods

Detailed Description

Given a string, typically a person name, this can extract initials or assign a color for the name, useful for avatars.

See also Avatar.

Method Documentation

color colorsFromString(string name)

Give a possible color for the string, use to have avatars of discernable colors

string initialsFromString(string name)

Extract suitable initials from a name, for instance the first letter of the name plus the first letter of the surname

bool isStringUnsuitableForInitials(string name)

Returns true if the string is not suitablefor initials, such as if is in parts of Unicode this class doesn't understand