QTextLayout Class Reference |
Constant | Value |
---|---|
QTextLayout::SkipCharacters | 0 |
QTextLayout::SkipWords | 1 |
Constructs an empty text layout.
See also setText().
Constructs a text layout to lay out the given text.
Constructs a text layout to lay out the given text with the specified font.
All the metric and layout calculations will be done in terms of the paint device, paintdevice. If paintdevice is 0 the calculations will be done in screen metrics.
Destructs the layout.
Returns the list of additional formats supported by the text layout.
See also setAdditionalFormats() and clearAdditionalFormats().
Begins the layout process.
The smallest rectangle that contains all the lines in the layout.
Returns true if the complete layout information is cached; otherwise returns false.
See also setCacheEnabled().
Clears the list of additional formats supported by the text layout.
See also additionalFormats() and setAdditionalFormats().
Clears the line information in the layout. After having called this function, lineCount() returns 0.
This function was introduced in Qt 4.4.
Returns a new text line to be laid out if there is text to be inserted into the layout; otherwise returns an invalid text line.
The text layout creates a new line object that starts after the last line in the layout, or at the beginning if the layout is empty. The layout maintains an internal cursor, and each line is filled with text from the cursor position onwards when the QTextLine::setLineWidth() function is called.
Once QTextLine::setLineWidth() is called, a new line can be created and filled with text. Repeating this process will lay out the whole block of text contained in the QTextLayout. If there is no text left to be inserted into the layout, the QTextLine returned will not be valid (isValid() will return false).
Draws the whole layout on the painter p at the position specified by pos. The rendered layout includes the given selections and is clipped within the rectangle specified by clip.
Draws a text cursor with the current pen and the specified width at the given position using the painter specified. The corresponding position within the text is specified by cursorPosition.
This is an overloaded member function, provided for convenience.
Draws a text cursor with the current pen at the given position using the painter specified. The corresponding position within the text is specified by cursorPosition.
Ends the layout process.
Returns the current font that is used for the layout, or a default font if none is set.
See also setFont().
Returns true if position pos is a valid cursor position.
In a Unicode context some positions in the text are not valid cursor positions, because the position is inside a Unicode surrogate or a grapheme cluster.
A grapheme cluster is a sequence of two or more Unicode characters that form one indivisible entity on the screen. For example the latin character `Ä' can be represented in Unicode by two characters, `A' (0x41), and the combining diaresis (0x308). A text cursor can only validly be positioned before or after these two characters, never between them since that wouldn't make sense. In indic languages every syllable forms a grapheme cluster.
Returns the i-th line of text in this text layout.
See also lineCount() and lineForTextPosition().
Returns the number of lines in this text layout.
See also lineAt().
Returns the line that contains the cursor position specified by pos.
See also isValidCursorPosition() and lineAt().
The maximum width the layout could expand to; this is essentially the width of the entire text.
Warning: This function only returns a valid value after the layout has been done.
See also minimumWidth().
The minimum width the layout needs. This is the width of the layout's smallest non-breakable substring.
Warning: This function only returns a valid value after the layout has been done.
See also maximumWidth().
Returns the next valid cursor position after oldPos that respects the given cursor mode.
See also isValidCursorPosition() and previousCursorPosition().
The global position of the layout. This is independent of the bounding rectangle and of the layout process.
This function was introduced in Qt 4.2.
See also setPosition().
Returns the position of the area in the text layout that will be processed before editing occurs.
Returns the text that is inserted in the layout before editing occurs.
Returns the first valid cursor position before oldPos that respects the given cursor mode.
See also isValidCursorPosition() and nextCursorPosition().
Sets the additional formats supported by the text layout to formatList.
See also additionalFormats() and clearAdditionalFormats().
Enables caching of the complete layout information if enable is true; otherwise disables layout caching. Usually QTextLayout throws most of the layouting information away after a call to endLayout() to reduce memory consumption. If you however want to draw the laid out text directly afterwards enabling caching might speed up drawing significantly.
See also cacheEnabled().
Sets the layout's font to the given font. The layout is invalidated and must be laid out again.
Moves the text layout to point p.
See also position().
Sets the position and text of the area in the layout that is processed before editing occurs.
Sets the layout's text to the given string. The layout is invalidated and must be laid out again.
Notice that when using this QTextLayout as part of a QTextDocument this method will have no effect.
See also text().
Sets the text option structure that controls the layout process to the given option.
See also textOption() and QTextOption.
Returns the layout's text.
See also setText().
Returns the current text option used to control the layout process.
See also setTextOption() and QTextOption.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.4 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com