| auto NameUtils::isStringUnsuitableForInitials(const QString &string) -> bool
|
| {
|
| if (string.isEmpty()) {
|
| return true;
|
| }
|
|
|
| bool isNumber;
|
| string.toFloat(&isNumber);
|
| if (isNumber) {
|
| return true;
|
| }
|
|
|
| static const std::array<QChar::Script, 6> scripts{
|
| QChar::Script_Common, QChar::Script_Inherited, QChar::Script_Latin,
|
| QChar::Script_Han, QChar::Script_Hangul, QChar::Script_Cyrillic};
|
|
|
| std::any_of(string.cbegin(), string.cend(), [](const QChar &character) {
|
| return std::find(scripts.begin(), scripts.end(), character.script()) == scripts.end();
|
| });
|
|
|
| return false;
|
| }
|