~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/q3listboxitem.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/qt3support/itemviews/q3listbox.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3ListBoxItem Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3ListBoxItem Class Reference</h1>
 
21
<p>The Q3ListBoxItem class is the base class of all list box items. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3ListBoxItem&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<p>Inherited by <a href="q3listboxpixmap.html">Q3ListBoxPixmap</a> and <a href="q3listboxtext.html">Q3ListBoxText</a>.</p>
 
25
<ul>
 
26
<li><a href="q3listboxitem-members.html">List of all members, including inherited members</a></li>
 
27
</ul>
 
28
<a name="public-functions"></a>
 
29
<h3>Public Functions</h3>
 
30
<ul>
 
31
<li><div class="fn"/><b><a href="q3listboxitem.html#Q3ListBoxItem">Q3ListBoxItem</a></b> ( Q3ListBox * <i>listbox</i> = 0 )</li>
 
32
<li><div class="fn"/><b><a href="q3listboxitem.html#Q3ListBoxItem-2">Q3ListBoxItem</a></b> ( Q3ListBox * <i>listbox</i>, Q3ListBoxItem * <i>after</i> )</li>
 
33
<li><div class="fn"/>virtual <b><a href="q3listboxitem.html#dtor.Q3ListBoxItem">~Q3ListBoxItem</a></b> ()</li>
 
34
<li><div class="fn"/>bool <b><a href="q3listboxitem.html#current">current</a></b> () const</li>
 
35
<li><div class="fn"/>virtual int <b><a href="q3listboxitem.html#height">height</a></b> ( const Q3ListBox * <i>lb</i> ) const</li>
 
36
<li><div class="fn"/>bool <b><a href="q3listboxitem.html#isCurrent">isCurrent</a></b> () const</li>
 
37
<li><div class="fn"/>bool <b><a href="q3listboxitem.html#isSelectable">isSelectable</a></b> () const</li>
 
38
<li><div class="fn"/>bool <b><a href="q3listboxitem.html#isSelected">isSelected</a></b> () const</li>
 
39
<li><div class="fn"/>Q3ListBox * <b><a href="q3listboxitem.html#listBox">listBox</a></b> () const</li>
 
40
<li><div class="fn"/>Q3ListBoxItem * <b><a href="q3listboxitem.html#next">next</a></b> () const</li>
 
41
<li><div class="fn"/>virtual const QPixmap * <b><a href="q3listboxitem.html#pixmap">pixmap</a></b> () const</li>
 
42
<li><div class="fn"/>Q3ListBoxItem * <b><a href="q3listboxitem.html#prev">prev</a></b> () const</li>
 
43
<li><div class="fn"/>virtual int <b><a href="q3listboxitem.html#rtti">rtti</a></b> () const</li>
 
44
<li><div class="fn"/>bool <b><a href="q3listboxitem.html#selected">selected</a></b> () const</li>
 
45
<li><div class="fn"/>void <b><a href="q3listboxitem.html#setSelectable">setSelectable</a></b> ( bool <i>b</i> )</li>
 
46
<li><div class="fn"/>virtual QString <b><a href="q3listboxitem.html#text">text</a></b> () const</li>
 
47
<li><div class="fn"/>virtual int <b><a href="q3listboxitem.html#width">width</a></b> ( const Q3ListBox * <i>lb</i> ) const</li>
 
48
</ul>
 
49
<a name="protected-functions"></a>
 
50
<h3>Protected Functions</h3>
 
51
<ul>
 
52
<li><div class="fn"/>virtual void <b><a href="q3listboxitem.html#paint">paint</a></b> ( QPainter * <i>p</i> ) = 0</li>
 
53
<li><div class="fn"/>void <b><a href="q3listboxitem.html#setCustomHighlighting">setCustomHighlighting</a></b> ( bool <i>b</i> )</li>
 
54
<li><div class="fn"/>virtual void <b><a href="q3listboxitem.html#setText">setText</a></b> ( const QString &amp; <i>text</i> )</li>
 
55
</ul>
 
56
<a name="details"></a>
 
57
<hr />
 
58
<h2>Detailed Description</h2>
 
59
<p>The Q3ListBoxItem class is the base class of all list box items.</p>
 
