<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # QTextFragment Class Reference ## [[QtGui](index.htm) module] 該QTextFragment類包含一段文字中[QTextDocument](qtextdocument.html)與單個[QTextCharFormat](qtextcharformat.html)。[More...](#details) ### Methods * `__init__ (self)` * `__init__ (self, QTextFragment?o)` * `QTextCharFormat charFormat (self)` * `int charFormatIndex (self)` * `bool contains (self, int?position)` * `list-of-QGlyphRun glyphRuns (self)` * `bool isValid (self)` * `int length (self)` * `int position (self)` * `QString text (self)` ### Special Methods * `bool __eq__ (self, QTextFragment?o)` * `bool __ge__ (self, QTextFragment?o)` * `bool __lt__ (self, QTextFragment?o)` * `bool __ne__ (self, QTextFragment?o)` * * * ## Detailed Description 該QTextFragment類包含一段文字中[QTextDocument](qtextdocument.html)與單個[QTextCharFormat](qtextcharformat.html)。 文本片段描述一張存儲與單個字符格式的文本。文本中的字符格式的變化可以通過文本片段具有不同格式的序列來表示。 如果用戶編輯的文本片段,并引入不同的字符格式,片段的文字將被分割在各點的格式變化,以及新的片段將會被創建。例如,改變一些文本的樣式在句子的中間將導致片段被分成三個獨立的片段:第一個和第三個前具有相同的格式,第二個與新的風格。第一個片段將包含文本從句子的開頭,第二個將包含從中間的文本,第三個從句子的結尾獲取文本。 ![](https://img.kancloud.cn/9b/2e/9b2ef4beaa2a782b029d1e73f032fa96_531x64.png) 片段的文本和字符格式可以用得到[text](qtextfragment.html#text)()和[charFormat](qtextfragment.html#charFormat)()函數。該[length](qtextfragment.html#length)()函數給出了在片段中的文本的長度。[position](qtextfragment.html#position)( )給出了該片段的開始的文檔中的位置。為了確定該片段是否包含在文檔中的特定位置,請使用[contains](qtextfragment.html#contains)()函數。 * * * ## Method Documentation ``` QTextFragment.__init__ (self) ``` 創建一個新的空文本片段。 ``` QTextFragment.__init__ (self, QTextFragment?o) ``` ``` QTextCharFormat QTextFragment.charFormat (self) ``` [ 返回文本片段的字符格式。 ](qtextcharformat.html) [**See also**](qtextcharformat.html) [text](qtextfragment.html#text)( ) 。 ``` int QTextFragment.charFormatIndex (self) ``` 返回一個索引到文檔內部的字符格式的文本片段的字符格式列表。 **See also** [QTextDocument.allFormats](qtextdocument.html#allFormats)( ) 。 ``` bool QTextFragment.contains (self, int?position) ``` 如果文本片段包含文本在給定的,則返回True_position_在文件中,否則返回False 。 ``` list-of-QGlyphRun QTextFragment.glyphRuns (self) ``` 返回此文字片段的字形。字形的位置是相對于的位置[QTextBlock](qtextblock.html)的布局。 **See also** [QGlyphRun](qglyphrun.html),[QTextBlock.layout](qtextblock.html#layout)( )[QTextLayout.position](qtextlayout.html#position)()和[QPainter.drawGlyphRun](qpainter.html#drawGlyphRun)( ) 。 ``` bool QTextFragment.isValid (self) ``` 返回True如果這是一個有效的文本片段(即在文檔中的有效位置),否則返回False 。 ``` int QTextFragment.length (self) ``` 返回字符的文本片段的數量。 **See also** [text](qtextfragment.html#text)( ) 。 ``` int QTextFragment.position (self) ``` 返回文檔中當前文本片段中的位置。 ``` QString QTextFragment.text (self) ``` 返回文本片段的為純文本。 **See also** [length](qtextfragment.html#length)()和[charFormat](qtextfragment.html#charFormat)( ) 。 ``` bool QTextFragment.__eq__ (self, QTextFragment?o) ``` ``` bool QTextFragment.__ge__ (self, QTextFragment?o) ``` ``` bool QTextFragment.__lt__ (self, QTextFragment?o) ``` ``` bool QTextFragment.__ne__ (self, QTextFragment?o) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看