![]() | Home · All Classes · Modules |
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display formatted text. More...
Inherits QObject and QGraphicsItem.
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display formatted text.
To set the item's text, pass a QString to QGraphicsTextItem's constructor, or call setHtml()/setPlainText().
QGraphicsTextItem uses the text's formatted size and the associated font to provide a reasonable implementation of boundingRect(), shape(), and contains(). You can set the font by calling setFont().
It is possible to make the item editable by setting the Qt.TextEditable flag using setTextInteractionFlags().
See also QGraphicsSimpleTextItem, QGraphicsPathItem, QGraphicsRectItem, QGraphicsEllipseItem, QGraphicsPixmapItem, QGraphicsPolygonItem, QGraphicsLineItem, and The Graphics View Framework.
The parent argument, if not None, causes self to be owned by Qt instead of PyQt.
The scene argument, if not None, causes self to be owned by Qt instead of PyQt.
Constructs a QGraphicsTextItem. parent is passed to QGraphicsItem's constructor.
See also QGraphicsScene.addItem().
The parent argument, if not None, causes self to be owned by Qt instead of PyQt.
The scene argument, if not None, causes self to be owned by Qt instead of PyQt.
Constructs a QGraphicsTextItem, using text as the default plain text. parent is passed to QGraphicsItem's constructor.
See also QGraphicsScene.addItem().
Adjusts the text item to a reasonable size.
Returns the default text color that is used to for unformatted text.
See also setDefaultTextColor().
Returns the item's text document.
See also setDocument().
Returns the item's font, which is used to render the text.
See also setFont().
Sets the color for unformatted text to col.
See also defaultTextColor().
Sets the text document document on the item.
See also document().
Sets the font used to render the text item to font.
See also font().
Sets the item's text to text, assuming that text is HTML formatted. If the item has keyboard input focus, this function will also call ensureVisible() to ensure that the text is visible in all viewports.
See also toHtml() and hasFocus().
Sets the item's text to text. If the item has keyboard input focus, this function will also call ensureVisible() to ensure that the text is visible in all viewports.
See also toHtml() and hasFocus().
Sets the flags flags to specify how the text item should react to user input.
The default for a QGraphicsTextItem is Qt.NoTextInteraction. Setting a value different to Qt.NoTextInteraction will also set the ItemIsFocusable QGraphicsItem flag.
By default, the text is read-only. To transform the item into an editor, set the Qt.TextEditable flag.
See also textInteractionFlags().
Sets the preferred width for the item's text. If the actual text is wider than the specified width then it will be broken into multiple lines.
If width is set to -1 then the text will not be broken into multiple lines unless it is enforced through an explicit line break or a new paragraph.
The default value is -1.
See also textWidth().
Returns the current text interaction flags.
See also setTextInteractionFlags().
Returns the text width.
See also setTextWidth().
Returns the item's text converted to HTML, or an empty QString if no text has been set.
See also setHtml().
Returns the item's text converted to plain text, or an empty QString if no text has been set.
See also setPlainText().
This signal is emitted when the user clicks on a link on a text item that enables Qt.LinksAccessibleByMouse or Qt.LinksAccessibleByKeyboard. link is the link that was clicked.
See also setTextInteractionFlags().
This signal is emitted when the user hovers over a link on a text item that enables Qt.LinksAccessibleByMouse. link is the link that was hovered over.
See also setTextInteractionFlags().
PyQt 4.3.1 for X11 | Copyright © Riverbank Computing Ltd and Trolltech AS 2007 | Qt 4.3.0 |