60
<p>This class is an abstract base class used for all list box items. If you need to insert customized items into a <a href="q3listbox.html">Q3ListBox</a> you must inherit this class and reimplement <a href="q3listboxitem.html#paint">paint</a>(), <a href="q3listboxitem.html#height">height</a>() and <a href="q3listboxitem.html#width">width</a>().</p>
 
61
<p>See also <a href="q3listbox.html">Q3ListBox</a>.</p>
 
62
<hr />
 
63
<h2>Member Function Documentation</h2>
 
64
<h3 class="fn"><a name="Q3ListBoxItem"></a>Q3ListBoxItem::Q3ListBoxItem ( <a href="q3listbox.html">Q3ListBox</a> * <i>listbox</i> = 0 )</h3>
 
65
<p>Constructs an empty list box item in the list box <i>listbox</i>.</p>
 
66
<h3 class="fn"><a name="Q3ListBoxItem-2"></a>Q3ListBoxItem::Q3ListBoxItem ( <a href="q3listbox.html">Q3ListBox</a> * <i>listbox</i>, Q3ListBoxItem * <i>after</i> )</h3>
 
67
<p>Constructs an empty list box item in the list box <i>listbox</i> and inserts it after the item <i>after</i> or at the beginning if <i>after</i> is 0.</p>
 
68
<h3 class="fn"><a name="dtor.Q3ListBoxItem"></a>Q3ListBoxItem::~Q3ListBoxItem ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
69
<p>Destroys the list box item.</p>
 
70
<h3 class="fn"><a name="current"></a>bool Q3ListBoxItem::current () const</h3>
 
71
<p>Use <a href="q3listboxitem.html#isCurrent">isCurrent</a>() instead.</p>
 
