The PySide.QtCore.QTextBoundaryFinder class provides a way of finding Unicode text boundaries in a string.
PySide.QtCore.QTextBoundaryFinder can operate on a PySide.QtCore.QString in four possible modes depending on the value of BoundaryType .
Units of Unicode characters that make up what the user thinks of as a character or basic unit of the language are here called Grapheme clusters. The two unicode characters ‘A’ + diaeresis do for example form one grapheme cluster as the user thinks of them as one character, yet it is in this case represented by two unicode code points.
Word boundaries are there to locate the start and end of what a language considers to be a word.
Line break boundaries give possible places where a line break might happen and sentence boundaries will show the beginning and end of whole sentences.
The first position in a string is always a valid boundary and refers to the position before the first character. The last position at the length of the string is also valid and refers to the position after the last character.
Constructs an invalid PySide.QtCore.QTextBoundaryFinder object.
Creates a PySide.QtCore.QTextBoundaryFinder object of type operating on string .
Copies the PySide.QtCore.QTextBoundaryFinder object, other .
|QTextBoundaryFinder.NotAtBoundary||The boundary finder is not at a boundary position.|
|QTextBoundaryFinder.StartWord||The boundary finder is at the start of a word.|
|QTextBoundaryFinder.EndWord||The boundary finder is at the end of a word.|
|QTextBoundaryFinder.Grapheme||Finds a grapheme which is the smallest boundary. It including letters, punctation marks, numerals and more.|
|QTextBoundaryFinder.Word||Finds a word.|
|QTextBoundaryFinder.Line||Finds possible positions for breaking the text into multiple lines.|
|QTextBoundaryFinder.Sentence||Finds sentence boundaries. These include periods, question marks etc.|
Returns the reasons for the boundary finder to have chosen the current position as a boundary.
Returns true if the object’s PySide.QtCore.QTextBoundaryFinder.position() is currently at a valid text boundary.
Returns true if the text boundary finder is valid; otherwise returns false. A default PySide.QtCore.QTextBoundaryFinder is invalid.
Returns the current position of the PySide.QtCore.QTextBoundaryFinder .
The range is from 0 (the beginning of the string) to the length of the string inclusive.
|Parameters:||position – PySide.QtCore.int|
Sets the current position of the PySide.QtCore.QTextBoundaryFinder to position .
If position is out of bounds, it will be bound to only valid positions. In this case, valid positions are from 0 to the length of the string inclusive.
Returns the string the PySide.QtCore.QTextBoundaryFinder object operates on.
Moves the finder to the end of the string. This is equivalent to setPosition(string. length() ).
Moves the PySide.QtCore.QTextBoundaryFinder to the next boundary position and returns that position.
Returns -1 if there is no next boundary.
Moves the PySide.QtCore.QTextBoundaryFinder to the previous boundary position and returns that position.
Returns -1 if there is no previous boundary.
Moves the finder to the start of the string. This is equivalent to setPosition(0).