File: qgraphicstextitem.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (141 lines) | stat: -rw-r--r-- 30,448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QGraphicsTextItem Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QGraphicsTextItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QGraphicsTextItem class provides a text item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a> to display formatted text. <a href="#details">More...</a></p>
<p>Inherits <a href="qgraphicsobject.html">QGraphicsObject</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qgraphicstextitem.html#QGraphicsTextItem">__init__</a></b> (<i>self</i>, QGraphicsItem&#160;<i>parent</i>&#160;=&#160;None, QGraphicsScene&#160;<i>scene</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#QGraphicsTextItem-2">__init__</a></b> (<i>self</i>, QString, QGraphicsItem&#160;<i>parent</i>&#160;=&#160;None, QGraphicsScene&#160;<i>scene</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#adjustSize">adjustSize</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicstextitem.html#boundingRect">boundingRect</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicstextitem.html#contains">contains</a></b> (<i>self</i>, QPointF)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#contextMenuEvent">contextMenuEvent</a></b> (<i>self</i>, QGraphicsSceneContextMenuEvent)</li><li><div class="fn" />QColor <b><a href="qgraphicstextitem.html#defaultTextColor">defaultTextColor</a></b> (<i>self</i>)</li><li><div class="fn" />QTextDocument <b><a href="qgraphicstextitem.html#document">document</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#dragEnterEvent">dragEnterEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#dragLeaveEvent">dragLeaveEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#dragMoveEvent">dragMoveEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#dropEvent">dropEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#focusInEvent">focusInEvent</a></b> (<i>self</i>, QFocusEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#focusOutEvent">focusOutEvent</a></b> (<i>self</i>, QFocusEvent)</li><li><div class="fn" />QFont <b><a href="qgraphicstextitem.html#font">font</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#hoverEnterEvent">hoverEnterEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#hoverLeaveEvent">hoverLeaveEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#hoverMoveEvent">hoverMoveEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#inputMethodEvent">inputMethodEvent</a></b> (<i>self</i>, QInputMethodEvent)</li><li><div class="fn" />QVariant <b><a href="qgraphicstextitem.html#inputMethodQuery">inputMethodQuery</a></b> (<i>self</i>, Qt.InputMethodQuery)</li><li><div class="fn" />bool <b><a href="qgraphicstextitem.html#isObscuredBy">isObscuredBy</a></b> (<i>self</i>, QGraphicsItem)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#keyReleaseEvent">keyReleaseEvent</a></b> (<i>self</i>, QKeyEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicstextitem.html#opaqueArea">opaqueArea</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicstextitem.html#openExternalLinks">openExternalLinks</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#paint">paint</a></b> (<i>self</i>, QPainter, QStyleOptionGraphicsItem, QWidget)</li><li><div class="fn" />bool <b><a href="qgraphicstextitem.html#sceneEvent">sceneEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setDefaultTextColor">setDefaultTextColor</a></b> (<i>self</i>, QColor)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setDocument">setDocument</a></b> (<i>self</i>, QTextDocument)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setFont">setFont</a></b> (<i>self</i>, QFont)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setHtml">setHtml</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setOpenExternalLinks">setOpenExternalLinks</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setPlainText">setPlainText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setTabChangesFocus">setTabChangesFocus</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setTextCursor">setTextCursor</a></b> (<i>self</i>, QTextCursor)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setTextInteractionFlags">setTextInteractionFlags</a></b> (<i>self</i>, Qt.TextInteractionFlags)</li><li><div class="fn" /><b><a href="qgraphicstextitem.html#setTextWidth">setTextWidth</a></b> (<i>self</i>, float)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicstextitem.html#shape">shape</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicstextitem.html#tabChangesFocus">tabChangesFocus</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCursor <b><a href="qgraphicstextitem.html#textCursor">textCursor</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.TextInteractionFlags <b><a href="qgraphicstextitem.html#textInteractionFlags">textInteractionFlags</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicstextitem.html#textWidth">textWidth</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qgraphicstextitem.html#toHtml">toHtml</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qgraphicstextitem.html#toPlainText">toPlainText</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qgraphicstextitem.html#type">type</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qgraphicstextitem.html#linkActivated">linkActivated</a></b> (const QString&amp;)</li><li><div class="fn" />void <b><a href="qgraphicstextitem.html#linkHovered">linkHovered</a></b> (const QString&amp;)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGraphicsTextItem class provides a text item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a> to display formatted text.</p>
<p>If you only need to show plain text in an item, consider using <a href="qgraphicssimpletextitem.html">QGraphicsSimpleTextItem</a> instead.</p>
<p>To set the item's text, pass a <a href="qstring.html">QString</a> to QGraphicsTextItem's constructor, or call <a href="qgraphicstextitem.html#setHtml">setHtml</a>()/<a href="qgraphicstextitem.html#setPlainText">setPlainText</a>().</p>
<p>QGraphicsTextItem uses the text's formatted size and the associated font to provide a reasonable implementation of <a href="qgraphicstextitem.html#boundingRect">boundingRect</a>(), <a href="qgraphicstextitem.html#shape">shape</a>(), and <a href="qgraphicstextitem.html#contains">contains</a>(). You can set the font by calling <a href="qgraphicstextitem.html#setFont">setFont</a>().</p>
<p>It is possible to make the item editable by setting the <a href="qt.html#TextInteractionFlag-enum">Qt.TextEditorInteraction</a> flag using <a href="qgraphicstextitem.html#setTextInteractionFlags">setTextInteractionFlags</a>().</p>
<p>The item's preferred text width can be set using <a href="qgraphicstextitem.html#setTextWidth">setTextWidth</a>() and obtained using <a href="qgraphicstextitem.html#textWidth">textWidth</a>().</p>
<p><b>Note:</b> In order to align HTML text in the center, the item's text width must be set.</p>
<p align="center"><img src="images/graphicsview-textitem.png" /></p><p><b>Note:</b> QGraphicsTextItem accepts <a href="qgraphicsitem.html#acceptHoverEvents">hover events</a> by default. You can change this with <a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents()</a>.</p>
<p>See also <a href="qgraphicssimpletextitem.html">QGraphicsSimpleTextItem</a>, <a href="qgraphicspathitem.html">QGraphicsPathItem</a>, <a href="qgraphicsrectitem.html">QGraphicsRectItem</a>, <a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a>, <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>, <a href="qgraphicspolygonitem.html">QGraphicsPolygonItem</a>, <a href="qgraphicslineitem.html">QGraphicsLineItem</a>, and <a href="graphicsview.html">The Graphics View Framework</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGraphicsTextItem" />QGraphicsTextItem.__init__ (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qgraphicsscene.html">QGraphicsScene</a>&#160;<i>scene</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>The <i>scene</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qgraphicstextitem.html">QGraphicsTextItem</a>. <i>parent</i> is passed to <a href="qgraphicsitem.html">QGraphicsItem</a>'s constructor.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>().</p>
<h3 class="fn"><a name="QGraphicsTextItem-2" />QGraphicsTextItem.__init__ (<i>self</i>, QString, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qgraphicsscene.html">QGraphicsScene</a>&#160;<i>scene</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>The <i>scene</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qgraphicstextitem.html">QGraphicsTextItem</a>, using <i>text</i> as the default plain text. <i>parent</i> is passed to <a href="qgraphicsitem.html">QGraphicsItem</a>'s constructor.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/~QGraphicsTextItem" />
<h3 class="fn"><a name="adjustSize" />QGraphicsTextItem.adjustSize (<i>self</i>)</h3><p>Adjusts the text item to a reasonable size.</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/boundingRect" />
<h3 class="fn"><a name="boundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsTextItem.boundingRect (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#boundingRect">QGraphicsItem.boundingRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/contains" />
<h3 class="fn"><a name="contains" />bool QGraphicsTextItem.contains (<i>self</i>, <a href="qpointf.html">QPointF</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#contains">QGraphicsItem.contains</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/contextMenuEvent" />
<h3 class="fn"><a name="contextMenuEvent" />QGraphicsTextItem.contextMenuEvent (<i>self</i>, <a href="qgraphicsscenecontextmenuevent.html">QGraphicsSceneContextMenuEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#contextMenuEvent">QGraphicsItem.contextMenuEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/defaultTextColor" />
<h3 class="fn"><a name="defaultTextColor" /><a href="qcolor.html">QColor</a> QGraphicsTextItem.defaultTextColor (<i>self</i>)</h3><p>Returns the default text color that is used to for unformatted text.</p>
<p>See also <a href="qgraphicstextitem.html#setDefaultTextColor">setDefaultTextColor</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/document" />
<h3 class="fn"><a name="document" /><a href="qtextdocument.html">QTextDocument</a> QGraphicsTextItem.document (<i>self</i>)</h3><p>Returns the item's text document.</p>
<p>See also <a href="qgraphicstextitem.html#setDocument">setDocument</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/dragEnterEvent" />
<h3 class="fn"><a name="dragEnterEvent" />QGraphicsTextItem.dragEnterEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#dragEnterEvent">QGraphicsItem.dragEnterEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/dragLeaveEvent" />
<h3 class="fn"><a name="dragLeaveEvent" />QGraphicsTextItem.dragLeaveEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#dragLeaveEvent">QGraphicsItem.dragLeaveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/dragMoveEvent" />
<h3 class="fn"><a name="dragMoveEvent" />QGraphicsTextItem.dragMoveEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#dragMoveEvent">QGraphicsItem.dragMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/dropEvent" />
<h3 class="fn"><a name="dropEvent" />QGraphicsTextItem.dropEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#dropEvent">QGraphicsItem.dropEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/focusInEvent" />
<h3 class="fn"><a name="focusInEvent" />QGraphicsTextItem.focusInEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#focusInEvent">QGraphicsItem.focusInEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/focusOutEvent" />
<h3 class="fn"><a name="focusOutEvent" />QGraphicsTextItem.focusOutEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#focusOutEvent">QGraphicsItem.focusOutEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/font" />
<h3 class="fn"><a name="font" /><a href="qfont.html">QFont</a> QGraphicsTextItem.font (<i>self</i>)</h3><p>Returns the item's font, which is used to render the text.</p>
<p>See also <a href="qgraphicstextitem.html#setFont">setFont</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/hoverEnterEvent" />
<h3 class="fn"><a name="hoverEnterEvent" />QGraphicsTextItem.hoverEnterEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#hoverEnterEvent">QGraphicsItem.hoverEnterEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/hoverLeaveEvent" />
<h3 class="fn"><a name="hoverLeaveEvent" />QGraphicsTextItem.hoverLeaveEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#hoverLeaveEvent">QGraphicsItem.hoverLeaveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/hoverMoveEvent" />
<h3 class="fn"><a name="hoverMoveEvent" />QGraphicsTextItem.hoverMoveEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#hoverMoveEvent">QGraphicsItem.hoverMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/inputMethodEvent" />
<h3 class="fn"><a name="inputMethodEvent" />QGraphicsTextItem.inputMethodEvent (<i>self</i>, <a href="qinputmethodevent.html">QInputMethodEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#inputMethodEvent">QGraphicsItem.inputMethodEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/inputMethodQuery" />
<h3 class="fn"><a name="inputMethodQuery" />QVariant QGraphicsTextItem.inputMethodQuery (<i>self</i>, <a href="qt.html#InputMethodQuery-enum">Qt.InputMethodQuery</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#inputMethodQuery">QGraphicsItem.inputMethodQuery</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/isObscuredBy" />
<h3 class="fn"><a name="isObscuredBy" />bool QGraphicsTextItem.isObscuredBy (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#isObscuredBy">QGraphicsItem.isObscuredBy</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/keyPressEvent" />
<h3 class="fn"><a name="keyPressEvent" />QGraphicsTextItem.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#keyPressEvent">QGraphicsItem.keyPressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/keyReleaseEvent" />
<h3 class="fn"><a name="keyReleaseEvent" />QGraphicsTextItem.keyReleaseEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#keyReleaseEvent">QGraphicsItem.keyReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/linkActivated" />
<h3 class="fn"><a name="mouseDoubleClickEvent" />QGraphicsTextItem.mouseDoubleClickEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#mouseDoubleClickEvent">QGraphicsItem.mouseDoubleClickEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/mouseMoveEvent" />
<h3 class="fn"><a name="mouseMoveEvent" />QGraphicsTextItem.mouseMoveEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#mouseMoveEvent">QGraphicsItem.mouseMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/mousePressEvent" />
<h3 class="fn"><a name="mousePressEvent" />QGraphicsTextItem.mousePressEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#mousePressEvent">QGraphicsItem.mousePressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/mouseReleaseEvent" />
<h3 class="fn"><a name="mouseReleaseEvent" />QGraphicsTextItem.mouseReleaseEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#mouseReleaseEvent">QGraphicsItem.mouseReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/opaqueArea" />
<h3 class="fn"><a name="opaqueArea" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsTextItem.opaqueArea (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#opaqueArea">QGraphicsItem.opaqueArea</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/paint" />
<h3 class="fn"><a name="openExternalLinks" />bool QGraphicsTextItem.openExternalLinks (<i>self</i>)</h3><h3 class="fn"><a name="paint" />QGraphicsTextItem.paint (<i>self</i>, <a href="qpainter.html">QPainter</a>, <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>, <a href="qwidget.html">QWidget</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem.paint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/sceneEvent" />
<h3 class="fn"><a name="sceneEvent" />bool QGraphicsTextItem.sceneEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#sceneEvent">QGraphicsItem.sceneEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/setDefaultTextColor" />
<h3 class="fn"><a name="setDefaultTextColor" />QGraphicsTextItem.setDefaultTextColor (<i>self</i>, <a href="qcolor.html">QColor</a>)</h3><p>Sets the color for unformatted text to <i>col</i>.</p>
<p>See also <a href="qgraphicstextitem.html#defaultTextColor">defaultTextColor</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/setDocument" />
<h3 class="fn"><a name="setDocument" />QGraphicsTextItem.setDocument (<i>self</i>, <a href="qtextdocument.html">QTextDocument</a>)</h3><p>Sets the text document <i>document</i> on the item.</p>
<p>See also <a href="qgraphicstextitem.html#document">document</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/setFont" />
<h3 class="fn"><a name="setFont" />QGraphicsTextItem.setFont (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>Sets the font used to render the text item to <i>font</i>.</p>
<p>See also <a href="qgraphicstextitem.html#font">font</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/setHtml" />
<h3 class="fn"><a name="setHtml" />QGraphicsTextItem.setHtml (<i>self</i>, QString)</h3><p>Sets the item's text to <i>text</i>, assuming that text is HTML formatted. If the item has keyboard input focus, this function will also call <a href="qgraphicsitem.html#ensureVisible">ensureVisible</a>() to ensure that the text is visible in all viewports.</p>
<p>See also <a href="qgraphicstextitem.html#toHtml">toHtml</a>(), <a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), and <a href="qgraphicssimpletextitem.html">QGraphicsSimpleTextItem</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/setPlainText" />
<h3 class="fn"><a name="setOpenExternalLinks" />QGraphicsTextItem.setOpenExternalLinks (<i>self</i>, bool)</h3><h3 class="fn"><a name="setPlainText" />QGraphicsTextItem.setPlainText (<i>self</i>, QString)</h3><p>Sets the item's text to <i>text</i>. If the item has keyboard input focus, this function will also call <a href="qgraphicsitem.html#ensureVisible">ensureVisible</a>() to ensure that the text is visible in all viewports.</p>
<p>See also <a href="qgraphicstextitem.html#toHtml">toHtml</a>() and <a href="qgraphicsitem.html#hasFocus">hasFocus</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/setTabChangesFocus" />
<h3 class="fn"><a name="setTabChangesFocus" />QGraphicsTextItem.setTabChangesFocus (<i>self</i>, bool)</h3><p>If <i>b</i> is true, the <b>Tab</b> key will cause the widget to change focus; otherwise, the tab key will insert a tab into the document.</p>
<p>In some occasions text edits should not allow the user to input tabulators or change indentation using the <b>Tab</b> key, as this breaks the focus chain. The default is false.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicstextitem.html#tabChangesFocus">tabChangesFocus</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>, and <a href="qgraphicstextitem.html#textInteractionFlags">textInteractionFlags</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/setTextInteractionFlags" />
<h3 class="fn"><a name="setTextCursor" />QGraphicsTextItem.setTextCursor (<i>self</i>, <a href="qtextcursor.html">QTextCursor</a>)</h3><h3 class="fn"><a name="setTextInteractionFlags" />QGraphicsTextItem.setTextInteractionFlags (<i>self</i>, <a href="qt-textinteractionflags.html">Qt.TextInteractionFlags</a>)</h3><p>Sets the flags <i>flags</i> to specify how the text item should react to user input.</p>
<p>The default for a <a href="qgraphicstextitem.html">QGraphicsTextItem</a> is <a href="qt.html#TextInteractionFlag-enum">Qt.NoTextInteraction</a>. This function also affects the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> <a href="qgraphicsitem.html">QGraphicsItem</a> flag by setting it if <i>flags</i> is different from <a href="qt.html#TextInteractionFlag-enum">Qt.NoTextInteraction</a> and clearing it otherwise.</p>
<p>By default, the text is read-only. To transform the item into an editor, set the <a href="qt.html#TextInteractionFlag-enum">Qt.TextEditable</a> flag.</p>
<p>See also <a href="qgraphicstextitem.html#textInteractionFlags">textInteractionFlags</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/setTextWidth" />
<h3 class="fn"><a name="setTextWidth" />QGraphicsTextItem.setTextWidth (<i>self</i>, float)</h3><p>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.</p>
<p>If <i>width</i> 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.</p>
<p>The default value is -1.</p>
<p>Note that <a href="qgraphicstextitem.html">QGraphicsTextItem</a> keeps a <a href="qtextdocument.html">QTextDocument</a> internally, which is used to calculate the text width.</p>
<p>See also <a href="qgraphicstextitem.html#textWidth">textWidth</a>() and <a href="qtextdocument.html#textWidth-prop">QTextDocument.setTextWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/shape" />
<h3 class="fn"><a name="shape" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsTextItem.shape (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#shape">QGraphicsItem.shape</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/tabChangesFocus" />
<h3 class="fn"><a name="tabChangesFocus" />bool QGraphicsTextItem.tabChangesFocus (<i>self</i>)</h3><p>Returns true if the <b>Tab</b> key will cause the widget to change focus; otherwise, false is returned.</p>
<p>By default, this behavior is disabled, and this function will return false.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicstextitem.html#setTabChangesFocus">setTabChangesFocus</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/textInteractionFlags" />
<h3 class="fn"><a name="textCursor" /><a href="qtextcursor.html">QTextCursor</a> QGraphicsTextItem.textCursor (<i>self</i>)</h3><h3 class="fn"><a name="textInteractionFlags" /><a href="qt-textinteractionflags.html">Qt.TextInteractionFlags</a> QGraphicsTextItem.textInteractionFlags (<i>self</i>)</h3><p>Returns the current text interaction flags.</p>
<p>See also <a href="qgraphicstextitem.html#setTextInteractionFlags">setTextInteractionFlags</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/textWidth" />
<h3 class="fn"><a name="textWidth" />float QGraphicsTextItem.textWidth (<i>self</i>)</h3><p>Returns the text width.</p>
<p>The width is calculated with the <a href="qtextdocument.html">QTextDocument</a> that <a href="qgraphicstextitem.html">QGraphicsTextItem</a> keeps internally.</p>
<p>See also <a href="qgraphicstextitem.html#setTextWidth">setTextWidth</a>() and <a href="qtextdocument.html#textWidth-prop">QTextDocument.textWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/toHtml" />
<h3 class="fn"><a name="toHtml" />QString QGraphicsTextItem.toHtml (<i>self</i>)</h3><p>Returns the item's text converted to HTML, or an empty <a href="qstring.html">QString</a> if no text has been set.</p>
<p>See also <a href="qgraphicstextitem.html#setHtml">setHtml</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/toPlainText" />
<h3 class="fn"><a name="toPlainText" />QString QGraphicsTextItem.toPlainText (<i>self</i>)</h3><p>Returns the item's text converted to plain text, or an empty <a href="qstring.html">QString</a> if no text has been set.</p>
<p>See also <a href="qgraphicstextitem.html#setPlainText">setPlainText</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/type" />
<h3 class="fn"><a name="type" />int QGraphicsTextItem.type (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#type">QGraphicsItem.type</a>().</p>
<p /><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="linkActivated" />void linkActivated (const QString&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the user clicks on a link on a text item that enables <a href="qt.html#TextInteractionFlag-enum">Qt.LinksAccessibleByMouse</a> or <a href="qt.html#TextInteractionFlag-enum">Qt.LinksAccessibleByKeyboard</a>. <i>link</i> is the link that was clicked.</p>
<p>See also <a href="qgraphicstextitem.html#setTextInteractionFlags">setTextInteractionFlags</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/linkHovered" />
<h3 class="fn"><a name="linkHovered" />void linkHovered (const QString&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the user hovers over a link on a text item that enables <a href="qt.html#TextInteractionFlag-enum">Qt.LinksAccessibleByMouse</a>. <i>link</i> is the link that was hovered over.</p>
<p>See also <a href="qgraphicstextitem.html#setTextInteractionFlags">setTextInteractionFlags</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsTextItem/mouseDoubleClickEvent" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>