72
<h3 class="fn"><a name="height"></a>int Q3ListBoxItem::height ( const <a href="q3listbox.html">Q3ListBox</a> * <i>lb</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
73
<p>Implement this function to return the height of your item. The <i>lb</i> parameter is the same as <a href="q3listboxitem.html#listBox">listBox</a>() and is provided for convenience and compatibility.</p>
 
74
<p>The default implementation returns <a href="qapplication.html#globalStrut-prop">QApplication::globalStrut</a>()'s height.</p>
 
75
<p>See also <a href="q3listboxitem.html#paint">paint</a>() and <a href="q3listboxitem.html#width">width</a>().</p>
 
76
<h3 class="fn"><a name="isCurrent"></a>bool Q3ListBoxItem::isCurrent () const</h3>
 
77
<p>Returns true if the item is the current item; otherwise returns false.</p>
 
78
<p>See also <a href="q3listbox.html#currentItem-prop">Q3ListBox::currentItem</a>(), <a href="q3listbox.html#item">Q3ListBox::item</a>(), and <a href="q3listboxitem.html#isSelected">isSelected</a>().</p>
 
79
<h3 class="fn"><a name="isSelectable"></a>bool Q3ListBoxItem::isSelectable () const</h3>
 
80
<p>Returns true if this item is selectable (the default); otherwise returns false.</p>
 
81
<p>See also <a href="q3listboxitem.html#setSelectable">setSelectable</a>().</p>
 
82
<h3 class="fn"><a name="isSelected"></a>bool Q3ListBoxItem::isSelected () const</h3>
 
83
<p>Returns true if the item is selected; otherwise returns false.</p>
 
84
<p>See also <a href="q3listbox.html#isSelected">Q3ListBox::isSelected</a>() and <a href="q3listboxitem.html#isCurrent">isCurrent</a>().</p>
 
85
<h3 class="fn"><a name="listBox"></a><a href="q3listbox.html">Q3ListBox</a> * Q3ListBoxItem::listBox () const</h3>
 
86
<p>Returns a pointer to the list box containing this item.</p>
 
87
<h3 class="fn"><a name="next"></a>Q3ListBoxItem * Q3ListBoxItem::next () const</h3>
 
88
<p>Returns the item that comes after this in the list box. If this is the last item, 0 is returned.</p>
 
89
<p>See also <a href="q3listboxitem.html#prev">prev</a>().</p>
 
90
<h3 class="fn"><a name="paint"></a>void Q3ListBoxItem::paint ( <a href="qpainter.html">QPainter</a> * <i>p</i> )&nbsp;&nbsp;<tt> [pure virtual protected]</tt></h3>
 
91
<p>Implement this function to draw your item. The painter, <i>p</i>, is already open for painting.</p>
 
92
<p>See also <a href="q3listboxitem.html#height">height</a>() and <a href="q3listboxitem.html#width">width</a>().</p>
 
93
<h3 class="fn"><a name="pixmap"></a>const <a href="qpixmap.html">QPixmap</a> * Q3ListBoxItem::pixmap () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
94
<p>Returns the pixmap associated with the item, or 0 if there isn't one.</p>
 
95
<p>The default implementation returns 0.</p>
 
96
<h3 class="fn"><a name="prev"></a>Q3ListBoxItem * Q3ListBoxItem::prev () const</h3>
 
97
<p>Returns the item which comes before this in the list box. If this is the first item, 0 is returned.</p>
 
98
<p>See also <a href="q3listboxitem.html#next">next</a>().</p>
 
99
<h3 class="fn"><a name="rtti"></a>int Q3ListBoxItem::rtti () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
100
<p>Returns 0.</p>
 
101
<p>Make your derived classes return their own values for rtti(), and you can distinguish between listbox items. You should use values greater than 1000 preferably a large random number, to allow for extensions to this class.</p>
 
102
<h3 class="fn"><a name="selected"></a>bool Q3ListBoxItem::selected () const</h3>
 
103
<p>Use <a href="q3listboxitem.html#isSelected">isSelected</a>() instead.</p>
 
104
<h3 class="fn"><a name="setCustomHighlighting"></a>void Q3ListBoxItem::setCustomHighlighting ( bool <i>b</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
105
<p>Defines whether the list box item is responsible for drawing itself in a highlighted state when being selected.</p>
 
106
<p>If <i>b</i> is false (the default), the list box will draw some default highlight indicator before calling <a href="q3listboxitem.html#paint">paint</a>().</p>
 
107
<p>See also <a href="q3listboxitem.html#isSelected">isSelected</a>() and <a href="q3listboxitem.html#paint">paint</a>().</p>
 
108
<h3 class="fn"><a name="setSelectable"></a>void Q3ListBoxItem::setSelectable ( bool <i>b</i> )</h3>
 
109
<p>If <i>b</i> is true (the default) then this item can be selected by the user; otherwise this item cannot be selected by the user.</p>
 
110
<p>See also <a href="q3listboxitem.html#isSelectable">isSelectable</a>().</p>
 
111
<h3 class="fn"><a name="setText"></a>void Q3ListBoxItem::setText ( const <a href="qstring.html">QString</a> &amp; <i>text</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
112
<p>Sets the text of the <a href="q3listboxitem.html">Q3ListBoxItem</a> to <i>text</i>. This <i>text</i> is also used for sorting. The text is not shown unless explicitly drawn in <a href="q3listboxitem.html#paint">paint</a>().</p>
 
113
<p>See also <a href="q3listboxitem.html#text">text</a>().</p>
 
114
<h3 class="fn"><a name="text"></a><a href="qstring.html">QString</a> Q3ListBoxItem::text () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
115
<p>Returns the text of the item. This text is also used for sorting.</p>
 
116
<p>See also <a href="q3listboxitem.html#setText">setText</a>().</p>
 
117
<h3 class="fn"><a name="width"></a>int Q3ListBoxItem::width ( const <a href="q3listbox.html">Q3ListBox</a> * <i>lb</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
118
<p>Reimplement this function to return the width of your item. The <i>lb</i> parameter is the same as <a href="q3listboxitem.html#listBox">listBox</a>() and is provided for convenience and compatibility.</p>
 
119
<p>The default implementation returns <a href="qapplication.html#globalStrut-prop">QApplication::globalStrut</a>()'s width.</p>
 
120
<p>See also <a href="q3listboxitem.html#paint">paint</a>() and <a href="q3listboxitem.html#height">height</a>().</p>
 
121
<p /><address><hr /><div align="center">
 
122
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
123
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
124
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
125
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
126
</tr></table></div></address></body>
 
127
</html>