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 142
|
<?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>QStyleOptionViewItem 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">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QStyleOptionViewItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QStyleOptionViewItem class is used to describe the
parameters used to draw an item in a view widget. <a href="#details">More...</a></p>
<p>Inherits <a href="qstyleoption.html">QStyleOption</a>.</p><p>Inherited by <a href="qstyleoptionviewitemv2.html">QStyleOptionViewItemV2</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qstyleoptionviewitem.html#Position-enum">Position</a></b> { Left, Right, Top, Bottom }</li><li><div class="fn" />enum <b><a href="qstyleoptionviewitem.html#StyleOptionType-enum">StyleOptionType</a></b> { Type }</li><li><div class="fn" />enum <b><a href="qstyleoptionviewitem.html#StyleOptionVersion-enum">StyleOptionVersion</a></b> { Version }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qstyleoptionviewitem.html#QStyleOptionViewItem">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qstyleoptionviewitem.html#QStyleOptionViewItem-2">__init__</a></b> (<i>self</i>, QStyleOptionViewItem <i>other</i>)</li></ul><h3>Members</h3><ul><li><div class="fn" />Qt.Alignment <b><a href="qstyleoptionviewitem.html#decorationAlignment-var">decorationAlignment</a></b></li><li><div class="fn" />Position <b><a href="qstyleoptionviewitem.html#decorationPosition-var">decorationPosition</a></b></li><li><div class="fn" />QSize <b><a href="qstyleoptionviewitem.html#decorationSize-var">decorationSize</a></b></li><li><div class="fn" />Qt.Alignment <b><a href="qstyleoptionviewitem.html#displayAlignment-var">displayAlignment</a></b></li><li><div class="fn" />QFont <b><a href="qstyleoptionviewitem.html#font-var">font</a></b></li><li><div class="fn" />bool <b><a href="qstyleoptionviewitem.html#showDecorationSelected-var">showDecorationSelected</a></b></li><li><div class="fn" />Qt.TextElideMode <b><a href="qstyleoptionviewitem.html#textElideMode-var">textElideMode</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QStyleOptionViewItem class is used to describe the
parameters used to draw an item in a view widget.</p>
<p>QStyleOptionViewItem contains all the information that <a href="qstyle.html">QStyle</a> functions need to draw the items for Qt's
model/view classes.</p>
<p>For performance reasons, the access to the member variables is
direct (i.e., using the <tt>.</tt> or <tt>-></tt> operator).
This low-level feel makes the structures straightforward to use and
emphasizes that these are simply parameters used by the style
functions.</p>
<p>For an example demonstrating how style options can be used, see
the <a href="widgets-styles.html">Styles</a> example.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Position-enum" />QStyleOptionViewItem.Position</h3><p>This enum describes the position of the item's decoration.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Left</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">On the left of the text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Right</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">On the right of the text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Top</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Above the text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Bottom</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Below the text.</td>
</tr>
</table>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#decorationPosition-var">decorationPosition</a>.</p>
<h3 class="fn"><a name="StyleOptionType-enum" />QStyleOptionViewItem.StyleOptionType</h3><p>This enum is used to hold information about the type of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Type</tt></td>
<td class="topAlign"><tt>SO_ViewItem</tt></td>
<td class="topAlign">The type of style option provided (<a href="qstyleoption.html#OptionType-enum">SO_ViewItem</a> for this
class).</td>
</tr>
</table>
<p>The type is used internally by <a href="qstyleoption.html">QStyleOption</a>, its subclasses, and <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to
determine the type of style option. In general you do not need to
worry about this unless you want to create your own <a href="qstyleoption.html">QStyleOption</a> subclass and your own
styles.</p>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#StyleOptionVersion-enum">StyleOptionVersion</a>.</p>
<h3 class="fn"><a name="StyleOptionVersion-enum" />QStyleOptionViewItem.StyleOptionVersion</h3><p>This enum is used to hold information about the version of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Version</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">1</td>
</tr>
</table>
<p>The version is used by <a href="qstyleoption.html">QStyleOption</a> subclasses to implement
extensions without breaking compatibility. If you use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>(), you
normally do not need to check it.</p>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#StyleOptionType-enum">StyleOptionType</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QStyleOptionViewItem" />QStyleOptionViewItem.__init__ (<i>self</i>)</h3><p>Constructs a <a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a>, initializing
the members variables to their default values.</p>
<h3 class="fn"><a name="QStyleOptionViewItem-2" />QStyleOptionViewItem.__init__ (<i>self</i>, <a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a> <i>other</i>)</h3><p>Constructs a copy of the <i>other</i> style option.</p>
<hr /><h2>Member Documentation</h2><h3 class="fn"><a name="decorationAlignment-var" /><a href="qt-alignment.html">Qt.Alignment</a> decorationAlignment</h3><p>This variable holds the alignment of the decoration for the
item.</p>
<p>The default value is <a href="qt.html#AlignmentFlag-enum">Qt.AlignLeft</a>.</p>
<h3 class="fn"><a name="decorationPosition-var" /><a href="qstyleoptionviewitem.html#Position-enum">Position</a> decorationPosition</h3><p>This variable holds the position of the decoration for the
item.</p>
<p>The default value is <a href="qstyleoptionviewitem.html#Position-enum">Left</a>.</p>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#Position-enum">Position</a>.</p>
<h3 class="fn"><a name="decorationSize-var" /><a href="qsize.html">QSize</a> decorationSize</h3><p>This variable holds the size of the decoration for the item.</p>
<p>The default value is <a href="qsize.html">QSize</a>(-1, -1),
i.e. an invalid size.</p>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#decorationAlignment-var">decorationAlignment</a>
and <a href="qstyleoptionviewitem.html#decorationPosition-var">decorationPosition</a>.</p>
<h3 class="fn"><a name="displayAlignment-var" /><a href="qt-alignment.html">Qt.Alignment</a> displayAlignment</h3><p>This variable holds the alignment of the display value for the
item.</p>
<p>The default value is <a href="qt.html#AlignmentFlag-enum">Qt.AlignLeft</a>.</p>
<h3 class="fn"><a name="font-var" /><a href="qfont.html">QFont</a> font</h3><p>This variable holds the font used for the item.</p>
<p>By default, the application's default font is used.</p>
<p><b>See also</b> <a href="qfont.html">QFont</a>.</p>
<h3 class="fn"><a name="showDecorationSelected-var" />bool showDecorationSelected</h3><p>This variable holds whether the decoration should be highlighted
on selected items.</p>
<p>If this option is true, the branch and any decorations on
selected items should be highlighted, indicating that the item is
selected; otherwise, no highlighting is required. The default value
is false.</p>
<p><b>See also</b> <a href="qstyle.html#StyleHint-enum">QStyle.SH_ItemView_ShowDecorationSelected</a>
and <a href="qabstractitemview.html">QAbstractItemView</a>.</p>
<h3 class="fn"><a name="textElideMode-var" /><a href="qt.html#TextElideMode-enum">Qt.TextElideMode</a> textElideMode</h3><p>This variable holds where ellipsis should be added for text that
is too long to fit into an item.</p>
<p>The default value is <a href="qt.html#TextElideMode-enum">Qt.ElideMiddle</a>, i.e. the ellipsis
appears in the middle of the text.</p>
<p><b>See also</b> <a href="qt.html#TextElideMode-enum">Qt.TextElideMode</a> and <a href="qstyle.html#StyleHint-enum">QStyle.SH_ItemView_EllipsisLocation</a>.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|