Added function to count characters in input field with emoji.
This commit is contained in:
parent
0c6b2c611d
commit
333587d95e
2 changed files with 7 additions and 0 deletions
|
|
@ -3988,4 +3988,9 @@ void PrepareFormattingOptimization(not_null<QTextDocument*> document) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int FieldCharacterCount(not_null<InputField*> field) {
|
||||||
|
// This method counts emoji properly.
|
||||||
|
return field->document()->characterCount() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
|
||||||
|
|
@ -569,4 +569,6 @@ private:
|
||||||
|
|
||||||
void PrepareFormattingOptimization(not_null<QTextDocument*> document);
|
void PrepareFormattingOptimization(not_null<QTextDocument*> document);
|
||||||
|
|
||||||
|
[[nodiscard]] int FieldCharacterCount(not_null<InputField*> field);
|
||||||
|
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue