PythonQt.Qt.QTextFragment
QTextFragment
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
A text fragment describes a piece of text that is stored with a single character format. Text in which the character format changes can be represented by sequences of text fragments with different formats.
If the user edits the text in a fragment and introduces a different character format, the fragment's text will be split at each point where the format changes, and new fragments will be created. For example, changing the style of some text in the middle of a sentence will cause the fragment to be broken into three separate fragments: the first and third with the same format as before, and the second with the new style. The first fragment will contain the text from the beginning of the sentence, the second will contain the text from the middle, and the third takes the text from the end of the sentence.

A fragment's text and character format can be obtained with the text() and charFormat() functions. The length() function gives the length of the text in the fragment. position() gives the position in the document of the start of the fragment. To determine whether the fragment contains a particular position within the document, use the contains() function.
Source: https://doc.qt.io/archives/qt-5.15/qtextfragment.html
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
charFormat |
function | (self) -> Any |
X.charFormat() -> PythonQt.QtGui.QTextCharFormat (shared captured text) |
charFormatIndex |
function | (self) -> int |
X.charFormatIndex() -> int (shared captured text) |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
contains |
function | (self, position: int) -> bool |
X.contains(position) -> bool (shared captured text) |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
glyphRuns |
function | (self, *args: Any, **kwargs: Any) -> Any |
X.glyphRuns(from, length) -> tuple (shared captured text) |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
isValid |
function | (self) -> bool |
X.isValid() -> bool (shared captured text) |
length |
function | (self) -> int |
X.length() -> int (shared captured text) |
position |
function | (self) -> int |
X.position() -> int (shared captured text) |
text |
function | (self) -> str |
X.text() -> str (shared captured text) |