You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/html/qlistview.html

1232 lines
84 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qlistview.cpp:2407 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQListView Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQListView Class Reference</h1>
<p>The TQListView class implements a list/tree view.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qlistview-h.html">qlistview.h</a>&gt;</tt>
<p>Inherits <a href="qscrollview.html">TQScrollView</a>.
<p><a href="qlistview-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQListView"><b>TQListView</b></a> ( TQWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )</li>
<li class=fn><a href="#~TQListView"><b>~TQListView</b></a> ()</li>
<li class=fn>int <a href="#treeStepSize"><b>treeStepSize</b></a> () const</li>
<li class=fn>virtual void <a href="#setTreeStepSize"><b>setTreeStepSize</b></a> ( int )</li>
<li class=fn>virtual void <a href="#insertItem"><b>insertItem</b></a> ( TQListViewItem&nbsp;*&nbsp;i )</li>
<li class=fn>virtual void <a href="#takeItem"><b>takeItem</b></a> ( TQListViewItem&nbsp;*&nbsp;i )</li>
<li class=fn>virtual void removeItem ( TQListViewItem&nbsp;*&nbsp;item ) &nbsp;<em>(obsolete)</em></li>
<li class=fn>TQHeader * <a href="#header"><b>header</b></a> () const</li>
<li class=fn>virtual int <a href="#addColumn"><b>addColumn</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;label, int&nbsp;width = -1 )</li>
<li class=fn>virtual int <a href="#addColumn-2"><b>addColumn</b></a> ( const&nbsp;TQIconSet&nbsp;&amp;&nbsp;iconset, const&nbsp;TQString&nbsp;&amp;&nbsp;label, int&nbsp;width = -1 )</li>
<li class=fn>virtual void <a href="#removeColumn"><b>removeColumn</b></a> ( int&nbsp;index )</li>
<li class=fn>virtual void <a href="#setColumnText"><b>setColumnText</b></a> ( int&nbsp;column, const&nbsp;TQString&nbsp;&amp;&nbsp;label )</li>
<li class=fn>virtual void <a href="#setColumnText-2"><b>setColumnText</b></a> ( int&nbsp;column, const&nbsp;TQIconSet&nbsp;&amp;&nbsp;iconset, const&nbsp;TQString&nbsp;&amp;&nbsp;label )</li>
<li class=fn>TQString <a href="#columnText"><b>columnText</b></a> ( int&nbsp;c ) const</li>
<li class=fn>virtual void <a href="#setColumnWidth"><b>setColumnWidth</b></a> ( int&nbsp;column, int&nbsp;w )</li>
<li class=fn>int <a href="#columnWidth"><b>columnWidth</b></a> ( int&nbsp;c ) const</li>
<li class=fn>enum <a href="#WidthMode-enum"><b>WidthMode</b></a> { Manual, Maximum }</li>
<li class=fn>virtual void <a href="#setColumnWidthMode"><b>setColumnWidthMode</b></a> ( int&nbsp;c, WidthMode&nbsp;mode )</li>
<li class=fn>WidthMode <a href="#columnWidthMode"><b>columnWidthMode</b></a> ( int&nbsp;c ) const</li>
<li class=fn>int <a href="#columns"><b>columns</b></a> () const</li>
<li class=fn>virtual void <a href="#setColumnAlignment"><b>setColumnAlignment</b></a> ( int&nbsp;column, int&nbsp;align )</li>
<li class=fn>int <a href="#columnAlignment"><b>columnAlignment</b></a> ( int&nbsp;column ) const</li>
<li class=fn>TQListViewItem * <a href="#itemAt"><b>itemAt</b></a> ( const&nbsp;TQPoint&nbsp;&amp;&nbsp;viewPos ) const</li>
<li class=fn>TQRect <a href="#itemRect"><b>itemRect</b></a> ( const&nbsp;TQListViewItem&nbsp;*&nbsp;i ) const</li>
<li class=fn>int <a href="#itemPos"><b>itemPos</b></a> ( const&nbsp;TQListViewItem&nbsp;*&nbsp;item )</li>
<li class=fn>void <a href="#ensureItemVisible"><b>ensureItemVisible</b></a> ( const&nbsp;TQListViewItem&nbsp;*&nbsp;i )</li>
<li class=fn>void <a href="#repaintItem"><b>repaintItem</b></a> ( const&nbsp;TQListViewItem&nbsp;*&nbsp;item ) const</li>
<li class=fn>virtual void setMultiSelection ( bool&nbsp;enable ) &nbsp;<em>(obsolete)</em></li>
<li class=fn>bool isMultiSelection () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>enum <a href="#SelectionMode-enum"><b>SelectionMode</b></a> { Single, Multi, Extended, NoSelection }</li>
<li class=fn>void <a href="#setSelectionMode"><b>setSelectionMode</b></a> ( SelectionMode&nbsp;mode )</li>
<li class=fn>SelectionMode <a href="#selectionMode"><b>selectionMode</b></a> () const</li>
<li class=fn>virtual void <a href="#clearSelection"><b>clearSelection</b></a> ()</li>
<li class=fn>virtual void <a href="#setSelected"><b>setSelected</b></a> ( TQListViewItem&nbsp;*&nbsp;item, bool&nbsp;selected )</li>
<li class=fn>void <a href="#setSelectionAnchor"><b>setSelectionAnchor</b></a> ( TQListViewItem&nbsp;*&nbsp;item )</li>
<li class=fn>bool <a href="#isSelected"><b>isSelected</b></a> ( const&nbsp;TQListViewItem&nbsp;*&nbsp;i ) const</li>
<li class=fn>TQListViewItem * <a href="#selectedItem"><b>selectedItem</b></a> () const</li>
<li class=fn>virtual void <a href="#setOpen"><b>setOpen</b></a> ( TQListViewItem&nbsp;*&nbsp;item, bool&nbsp;open )</li>
<li class=fn>bool <a href="#isOpen"><b>isOpen</b></a> ( const&nbsp;TQListViewItem&nbsp;*&nbsp;item ) const</li>
<li class=fn>virtual void <a href="#setCurrentItem"><b>setCurrentItem</b></a> ( TQListViewItem&nbsp;*&nbsp;i )</li>
<li class=fn>TQListViewItem * <a href="#currentItem"><b>currentItem</b></a> () const</li>
<li class=fn>TQListViewItem * <a href="#firstChild"><b>firstChild</b></a> () const</li>
<li class=fn>TQListViewItem * <a href="#lastItem"><b>lastItem</b></a> () const</li>
<li class=fn>int <a href="#childCount"><b>childCount</b></a> () const</li>
<li class=fn>virtual void <a href="#setAllColumnsShowFocus"><b>setAllColumnsShowFocus</b></a> ( bool )</li>
<li class=fn>bool <a href="#allColumnsShowFocus"><b>allColumnsShowFocus</b></a> () const</li>
<li class=fn>virtual void <a href="#setItemMargin"><b>setItemMargin</b></a> ( int )</li>
<li class=fn>int <a href="#itemMargin"><b>itemMargin</b></a> () const</li>
<li class=fn>virtual void <a href="#setRootIsDecorated"><b>setRootIsDecorated</b></a> ( bool )</li>
<li class=fn>bool <a href="#rootIsDecorated"><b>rootIsDecorated</b></a> () const</li>
<li class=fn>virtual void <a href="#setSorting"><b>setSorting</b></a> ( int&nbsp;column, bool&nbsp;ascending = TRUE )</li>
<li class=fn>int <a href="#sortColumn"><b>sortColumn</b></a> () const</li>
<li class=fn>void <a href="#setSortColumn"><b>setSortColumn</b></a> ( int&nbsp;column )</li>
<li class=fn>SortOrder <a href="#sortOrder"><b>sortOrder</b></a> () const</li>
<li class=fn>void <a href="#setSortOrder"><b>setSortOrder</b></a> ( SortOrder&nbsp;order )</li>
<li class=fn>virtual void <a href="#sort"><b>sort</b></a> ()</li>
<li class=fn>virtual bool <a href="#eventFilter"><b>eventFilter</b></a> ( TQObject&nbsp;*&nbsp;o, TQEvent&nbsp;*&nbsp;e )</li>
<li class=fn>virtual void <a href="#setShowSortIndicator"><b>setShowSortIndicator</b></a> ( bool&nbsp;show )</li>
<li class=fn>bool <a href="#showSortIndicator"><b>showSortIndicator</b></a> () const</li>
<li class=fn>virtual void <a href="#setShowToolTips"><b>setShowToolTips</b></a> ( bool&nbsp;b )</li>
<li class=fn>bool <a href="#showToolTips"><b>showToolTips</b></a> () const</li>
<li class=fn>enum <a href="#ResizeMode-enum"><b>ResizeMode</b></a> { NoColumn, AllColumns, LastColumn }</li>
<li class=fn>virtual void <a href="#setResizeMode"><b>setResizeMode</b></a> ( ResizeMode&nbsp;m )</li>
<li class=fn>ResizeMode <a href="#resizeMode"><b>resizeMode</b></a> () const</li>
<li class=fn>TQListViewItem * <a href="#findItem"><b>findItem</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;text, int&nbsp;column, ComparisonFlags&nbsp;compare = ExactMatch | CaseSensitive ) const</li>
<li class=fn>enum <a href="#RenameAction-enum"><b>RenameAction</b></a> { Accept, Reject }</li>
<li class=fn>virtual void <a href="#setDefaultRenameAction"><b>setDefaultRenameAction</b></a> ( RenameAction&nbsp;a )</li>
<li class=fn>RenameAction <a href="#defaultRenameAction"><b>defaultRenameAction</b></a> () const</li>
<li class=fn>bool <a href="#isRenaming"><b>isRenaming</b></a> () const</li>
<li class=fn>void <a href="#hideColumn"><b>hideColumn</b></a> ( int&nbsp;column )</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>virtual void <a href="#clear"><b>clear</b></a> ()</li>
<li class=fn>virtual void <a href="#invertSelection"><b>invertSelection</b></a> ()</li>
<li class=fn>virtual void <a href="#selectAll"><b>selectAll</b></a> ( bool&nbsp;select )</li>
<li class=fn>void <a href="#triggerUpdate"><b>triggerUpdate</b></a> ()</li>
<li class=fn>void <a href="#adjustColumn"><b>adjustColumn</b></a> ( int&nbsp;col )</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#selectionChanged"><b>selectionChanged</b></a> ()</li>
<li class=fn>void <a href="#selectionChanged-2"><b>selectionChanged</b></a> ( TQListViewItem * )</li>
<li class=fn>void <a href="#currentChanged"><b>currentChanged</b></a> ( TQListViewItem * )</li>
<li class=fn>void <a href="#clicked"><b>clicked</b></a> ( TQListViewItem&nbsp;*&nbsp;item )</li>
<li class=fn>void <a href="#clicked-2"><b>clicked</b></a> ( TQListViewItem&nbsp;*&nbsp;item, const&nbsp;TQPoint&nbsp;&amp;&nbsp;pnt, int&nbsp;c )</li>
<li class=fn>void <a href="#pressed"><b>pressed</b></a> ( TQListViewItem&nbsp;*&nbsp;item )</li>
<li class=fn>void <a href="#pressed-2"><b>pressed</b></a> ( TQListViewItem&nbsp;*&nbsp;item, const&nbsp;TQPoint&nbsp;&amp;&nbsp;pnt, int&nbsp;c )</li>
<li class=fn>void doubleClicked ( TQListViewItem&nbsp;*&nbsp;item ) &nbsp;<em>(obsolete)</em></li>
<li class=fn>void <a href="#doubleClicked"><b>doubleClicked</b></a> ( TQListViewItem *, const TQPoint &amp;, int )</li>
<li class=fn>void <a href="#returnPressed"><b>returnPressed</b></a> ( TQListViewItem * )</li>
<li class=fn>void <a href="#spacePressed"><b>spacePressed</b></a> ( TQListViewItem * )</li>
<li class=fn>void <a href="#rightButtonClicked"><b>rightButtonClicked</b></a> ( TQListViewItem *, const TQPoint &amp;, int )</li>
<li class=fn>void <a href="#rightButtonPressed"><b>rightButtonPressed</b></a> ( TQListViewItem *, const TQPoint &amp;, int )</li>
<li class=fn>void <a href="#mouseButtonPressed"><b>mouseButtonPressed</b></a> ( int&nbsp;button, TQListViewItem&nbsp;*&nbsp;item, const&nbsp;TQPoint&nbsp;&amp;&nbsp;pos, int&nbsp;c )</li>
<li class=fn>void <a href="#mouseButtonClicked"><b>mouseButtonClicked</b></a> ( int&nbsp;button, TQListViewItem&nbsp;*&nbsp;item, const&nbsp;TQPoint&nbsp;&amp;&nbsp;pos, int&nbsp;c )</li>
<li class=fn>void <a href="#contextMenuRequested"><b>contextMenuRequested</b></a> ( TQListViewItem&nbsp;*&nbsp;item, const&nbsp;TQPoint&nbsp;&amp;&nbsp;pos, int&nbsp;col )</li>
<li class=fn>void <a href="#onItem"><b>onItem</b></a> ( TQListViewItem&nbsp;*&nbsp;i )</li>
<li class=fn>void <a href="#onViewport"><b>onViewport</b></a> ()</li>
<li class=fn>void <a href="#expanded"><b>expanded</b></a> ( TQListViewItem&nbsp;*&nbsp;item )</li>
<li class=fn>void <a href="#collapsed"><b>collapsed</b></a> ( TQListViewItem&nbsp;*&nbsp;item )</li>
<li class=fn>void <a href="#dropped"><b>dropped</b></a> ( TQDropEvent&nbsp;*&nbsp;e )</li>
<li class=fn>void <a href="#itemRenamed"><b>itemRenamed</b></a> ( TQListViewItem&nbsp;*&nbsp;item, int&nbsp;col, const&nbsp;TQString&nbsp;&amp;&nbsp;text )</li>
<li class=fn>void <a href="#itemRenamed-2"><b>itemRenamed</b></a> ( TQListViewItem&nbsp;*&nbsp;item, int&nbsp;col )</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>bool <a href="#allColumnsShowFocus-prop"><b>allColumnsShowFocus</b></a>&nbsp;- whether items should show keyboard focus using all columns</li>
<li class=fn>int <a href="#childCount-prop"><b>childCount</b></a>&nbsp;- the number of parentless (top-level) TQListViewItem objects in this TQListView &nbsp;<em>(read only)</em></li>
<li class=fn>int <a href="#columns-prop"><b>columns</b></a>&nbsp;- the number of columns in this list view &nbsp;<em>(read only)</em></li>
<li class=fn>RenameAction <a href="#defaultRenameAction-prop"><b>defaultRenameAction</b></a>&nbsp;- what action to perform when the editor loses focus during renaming</li>
<li class=fn>int <a href="#itemMargin-prop"><b>itemMargin</b></a>&nbsp;- the advisory item margin that list items may use</li>
<li class=fn>bool multiSelection&nbsp;- whether the list view is in multi-selection or extended-selection mode &nbsp;<em>(obsolete)</em></li>
<li class=fn>ResizeMode <a href="#resizeMode-prop"><b>resizeMode</b></a>&nbsp;- whether all, none or the only the last column should be resized</li>
<li class=fn>bool <a href="#rootIsDecorated-prop"><b>rootIsDecorated</b></a>&nbsp;- whether the list view shows open/close signs on root items</li>
<li class=fn>SelectionMode <a href="#selectionMode-prop"><b>selectionMode</b></a>&nbsp;- the list view's selection mode</li>
<li class=fn>bool <a href="#showSortIndicator-prop"><b>showSortIndicator</b></a>&nbsp;- whether the list view header should display a sort indicator</li>
<li class=fn>bool <a href="#showToolTips-prop"><b>showToolTips</b></a>&nbsp;- whether this list view should show tooltips for truncated column texts</li>
<li class=fn>int <a href="#treeStepSize-prop"><b>treeStepSize</b></a>&nbsp;- the number of pixels a child is offset from its parent</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#contentsMousePressEvent"><b>contentsMousePressEvent</b></a> ( TQMouseEvent&nbsp;*&nbsp;e )</li>
<li class=fn>virtual void <a href="#contentsMouseReleaseEvent"><b>contentsMouseReleaseEvent</b></a> ( TQMouseEvent&nbsp;*&nbsp;e )</li>
<li class=fn>virtual void <a href="#contentsMouseMoveEvent"><b>contentsMouseMoveEvent</b></a> ( TQMouseEvent&nbsp;*&nbsp;e )</li>
<li class=fn>virtual void <a href="#contentsMouseDoubleClickEvent"><b>contentsMouseDoubleClickEvent</b></a> ( TQMouseEvent&nbsp;*&nbsp;e )</li>
<li class=fn>virtual TQDragObject * <a href="#dragObject"><b>dragObject</b></a> ()</li>
<li class=fn>virtual void <a href="#startDrag"><b>startDrag</b></a> ()</li>
<li class=fn>virtual void <a href="#resizeEvent"><b>resizeEvent</b></a> ( TQResizeEvent&nbsp;*&nbsp;e )</li>
<li class=fn>virtual void <a href="#drawContentsOffset"><b>drawContentsOffset</b></a> ( TQPainter&nbsp;*&nbsp;p, int&nbsp;ox, int&nbsp;oy, int&nbsp;cx, int&nbsp;cy, int&nbsp;cw, int&nbsp;ch )</li>
<li class=fn>virtual void <a href="#paintEmptyArea"><b>paintEmptyArea</b></a> ( TQPainter&nbsp;*&nbsp;p, const&nbsp;TQRect&nbsp;&amp;&nbsp;rect )</li>
</ul>
<h2>Protected Slots</h2>
<ul>
<li class=fn>void <a href="#updateContents"><b>updateContents</b></a> ()</li>
<li class=fn>void <a href="#doAutoScroll"><b>doAutoScroll</b></a> ()</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The TQListView class implements a list/tree view.
<p>
<p> It can display and control a hierarchy of multi-column items, and
provides the ability to add new items at any time. The user may
select one or many items (depending on the <a href="#SelectionMode-enum">SelectionMode</a>) and
sort the list in increasing or decreasing order by any column.
<p> The simplest pattern of use is to create a TQListView, add some
column headers using <a href="#addColumn">addColumn</a>() and create one or more
<a href="qlistviewitem.html">TQListViewItem</a> or <a href="qchecklistitem.html">TQCheckListItem</a> objects with the TQListView as
parent:
<p>
<pre> TQListView * table;
</pre>
<pre> table-&gt;addColumn( "Qualified name" );
table-&gt;addColumn( "Namespace" );
</pre><pre> element = new <a href="qlistviewitem.html">TQListViewItem</a>( table, qName, namespaceURI );
</pre>
<p> Further nodes can be added to the list view object (the root of the
tree) or as child nodes to TQListViewItems:
<p> <pre> <a name="x2105"></a> for ( int i = 0 ; i &lt; attributes.<a href="qxmlattributes.html#length">length</a>(); i++ ) {
<a name="x2107"></a><a name="x2106"></a> new <a href="qlistviewitem.html">TQListViewItem</a>( element, attributes.<a href="qxmlattributes.html#qName">qName</a>(i), attributes.<a href="qxmlattributes.html#uri">uri</a>(i) );
}
</pre>
<p> (From <a href="tagreader-with-features-example.html">xml/tagreader-with-features/structureparser.cpp</a>)
<p> The main setup functions are:
<center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Function <th valign="top">Action
<tr bgcolor="#f0f0f0"> <td valign="top"><a href="#addColumn">addColumn</a>()
<td valign="top">Adds a column with a text label and perhaps width. Columns
are counted from the left starting with column 0.
<tr bgcolor="#d0d0d0"> <td valign="top"><a href="#setColumnWidthMode">setColumnWidthMode</a>()
<td valign="top">Sets the column to be resized automatically or not.
<tr bgcolor="#f0f0f0"> <td valign="top"><a href="#setAllColumnsShowFocus">setAllColumnsShowFocus</a>()
<td valign="top">Sets whether items should show <a href="focus.html#keyboard-focus">keyboard focus</a> using all
columns or just column 0. The default is to show focus
just using column 0.
<tr bgcolor="#d0d0d0"> <td valign="top"><a href="#setRootIsDecorated">setRootIsDecorated</a>()
<td valign="top">Sets whether root items should show open/close decoration to their left.
The default is FALSE.
<tr bgcolor="#f0f0f0"> <td valign="top"><a href="#setTreeStepSize">setTreeStepSize</a>()
<td valign="top">Sets how many pixels an item's children are indented
relative to their parent. The default is 20. This is
mostly a matter of taste.
<tr bgcolor="#d0d0d0"> <td valign="top"><a href="#setSorting">setSorting</a>()
<td valign="top">Sets whether the items should be sorted, whether it should
be in ascending or descending order, and by what column
they should be sorted. By default the list view is sorted
by the first column; to switch this off call <a href="#setSorting">setSorting</a>(-1).
</table></center>
<p> To handle events such as mouse presses on the list view, derived
classes can reimplement the <a href="qscrollview.html">TQScrollView</a> functions:
<a href="qscrollview.html#contentsMousePressEvent">contentsMousePressEvent</a>,
<a href="qscrollview.html#contentsMouseReleaseEvent">contentsMouseReleaseEvent</a>,
<a href="qscrollview.html#contentsMouseDoubleClickEvent">contentsMouseDoubleClickEvent</a>,
<a href="qscrollview.html#contentsMouseMoveEvent">contentsMouseMoveEvent</a>,
<a href="qscrollview.html#contentsDragEnterEvent">contentsDragEnterEvent</a>,
<a href="qscrollview.html#contentsDragMoveEvent">contentsDragMoveEvent</a>,
<a href="qscrollview.html#contentsDragLeaveEvent">contentsDragLeaveEvent</a>,
<a href="qscrollview.html#contentsDropEvent">contentsDropEvent</a>, and
<a href="qscrollview.html#contentsWheelEvent">contentsWheelEvent</a>.
<p> There are also several functions for mapping between items and
coordinates. <a href="#itemAt">itemAt</a>() returns the item at a position on-screen,
<a href="#itemRect">itemRect</a>() returns the rectangle an item occupies on the screen,
and <a href="#itemPos">itemPos</a>() returns the position of any item (whether it is
on-screen or not). <a href="#firstChild">firstChild</a>() returns the list view's first item
(not necessarily visible on-screen).
<p> You can iterate over visible items using
<a href="qlistviewitem.html#itemBelow">TQListViewItem::itemBelow</a>(); over a list view's top-level items
using <a href="qlistviewitem.html#firstChild">TQListViewItem::firstChild</a>() and
<a href="qlistviewitem.html#nextSibling">TQListViewItem::nextSibling</a>(); or every item using a
<a href="qlistviewitemiterator.html">TQListViewItemIterator</a>. See
the <a href="qlistviewitem.html">TQListViewItem</a> documentation for examples of traversal.
<p> An item can be moved amongst its siblings using
<a href="qlistviewitem.html#moveItem">TQListViewItem::moveItem</a>(). To move an item in the hierarchy use
<a href="#takeItem">takeItem</a>() and <a href="#insertItem">insertItem</a>(). Item's (and all their child items)
are deleted with <tt>delete</tt>; to delete all the list view's items
use <a href="#clear">clear</a>().
<p> There are a variety of selection modes described in the
TQListView::SelectionMode documentation. The default is <a href="#SelectionMode-enum">Single</a>
selection, which you can change using <a href="#setSelectionMode">setSelectionMode</a>().
<p> Because TQListView offers multiple selection it must display
keyboard focus and selection state separately. Therefore there are
functions both to set the selection state of an item
(<a href="#setSelected">setSelected</a>()) and to set which item displays keyboard focus
(<a href="#setCurrentItem">setCurrentItem</a>()).
<p> TQListView emits two groups of signals; one group signals changes
in selection/focus state and one indicates selection. The first
group consists of <a href="#selectionChanged">selectionChanged</a>() (applicable to all list
views), selectionChanged(<a href="qlistviewitem.html">TQListViewItem</a>*) (applicable only to a
<a href="#SelectionMode-enum">Single</a> selection list view), and <a href="#currentChanged">currentChanged</a>(TQListViewItem*).
The second group consists of <a href="#doubleClicked">doubleClicked</a>(TQListViewItem*),
<a href="#returnPressed">returnPressed</a>(TQListViewItem*),
<a href="#rightButtonClicked">rightButtonClicked</a>(TQListViewItem*, const <a href="qpoint.html">TQPoint</a>&, int), etc.
<p> Note that changing the state of the list view in a slot connected
to a list view signal may cause unexpected side effects. If you
need to change the list view's state in response to a signal, use
a <a href="qtimer.html#singleShot">single shot timer</a> with a
time out of 0, and connect this timer to a slot that modifies the
list view's state.
<p> In <a href="motif-extension.html#Motif">Motif</a> style, TQListView deviates fairly strongly from the look
and feel of the Motif hierarchical tree view. This is done mostly
to provide a usable keyboard interface and to make the list view
look better with a white background.
<p> If <a href="#selectionMode">selectionMode</a>() is <a href="#SelectionMode-enum">Single</a> (the default) the user can select
one item at a time, e.g. by clicking an item with the mouse, see
<a href="#SelectionMode-enum">TQListView::SelectionMode</a> for details.
<p> The list view can be navigated either using the mouse or the
keyboard. Clicking a <b>-</b> icon closes an item (hides its
children) and clicking a <b>+</b> icon opens an item (shows its
children). The keyboard controls are these:
<center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Keypress <th valign="top">Action
<tr bgcolor="#f0f0f0"> <td valign="top">Home
<td valign="top">Make the first item current and visible.
<tr bgcolor="#d0d0d0"> <td valign="top">End
<td valign="top">Make the last item current and visible.
<tr bgcolor="#f0f0f0"> <td valign="top">Page Up
<td valign="top">Make the item above the top visible item current and visible.
<tr bgcolor="#d0d0d0"> <td valign="top">Page Down
<td valign="top">Make the item below the bottom visible item current and visible.
<tr bgcolor="#f0f0f0"> <td valign="top">Up Arrow
<td valign="top">Make the item above the current item current and visible.
<tr bgcolor="#d0d0d0"> <td valign="top">Down Arrow
<td valign="top">Make the item below the current item current and visible.
<tr bgcolor="#f0f0f0"> <td valign="top">Left Arrow
<td valign="top">If the current item is closed (<b>+</b> icon) or has no
children, make its parent item current and visible. If the
current item is open (<b>-</b> icon) close it, i.e. hide its
children. Exception: if the current item is the first item
and is closed and the horizontal scrollbar is offset to
the right the list view will be scrolled left.
<tr bgcolor="#d0d0d0"> <td valign="top">Right Arrow
<td valign="top">If the current item is closed (<b>+</b> icon) and has
children, the item is opened. If the current item is
opened (<b>-</b> icon) and has children the item's first
child is made current and visible. If the current item has
no children the list view is scrolled right.
</table></center>
<p> If the user starts typing letters with the focus in the list view
an incremental search will occur. For example if the user types
'd' the current item will change to the first item that begins
with the letter 'd'; if they then type 'a', the current item will
change to the first item that begins with 'da', and so on. If no
item begins with the letters they type the current item doesn't
change.
<p> <b>Warning:</b> The list view assumes ownership of all list view items
and will delete them when it does not need them any more.
<p> <img src=qlistview-m.png> <img src=qlistview-w.png>
<p> <p>See also <a href="qlistviewitem.html">TQListViewItem</a>, <a href="qchecklistitem.html">TQCheckListItem</a>, and <a href="advanced.html">Advanced Widgets</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="RenameAction-enum"></a>TQListView::RenameAction</h3>
<p> This enum describes whether a rename operation is accepted if the
rename editor loses focus without the user pressing Enter.
<ul>
<li><tt>TQListView::Accept</tt> - Rename if Enter is pressed or focus is lost.
<li><tt>TQListView::Reject</tt> - Discard the rename operation if focus is lost (and
Enter has not been pressed).
</ul>
<h3 class=fn><a name="ResizeMode-enum"></a>TQListView::ResizeMode</h3>
<p> This enum describes how the list view's header adjusts to resize
events which affect the width of the list view.
<ul>
<li><tt>TQListView::NoColumn</tt> - The columns do not get resized in resize events.
<li><tt>TQListView::AllColumns</tt> - All columns are resized equally to fit the width
of the list view.
<li><tt>TQListView::LastColumn</tt> - The last column is resized to fit the width of
the list view.
</ul>
<h3 class=fn><a name="SelectionMode-enum"></a>TQListView::SelectionMode</h3>
<p> This enumerated type is used by TQListView to indicate how it
reacts to selection by the user.
<ul>
<li><tt>TQListView::Single</tt> - When the user selects an item, any already-selected
item becomes unselected. The user can unselect the selected
item by clicking on some empty space within the view.
<li><tt>TQListView::Multi</tt> - When the user selects an item in the usual way, the
selection status of that item is toggled and the other items are
left alone. Also, multiple items can be selected by dragging the
mouse while the left mouse button stays pressed.
<li><tt>TQListView::Extended</tt> - When the user selects an item in the usual way,
the selection is cleared and the new item selected. However, if
the user presses the Ctrl key when clicking on an item, the
clicked item gets toggled and all other items are left untouched.
And if the user presses the Shift key while clicking on an item,
all items between the current item and the clicked item get
selected or unselected, depending on the state of the clicked
item. Also, multiple items can be selected by dragging the mouse
over them.
<li><tt>TQListView::NoSelection</tt> - Items cannot be selected.
</ul><p> In other words, <a href="#SelectionMode-enum">Single</a> is a real single-selection list view, <a href="#SelectionMode-enum">Multi</a> a real multi-selection list view, <a href="#SelectionMode-enum">Extended</a> is a list view
where users can select multiple items but usually want to select
either just one or a range of contiguous items, and <a href="#SelectionMode-enum">NoSelection</a>
is a list view where the user can look but not touch.
<h3 class=fn><a name="WidthMode-enum"></a>TQListView::WidthMode</h3>
<p> This enum type describes how the width of a column in the view
changes.
<ul>
<li><tt>TQListView::Manual</tt> - the column width does not change automatically.
<li><tt>TQListView::Maximum</tt> - the column is automatically sized according to the
widths of all items in the column. (Note: The column never shrinks
in this case.) This means that the column is always resized to the
width of the item with the largest width in the column.
</ul><p> <p>See also <a href="#setColumnWidth">setColumnWidth</a>(), <a href="#setColumnWidthMode">setColumnWidthMode</a>(), and <a href="#columnWidth">columnWidth</a>().
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQListView"></a>TQListView::TQListView ( <a href="qwidget.html">TQWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )
</h3>
Constructs a new empty list view called <em>name</em> with parent <em>parent</em>.
<p> Performance is boosted by modifying the widget flags <em>f</em> so that
only part of the <a href="qlistviewitem.html">TQListViewItem</a> children is redrawn. This may be
unsuitable for custom TQListViewItem classes, in which case <a href="qt.html#WidgetFlags-enum">WStaticContents</a> and <a href="qt.html#WidgetFlags-enum">WNoAutoErase</a> should be cleared.
<p> <p>See also <a href="qwidget.html#clearWFlags">TQWidget::clearWFlags</a>() and <a href="qt.html#WidgetFlags-enum">TQt::WidgetFlags</a>.
<h3 class=fn><a name="~TQListView"></a>TQListView::~TQListView ()
</h3>
Destroys the list view, deleting all its items, and frees up all
allocated resources.
<h3 class=fn>int <a name="addColumn"></a>TQListView::addColumn ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;label, int&nbsp;width = -1 )<tt> [virtual]</tt>
</h3>
Adds a <em>width</em> pixels wide column with the column header <em>label</em>
to the list view, and returns the index of the new column.
<p> All columns apart from the first one are inserted to the right of
the existing ones.
<p> If <em>width</em> is negative, the new column's <a href="#WidthMode-enum">WidthMode</a> is set to
<a href="#WidthMode-enum">Maximum</a> instead of <a href="#WidthMode-enum">Manual</a>.
<p> <p>See also <a href="#setColumnText">setColumnText</a>(), <a href="#setColumnWidth">setColumnWidth</a>(), and <a href="#setColumnWidthMode">setColumnWidthMode</a>().
<p>Examples: <a href="addressbook-example.html#x585">addressbook/centralwidget.cpp</a>, <a href="checklists-example.html#x427">checklists/checklists.cpp</a>, <a href="dirview-example.html#x1714">dirview/main.cpp</a>, <a href="fileiconview-example.html#x886">fileiconview/mainwindow.cpp</a>, <a href="listviews-example.html#x141">listviews/listviews.cpp</a>, and <a href="qdir-example.html#x1827">qdir/qdir.cpp</a>.
<h3 class=fn>int <a name="addColumn-2"></a>TQListView::addColumn ( const&nbsp;<a href="qiconset.html">TQIconSet</a>&nbsp;&amp;&nbsp;iconset, const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;label, int&nbsp;width = -1 )<tt> [virtual]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Adds a <em>width</em> pixels wide new column with the header <em>label</em>
and the <em>iconset</em> to the list view, and returns the index of the
column.
<p> If <em>width</em> is negative, the new column's <a href="#WidthMode-enum">WidthMode</a> is set to
<a href="#WidthMode-enum">Maximum</a>, and to <a href="#WidthMode-enum">Manual</a> otherwise.
<p> <p>See also <a href="#setColumnText">setColumnText</a>(), <a href="#setColumnWidth">setColumnWidth</a>(), and <a href="#setColumnWidthMode">setColumnWidthMode</a>().
<h3 class=fn>void <a name="adjustColumn"></a>TQListView::adjustColumn ( int&nbsp;col )<tt> [slot]</tt>
</h3> Adjusts the column <em>col</em> to its preferred width
<h3 class=fn>bool <a name="allColumnsShowFocus"></a>TQListView::allColumnsShowFocus () const
</h3><p>Returns TRUE if items should show keyboard focus using all columns; otherwise returns FALSE.
See the <a href="qlistview.html#allColumnsShowFocus-prop">"allColumnsShowFocus"</a> property for details.
<h3 class=fn>int <a name="childCount"></a>TQListView::childCount () const
</h3><p>Returns the number of parentless (top-level) <a href="qlistviewitem.html">TQListViewItem</a> objects in this TQListView.
See the <a href="qlistview.html#childCount-prop">"childCount"</a> property for details.
<h3 class=fn>void <a name="clear"></a>TQListView::clear ()<tt> [virtual slot]</tt>
</h3>
Removes and deletes all the items in this list view and triggers
an update.
<p> Note that the <a href="#currentChanged">currentChanged</a>() signal is not emitted when this slot is invoked.
<p>See also <a href="#triggerUpdate">triggerUpdate</a>().
<p>Examples: <a href="addressbook-example.html#x586">addressbook/centralwidget.cpp</a>, <a href="checklists-example.html#x428">checklists/checklists.cpp</a>, <a href="listviews-example.html#x142">listviews/listviews.cpp</a>, and <a href="qaxcontainer-example-qutlook.html#x2725">qutlook/centralwidget.cpp</a>.
<h3 class=fn>void <a name="clearSelection"></a>TQListView::clearSelection ()<tt> [virtual]</tt>
</h3>
Sets all the items to be not selected, updates the list view as
necessary, and emits the <a href="#selectionChanged">selectionChanged</a>() signals. Note that for
<a href="#SelectionMode-enum">Multi</a> selection list views this function needs to iterate over
<em>all</em> items.
<p> <p>See also <a href="#setSelected">setSelected</a>() and <a href="#multiSelection-prop">multiSelection</a>.
<p>Example: <a href="addressbook-example.html#x587">addressbook/centralwidget.cpp</a>.
<h3 class=fn>void <a name="clicked"></a>TQListView::clicked ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the user clicks (mouse pressed <em>and</em> mouse released) in the list view. <em>item</em> is the clicked list
view item, or 0 if the user didn't click on an item.
<p> <b>Warning:</b> Do not delete any <a href="qlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<p>Example: <a href="addressbook-example.html#x588">addressbook/centralwidget.cpp</a>.
<h3 class=fn>void <a name="clicked-2"></a>TQListView::clicked ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item, const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;pnt, int&nbsp;c )<tt> [signal]</tt>
</h3>
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This signal is emitted whenever the user clicks (mouse pressed <em>and</em> mouse released) in the list view. <em>item</em> is the clicked list
view item, or 0 if the user didn't click on an item. <em>pnt</em> is the
position where the user has clicked in global coordinates. If <em>item</em> is not 0, <em>c</em> is the list view column into which the user
pressed; if <em>item</em> is 0 <em>c</em>'s value is undefined.
<p> <b>Warning:</b> Do not delete any <a href="qlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="collapsed"></a>TQListView::collapsed ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the <em>item</em> has been collapsed, i.e.
when the children of <em>item</em> are hidden.
<p> <p>See also <a href="#setOpen">setOpen</a>() and <a href="#expanded">expanded</a>().
<h3 class=fn>int <a name="columnAlignment"></a>TQListView::columnAlignment ( int&nbsp;column ) const
</h3>
Returns the alignment of column <em>column</em>. The default is <a href="qt.html#AlignmentFlags-enum">AlignAuto</a>.
<p> <p>See also <a href="qt.html#AlignmentFlags-enum">TQt::AlignmentFlags</a>.
<h3 class=fn><a href="qstring.html">TQString</a> <a name="columnText"></a>TQListView::columnText ( int&nbsp;c ) const
</h3>
Returns the text of column <em>c</em>.
<p> <p>See also <a href="#setColumnText">setColumnText</a>().
<h3 class=fn>int <a name="columnWidth"></a>TQListView::columnWidth ( int&nbsp;c ) const
</h3>
Returns the width of column <em>c</em>.
<p> <p>See also <a href="#setColumnWidth">setColumnWidth</a>().
<h3 class=fn><a href="qlistview.html#WidthMode-enum">WidthMode</a> <a name="columnWidthMode"></a>TQListView::columnWidthMode ( int&nbsp;c ) const
</h3>
Returns the <a href="#WidthMode-enum">WidthMode</a> for column <em>c</em>.
<p> <p>See also <a href="#setColumnWidthMode">setColumnWidthMode</a>().
<h3 class=fn>int <a name="columns"></a>TQListView::columns () const
</h3><p>Returns the number of columns in this list view.
See the <a href="qlistview.html#columns-prop">"columns"</a> property for details.
<h3 class=fn>void <a name="contentsMouseDoubleClickEvent"></a>TQListView::contentsMouseDoubleClickEvent ( <a href="qmouseevent.html">TQMouseEvent</a>&nbsp;*&nbsp;e )<tt> [virtual protected]</tt>
</h3>
Processes the mouse double-click event <em>e</em> on behalf of the viewed widget.
<p>Reimplemented from <a href="qscrollview.html#contentsMouseDoubleClickEvent">TQScrollView</a>.
<h3 class=fn>void <a name="contentsMouseMoveEvent"></a>TQListView::contentsMouseMoveEvent ( <a href="qmouseevent.html">TQMouseEvent</a>&nbsp;*&nbsp;e )<tt> [virtual protected]</tt>
</h3>
Processes the mouse move event <em>e</em> on behalf of the viewed widget.
<p>Example: <a href="dirview-example.html#x1683">dirview/dirview.cpp</a>.
<p>Reimplemented from <a href="qscrollview.html#contentsMouseMoveEvent">TQScrollView</a>.
<h3 class=fn>void <a name="contentsMousePressEvent"></a>TQListView::contentsMousePressEvent ( <a href="qmouseevent.html">TQMouseEvent</a>&nbsp;*&nbsp;e )<tt> [virtual protected]</tt>
</h3>
Processes the mouse press event <em>e</em> on behalf of the viewed widget.
<p>Example: <a href="dirview-example.html#x1684">dirview/dirview.cpp</a>.
<p>Reimplemented from <a href="qscrollview.html#contentsMousePressEvent">TQScrollView</a>.
<h3 class=fn>void <a name="contentsMouseReleaseEvent"></a>TQListView::contentsMouseReleaseEvent ( <a href="qmouseevent.html">TQMouseEvent</a>&nbsp;*&nbsp;e )<tt> [virtual protected]</tt>
</h3>
Processes the mouse release event <em>e</em> on behalf of the viewed widget.
<p>Example: <a href="dirview-example.html#x1685">dirview/dirview.cpp</a>.
<p>Reimplemented from <a href="qscrollview.html#contentsMouseReleaseEvent">TQScrollView</a>.
<h3 class=fn>void <a name="contextMenuRequested"></a>TQListView::contextMenuRequested ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item, const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;pos, int&nbsp;col )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the user invokes a context menu with
the right mouse button or with special system keys. If the
keyboard was used <em>item</em> is the current item; if the mouse was
used, <em>item</em> is the item under the mouse pointer or 0 if there is
no item under the mouse pointer. If no item is clicked, the column
index emitted is -1.
<p> <em>pos</em> is the position for the context menu in the global
coordinate system.
<p> <em>col</em> is the column on which the user pressed, or -1 if the
signal was triggered by a key event.
<p>Example: <a href="listviews-example.html#x143">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="currentChanged"></a>TQListView::currentChanged ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the current item has changed
(normally after the screen update). The current item is the item
responsible for indicating <a href="focus.html#keyboard-focus">keyboard focus</a>.
<p> The argument is the newly current item, or 0 if the change made no
item current. This can happen, for example, if all items in the
list view are deleted.
<p> <b>Warning:</b> Do not delete any <a href="qlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<p> <p>See also <a href="#setCurrentItem">setCurrentItem</a>() and <a href="#currentItem">currentItem</a>().
<p>Example: <a href="listviews-example.html#x144">listviews/listviews.cpp</a>.
<h3 class=fn><a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* <a name="currentItem"></a>TQListView::currentItem () const
</h3>
Returns the current item, or 0 if there isn't one.
<p> <p>See also <a href="#setCurrentItem">setCurrentItem</a>().
<p>Examples: <a href="addressbook-example.html#x589">addressbook/centralwidget.cpp</a>, <a href="listviews-example.html#x145">listviews/listviews.cpp</a>, and <a href="qaxcontainer-example-qutlook.html#x2726">qutlook/centralwidget.cpp</a>.
<h3 class=fn><a href="qlistview.html#RenameAction-enum">RenameAction</a> <a name="defaultRenameAction"></a>TQListView::defaultRenameAction () const
</h3><p>Returns what action to perform when the editor loses focus during renaming.
See the <a href="qlistview.html#defaultRenameAction-prop">"defaultRenameAction"</a> property for details.
<h3 class=fn>void <a name="doAutoScroll"></a>TQListView::doAutoScroll ()<tt> [protected slot]</tt>
</h3>
This slot handles auto-scrolling when the mouse button is pressed
and the mouse is outside the widget.
<h3 class=fn>void <a name="doubleClicked"></a>TQListView::doubleClicked ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*, const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;, int )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever an item is double-clicked. It's
emitted on the second button press, not the second button release.
The arguments are the relevant <a href="qlistviewitem.html">TQListViewItem</a> (may be 0), the point
in global coordinates and the relevant column (or -1 if the click
was outside the list).
<p> <b>Warning:</b> Do not delete any TQListViewItem objects in slots
connected to this signal.
<h3 class=fn>void <a name="doubleClicked-2"></a>TQListView::doubleClicked ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item )<tt> [signal]</tt>
</h3>
<p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
(use <a href="#doubleClicked">doubleClicked</a>( <a href="qlistviewitem.html">TQListViewItem</a> *, const <a href="qpoint.html">TQPoint</a>&, int ))
<p> This signal is emitted whenever an item is double-clicked. It's
emitted on the second button press, not the second button release.
<em>item</em> is the list view item on which the user did the
double-click.
<h3 class=fn><a href="qdragobject.html">TQDragObject</a>&nbsp;* <a name="dragObject"></a>TQListView::dragObject ()<tt> [virtual protected]</tt>
</h3>
If the user presses the mouse on an item and starts moving the
mouse, and the item allow dragging (see
<a href="qlistviewitem.html#setDragEnabled">TQListViewItem::setDragEnabled</a>()), this function is called to get a
drag object and a drag is started unless <a href="#dragObject">dragObject</a>() returns 0.
<p> By default this function returns 0. You should reimplement it and
create a <a href="qdragobject.html">TQDragObject</a> depending on the selected items.
<h3 class=fn>void <a name="drawContentsOffset"></a>TQListView::drawContentsOffset ( <a href="qpainter.html">TQPainter</a>&nbsp;*&nbsp;p, int&nbsp;ox, int&nbsp;oy, int&nbsp;cx, int&nbsp;cy, int&nbsp;cw, int&nbsp;ch )<tt> [virtual protected]</tt>
</h3>
Calls <a href="qlistviewitem.html#paintCell">TQListViewItem::paintCell</a>() and
<a href="qlistviewitem.html#paintBranches">TQListViewItem::paintBranches</a>() as necessary for all list view
items that require repainting in the <em>cw</em> pixels wide and <em>ch</em>
pixels high bounding rectangle starting at position <em>cx</em>, <em>cy</em>
with offset <em>ox</em>, <em>oy</em>. Uses the painter <em>p</em>.
<p>Reimplemented from <a href="qscrollview.html#drawContentsOffset">TQScrollView</a>.
<h3 class=fn>void <a name="dropped"></a>TQListView::dropped ( <a href="qdropevent.html">TQDropEvent</a>&nbsp;*&nbsp;e )<tt> [signal]</tt>
</h3>
<p> This signal is emitted, when a drop event occurred on the
viewport (not onto an item).
<p> <em>e</em> provides all the information about the drop.
<h3 class=fn>void <a name="ensureItemVisible"></a>TQListView::ensureItemVisible ( const&nbsp;<a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;i )
</h3>
Ensures that item <em>i</em> is visible, scrolling the list view
vertically if necessary and opening (expanding) any parent items
if this is required to show the item.
<p> <p>See also <a href="#itemRect">itemRect</a>() and <a href="qscrollview.html#ensureVisible">TQScrollView::ensureVisible</a>().
<h3 class=fn>bool <a name="eventFilter"></a>TQListView::eventFilter ( <a href="qobject.html">TQObject</a>&nbsp;*&nbsp;o, <a href="qevent.html">TQEvent</a>&nbsp;*&nbsp;e )<tt> [virtual]</tt>
</h3>
Redirects the event <em>e</em> relating to object <em>o</em>, for the viewport
to <a href="qwidget.html#mousePressEvent">mousePressEvent</a>(), <a href="qwidget.html#keyPressEvent">keyPressEvent</a>() and friends.
<p>Reimplemented from <a href="qscrollview.html#eventFilter">TQScrollView</a>.
<h3 class=fn>void <a name="expanded"></a>TQListView::expanded ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when <em>item</em> has been expanded, i.e. when
the children of <em>item</em> are shown.
<p> <p>See also <a href="#setOpen">setOpen</a>() and <a href="#collapsed">collapsed</a>().
<h3 class=fn><a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* <a name="findItem"></a>TQListView::findItem ( const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;text, int&nbsp;column, ComparisonFlags&nbsp;compare = ExactMatch | CaseSensitive ) const
</h3>
Finds the first list view item in column <em>column</em>, that matches
<em>text</em> and returns the item, or returns 0 of no such item could
be found.
The search starts from the current item if the current item exists,
otherwise it starts from the first list view item. After reaching
the last item the search continues from the first item.
Pass OR-ed together <a href="qt.html#StringComparisonMode-enum">TQt::StringComparisonMode</a> values
in the <em>compare</em> flag, to control how the matching is performed.
The default comparison mode is case-sensitive, exact match.
<h3 class=fn><a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* <a name="firstChild"></a>TQListView::firstChild () const
</h3>
Returns the first item in this TQListView. Returns 0 if there is no
first item.
<p> A list view's items can be traversed using <a href="#firstChild">firstChild</a>()
and nextSibling() or using a <a href="qlistviewitemiterator.html">TQListViewItemIterator</a>.
<p> <p>See also <a href="#itemAt">itemAt</a>(), <a href="qlistviewitem.html#itemBelow">TQListViewItem::itemBelow</a>(), and <a href="qlistviewitem.html#itemAbove">TQListViewItem::itemAbove</a>().
<p>Examples: <a href="addressbook-example.html#x590">addressbook/centralwidget.cpp</a> and <a href="listviews-example.html#x146">listviews/listviews.cpp</a>.
<h3 class=fn><a href="qheader.html">TQHeader</a>&nbsp;* <a name="header"></a>TQListView::header () const
</h3>
Returns the <a href="qheader.html">TQHeader</a> object that manages this list view's columns.
Please don't modify the header behind the list view's back.
<p> You may safely call <a href="qheader.html#setClickEnabled">TQHeader::setClickEnabled</a>(),
<a href="qheader.html#setResizeEnabled">TQHeader::setResizeEnabled</a>(), <a href="qheader.html#setMovingEnabled">TQHeader::setMovingEnabled</a>(),
<a href="qwidget.html#hide">TQHeader::hide</a>() and all the const TQHeader functions.
<p>Examples: <a href="listviews-example.html#x147">listviews/listviews.cpp</a> and <a href="qdir-example.html#x1828">qdir/qdir.cpp</a>.
<h3 class=fn>void <a name="hideColumn"></a>TQListView::hideColumn ( int&nbsp;column )
</h3>
Hides the column specified at <em>column</em>. This is a convenience
function that calls <a href="#setColumnWidth">setColumnWidth</a>( <em>column</em>, 0 ).
<p> Note: The user may still be able to resize the hidden column using
the header handles. To prevent this, call setResizeEnabled(FALSE,
<em>column</em>) on the list views header.
<p> <p>See also <a href="#setColumnWidth">setColumnWidth</a>().
<h3 class=fn>void <a name="insertItem"></a>TQListView::insertItem ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;i )<tt> [virtual]</tt>
</h3>
Inserts item <em>i</em> into the list view as a top-level item. You do
not need to call this unless you've called <a href="#takeItem">takeItem</a>(<em>i</em>) or
<a href="qlistviewitem.html#takeItem">TQListViewItem::takeItem</a>(<em>i</em>) and need to reinsert <em>i</em> elsewhere.
<p> <p>See also <a href="qlistviewitem.html#takeItem">TQListViewItem::takeItem</a>() and <a href="#takeItem">takeItem</a>().
<h3 class=fn>void <a name="invertSelection"></a>TQListView::invertSelection ()<tt> [virtual slot]</tt>
</h3>
Inverts the selection. Only works in <a href="#SelectionMode-enum">Multi</a> and <a href="#SelectionMode-enum">Extended</a>
selection modes.
<h3 class=fn>bool <a name="isMultiSelection"></a>TQListView::isMultiSelection () const
</h3><p>Returns TRUE if the list view is in multi-selection or extended-selection mode; otherwise returns FALSE.
See the <a href="qlistview.html#multiSelection-prop">"multiSelection"</a> property for details.
<h3 class=fn>bool <a name="isOpen"></a>TQListView::isOpen ( const&nbsp;<a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item ) const
</h3>
Identical to <em>item</em>->isOpen(). Provided for completeness.
<p> <p>See also <a href="#setOpen">setOpen</a>().
<h3 class=fn>bool <a name="isRenaming"></a>TQListView::isRenaming () const
</h3>
Returns TRUE if an item is being renamed; otherwise returns FALSE.
<h3 class=fn>bool <a name="isSelected"></a>TQListView::isSelected ( const&nbsp;<a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;i ) const
</h3>
Returns TRUE if the list view item <em>i</em> is selected; otherwise
returns FALSE.
<p> <p>See also <a href="qlistviewitem.html#isSelected">TQListViewItem::isSelected</a>().
<h3 class=fn><a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* <a name="itemAt"></a>TQListView::itemAt ( const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;viewPos ) const
</h3>
Returns the list view item at <em>viewPos</em>. Note that <em>viewPos</em> is
in the <a href="qscrollview.html#viewport">viewport</a>()'s coordinate system, not in the list view's own,
much larger, coordinate system.
<p> <a href="#itemAt">itemAt</a>() returns 0 if there is no such item.
<p> Note that you also get the pointer to the item if <em>viewPos</em>
points to the root decoration (see <a href="#setRootIsDecorated">setRootIsDecorated</a>()) of the
item. To check whether or not <em>viewPos</em> is on the root decoration
of the item, you can do something like this:
<p> <pre>
<a href="qlistviewitem.html">TQListViewItem</a> *i = <a href="#itemAt">itemAt</a>( p );
if ( i ) {
if ( p.x() &gt; header()-&gt;sectionPos( <a href="#header">header</a>()-&gt;mapToIndex( 0 ) ) +
<a href="#treeStepSize">treeStepSize</a>() * ( i-&gt;<a href="qlistviewitem.html#depth">depth</a>() + ( <a href="#rootIsDecorated">rootIsDecorated</a>() ? 1 : 0) ) + itemMargin() ||
p.x() &lt; header()-&gt;sectionPos( <a href="#header">header</a>()-&gt;mapToIndex( 0 ) ) ) {
; // p is not on root decoration
else
; // p is on the root decoration
}
</pre>
<p> This might be interesting if you use this function to find out
where the user clicked and if you want to start a drag (which you
do not want to do if the user clicked onto the root decoration of
an item).
<p> <p>See also <a href="#itemPos">itemPos</a>(), <a href="#itemRect">itemRect</a>(), and <a href="qscrollview.html#viewportToContents">viewportToContents</a>().
<h3 class=fn>int <a name="itemMargin"></a>TQListView::itemMargin () const
</h3><p>Returns the advisory item margin that list items may use.
See the <a href="qlistview.html#itemMargin-prop">"itemMargin"</a> property for details.
<h3 class=fn>int <a name="itemPos"></a>TQListView::itemPos ( const&nbsp;<a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item )
</h3>
Returns the y-coordinate of <em>item</em> in the list view's coordinate
system. This function is normally much slower than <a href="#itemAt">itemAt</a>() but it
works for all items, whereas itemAt() normally works only for
items on the screen.
<p> This is a thin wrapper around <a href="qlistviewitem.html#itemPos">TQListViewItem::itemPos</a>().
<p> <p>See also <a href="#itemAt">itemAt</a>() and <a href="#itemRect">itemRect</a>().
<h3 class=fn><a href="qrect.html">TQRect</a> <a name="itemRect"></a>TQListView::itemRect ( const&nbsp;<a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;i ) const
</h3>
Returns the rectangle on the screen that item <em>i</em> occupies in
<a href="qscrollview.html#viewport">viewport</a>()'s coordinates, or an invalid rectangle if <em>i</em> is 0 or
is not currently visible.
<p> The rectangle returned does not include any children of the
rectangle (i.e. it uses <a href="qlistviewitem.html#height">TQListViewItem::height</a>(), rather than
<a href="qlistviewitem.html#totalHeight">TQListViewItem::totalHeight</a>()). If you want the rectangle to
include children you can use something like this:
<p> <pre>
<a href="qrect.html">TQRect</a> r( listView-&gt;itemRect( item ) );
r.<a href="qrect.html#setHeight">setHeight</a>( (TQCOORD)(TQMIN( item-&gt;totalHeight(),
listView-&gt;viewport-&gt;height() - r.<a href="qrect.html#y">y</a>() ) ) )
</pre>
<p> Note the way it avoids too-high rectangles. totalHeight() can be
much larger than the window system's coordinate system allows.
<p> <a href="#itemRect">itemRect</a>() is comparatively slow. It's best to call it only for
items that are probably on-screen.
<h3 class=fn>void <a name="itemRenamed"></a>TQListView::itemRenamed ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item, int&nbsp;col, const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;text )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when <em>item</em> has been renamed to <em>text</em>,
e.g. by in in-place renaming, in column <em>col</em>.
<p> <p>See also <a href="qlistviewitem.html#setRenameEnabled">TQListViewItem::setRenameEnabled</a>().
<h3 class=fn>void <a name="itemRenamed-2"></a>TQListView::itemRenamed ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item, int&nbsp;col )<tt> [signal]</tt>
</h3>
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This signal is emitted when <em>item</em> has been renamed, e.g. by
in-place renaming, in column <em>col</em>.
<p> <p>See also <a href="qlistviewitem.html#setRenameEnabled">TQListViewItem::setRenameEnabled</a>().
<h3 class=fn><a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* <a name="lastItem"></a>TQListView::lastItem () const
</h3>
Returns the last item in the list view tree. Returns 0 if there
are no items in the TQListView.
<p> This function is slow because it traverses the entire tree to find
the last item.
<h3 class=fn>void <a name="mouseButtonClicked"></a>TQListView::mouseButtonClicked ( int&nbsp;button, <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item, const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;pos, int&nbsp;c )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the user clicks (mouse pressed <em>and</em> mouse released) in the list view at position <em>pos</em>. <em>button</em>
is the mouse button that the user pressed, <em>item</em> is the clicked
list view item or 0 if the user didn't click on an item. If <em>item</em> is not 0, <em>c</em> is the list view column into which the user
pressed; if <em>item</em> is 0 <em>c</em>'s value is undefined.
<p> <b>Warning:</b> Do not delete any <a href="qlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="mouseButtonPressed"></a>TQListView::mouseButtonPressed ( int&nbsp;button, <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item, const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;pos, int&nbsp;c )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the user pressed the mouse button
in the list view at position <em>pos</em>. <em>button</em> is the mouse button
which the user pressed, <em>item</em> is the pressed list view item or 0
if the user didn't press on an item. If <em>item</em> is not 0, <em>c</em> is
the list view column into which the user pressed; if <em>item</em> is 0
<em>c</em>'s value is undefined.
<p> <b>Warning:</b> Do not delete any <a href="qlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="onItem"></a>TQListView::onItem ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;i )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the user moves the mouse cursor onto
item <em>i</em>, similar to the <a href="qwidget.html#enterEvent">TQWidget::enterEvent</a>() function.
<h3 class=fn>void <a name="onViewport"></a>TQListView::onViewport ()<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the user moves the mouse cursor from
an item to an empty part of the list view.
<h3 class=fn>void <a name="paintEmptyArea"></a>TQListView::paintEmptyArea ( <a href="qpainter.html">TQPainter</a>&nbsp;*&nbsp;p, const&nbsp;<a href="qrect.html">TQRect</a>&nbsp;&amp;&nbsp;rect )<tt> [virtual protected]</tt>
</h3>
Paints <em>rect</em> so that it looks like empty background using
painter <em>p</em>. <em>rect</em> is in widget coordinates, ready to be fed to
<em>p</em>.
<p> The default function fills <em>rect</em> with the
<a href="qscrollview.html#viewport">viewport</a>()->backgroundBrush().
<h3 class=fn>void <a name="pressed"></a>TQListView::pressed ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the user presses the mouse button
in a list view. <em>item</em> is the list view item on which the user
pressed the mouse button, or 0 if the user didn't press the mouse
on an item.
<p> <b>Warning:</b> Do not delete any <a href="qlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="pressed-2"></a>TQListView::pressed ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item, const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;pnt, int&nbsp;c )<tt> [signal]</tt>
</h3>
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This signal is emitted whenever the user presses the mouse button
in a list view. <em>item</em> is the list view item on which the user
pressed the mouse button, or 0 if the user didn't press the mouse
on an item. <em>pnt</em> is the position of the mouse cursor in global
coordinates, and <em>c</em> is the column where the mouse cursor was
when the user pressed the mouse button.
<p> <b>Warning:</b> Do not delete any <a href="qlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="removeColumn"></a>TQListView::removeColumn ( int&nbsp;index )<tt> [virtual]</tt>
</h3>
Removes the column at position <em>index</em>.
<p> If no columns remain after the column is removed, the
list view will be cleared.
<p> <p>See also <a href="#clear">clear</a>().
<h3 class=fn>void <a name="removeItem"></a>TQListView::removeItem ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item )<tt> [virtual]</tt>
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> This function has been renamed <a href="#takeItem">takeItem</a>().
<h3 class=fn>void <a name="repaintItem"></a>TQListView::repaintItem ( const&nbsp;<a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item ) const
</h3>
Repaints <em>item</em> on the screen if <em>item</em> is currently visible.
Takes care to avoid multiple repaints.
<h3 class=fn>void <a name="resizeEvent"></a>TQListView::resizeEvent ( <a href="qresizeevent.html">TQResizeEvent</a>&nbsp;*&nbsp;e )<tt> [virtual protected]</tt>
</h3>
Ensures that the header is correctly sized and positioned when the
resize event <em>e</em> occurs.
<h3 class=fn><a href="qlistview.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode"></a>TQListView::resizeMode () const
</h3><p>Returns TRUE if all, none or the only the last column should be resized; otherwise returns FALSE.
See the <a href="qlistview.html#resizeMode-prop">"resizeMode"</a> property for details.
<h3 class=fn>void <a name="returnPressed"></a>TQListView::returnPressed ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when Enter or Return is pressed. The
argument is the <a href="#currentItem">currentItem</a>().
<h3 class=fn>void <a name="rightButtonClicked"></a>TQListView::rightButtonClicked ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*, const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;, int )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the right button is clicked (i.e. when
it's released). The arguments are the relevant <a href="qlistviewitem.html">TQListViewItem</a> (may
be 0), the point in global coordinates and the relevant column (or
-1 if the click was outside the list).
<h3 class=fn>void <a name="rightButtonPressed"></a>TQListView::rightButtonPressed ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*, const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;, int )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the right button is pressed. The
arguments are the relevant <a href="qlistviewitem.html">TQListViewItem</a> (may be 0), the point in
global coordinates and the relevant column (or -1 if the click was
outside the list).
<h3 class=fn>bool <a name="rootIsDecorated"></a>TQListView::rootIsDecorated () const
</h3><p>Returns TRUE if the list view shows open/close signs on root items; otherwise returns FALSE.
See the <a href="qlistview.html#rootIsDecorated-prop">"rootIsDecorated"</a> property for details.
<h3 class=fn>void <a name="selectAll"></a>TQListView::selectAll ( bool&nbsp;select )<tt> [virtual slot]</tt>
</h3>
If <em>select</em> is TRUE, all the items get selected; otherwise all
the items get unselected. This only works in the selection modes <a href="#SelectionMode-enum">Multi</a> and <a href="#SelectionMode-enum">Extended</a>. In <a href="#SelectionMode-enum">Single</a> and <a href="#SelectionMode-enum">NoSelection</a> mode the
selection of the current item is just set to <em>select</em>.
<h3 class=fn><a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* <a name="selectedItem"></a>TQListView::selectedItem () const
</h3>
Returns the selected item if the list view is in <a href="#SelectionMode-enum">Single</a>
selection mode and an item is selected.
<p> If no items are selected or the list view is not in <a href="#SelectionMode-enum">Single</a>
selection mode this function returns 0.
<p> <p>See also <a href="#setSelected">setSelected</a>() and <a href="#multiSelection-prop">multiSelection</a>.
<h3 class=fn>void <a name="selectionChanged"></a>TQListView::selectionChanged ()<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the set of selected items has
changed (normally before the screen update). It is available in
<a href="#SelectionMode-enum">Single</a>, <a href="#SelectionMode-enum">Multi</a>, and <a href="#SelectionMode-enum">Extended</a> selection modes, but is most
useful in <a href="#SelectionMode-enum">Multi</a> selection mode.
<p> <b>Warning:</b> Do not delete any <a href="qlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<p> <p>See also <a href="#setSelected">setSelected</a>() and <a href="qlistviewitem.html#setSelected">TQListViewItem::setSelected</a>().
<p>Example: <a href="listviews-example.html#x148">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="selectionChanged-2"></a>TQListView::selectionChanged ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* )<tt> [signal]</tt>
</h3>
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This signal is emitted whenever the selected item has changed in
<a href="#SelectionMode-enum">Single</a> selection mode (normally after the screen update). The
argument is the newly selected item. If the selection is cleared
(when, for example, the user clicks in the unused area of the list
view) then this signal will not be emitted.
<p> In <a href="#SelectionMode-enum">Multi</a> selection mode, use the no argument overload of this
signal.
<p> <b>Warning:</b> Do not delete any <a href="qlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<p> <p>See also <a href="#setSelected">setSelected</a>(), <a href="qlistviewitem.html#setSelected">TQListViewItem::setSelected</a>(), and <a href="#currentChanged">currentChanged</a>().
<h3 class=fn><a href="qlistview.html#SelectionMode-enum">SelectionMode</a> <a name="selectionMode"></a>TQListView::selectionMode () const
</h3><p>Returns the list view's selection mode.
See the <a href="qlistview.html#selectionMode-prop">"selectionMode"</a> property for details.
<h3 class=fn>void <a name="setAllColumnsShowFocus"></a>TQListView::setAllColumnsShowFocus ( bool )<tt> [virtual]</tt>
</h3><p>Sets whether items should show keyboard focus using all columns.
See the <a href="qlistview.html#allColumnsShowFocus-prop">"allColumnsShowFocus"</a> property for details.
<h3 class=fn>void <a name="setColumnAlignment"></a>TQListView::setColumnAlignment ( int&nbsp;column, int&nbsp;align )<tt> [virtual]</tt>
</h3>
Sets column <em>column</em>'s alignment to <em>align</em>. The alignment is
ultimately passed to <a href="qlistviewitem.html#paintCell">TQListViewItem::paintCell</a>() for each item in
the list view. For horizontally aligned text with TQt::AlignLeft or
TQt::AlignHCenter the ellipsis (...) will be to the right, for
TQt::AlignRight the ellipsis will be to the left.
<p> <p>See also <a href="qt.html#AlignmentFlags-enum">TQt::AlignmentFlags</a>.
<p>Example: <a href="listviews-example.html#x150">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="setColumnText"></a>TQListView::setColumnText ( int&nbsp;column, const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;label )<tt> [virtual]</tt>
</h3>
Sets the heading of column <em>column</em> to <em>label</em>.
<p> <p>See also <a href="#columnText">columnText</a>().
<h3 class=fn>void <a name="setColumnText-2"></a>TQListView::setColumnText ( int&nbsp;column, const&nbsp;<a href="qiconset.html">TQIconSet</a>&nbsp;&amp;&nbsp;iconset, const&nbsp;<a href="qstring.html">TQString</a>&nbsp;&amp;&nbsp;label )<tt> [virtual]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets the heading of column <em>column</em> to <em>iconset</em> and <em>label</em>.
<p> <p>See also <a href="#columnText">columnText</a>().
<h3 class=fn>void <a name="setColumnWidth"></a>TQListView::setColumnWidth ( int&nbsp;column, int&nbsp;w )<tt> [virtual]</tt>
</h3>
Sets the width of column <em>column</em> to <em>w</em> pixels. Note that if
the column has a <a href="#WidthMode-enum">WidthMode</a> other than <a href="#WidthMode-enum">Manual</a>, this width
setting may be subsequently overridden.
<p> <p>See also <a href="#columnWidth">columnWidth</a>().
<h3 class=fn>void <a name="setColumnWidthMode"></a>TQListView::setColumnWidthMode ( int&nbsp;c, <a href="qlistview.html#WidthMode-enum">WidthMode</a>&nbsp;mode )<tt> [virtual]</tt>
</h3>
Sets column <em>c</em>'s width mode to <em>mode</em>. The default depends on
the original width argument to <a href="#addColumn">addColumn</a>().
<p> <p>See also <a href="qlistviewitem.html#width">TQListViewItem::width</a>().
<h3 class=fn>void <a name="setCurrentItem"></a>TQListView::setCurrentItem ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;i )<tt> [virtual]</tt>
</h3>
Sets item <em>i</em> to be the current item and repaints appropriately
(i.e. highlights the item). The current item is used for keyboard
navigation and focus indication; it is independent of any selected
items, although a selected item can also be the current item.
<p> This function does not set the selection anchor. Use
<a href="#setSelectionAnchor">setSelectionAnchor</a>() instead.
<p> <p>See also <a href="#currentItem">currentItem</a>() and <a href="#setSelected">setSelected</a>().
<p>Example: <a href="listviews-example.html#x151">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="setDefaultRenameAction"></a>TQListView::setDefaultRenameAction ( <a href="qlistview.html#RenameAction-enum">RenameAction</a>&nbsp;a )<tt> [virtual]</tt>
</h3><p>Sets what action to perform when the editor loses focus during renaming to <em>a</em>.
See the <a href="qlistview.html#defaultRenameAction-prop">"defaultRenameAction"</a> property for details.
<h3 class=fn>void <a name="setItemMargin"></a>TQListView::setItemMargin ( int )<tt> [virtual]</tt>
</h3><p>Sets the advisory item margin that list items may use.
See the <a href="qlistview.html#itemMargin-prop">"itemMargin"</a> property for details.
<h3 class=fn>void <a name="setMultiSelection"></a>TQListView::setMultiSelection ( bool&nbsp;enable )<tt> [virtual]</tt>
</h3><p>Sets whether the list view is in multi-selection or extended-selection mode to <em>enable</em>.
See the <a href="qlistview.html#multiSelection-prop">"multiSelection"</a> property for details.
<h3 class=fn>void <a name="setOpen"></a>TQListView::setOpen ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item, bool&nbsp;open )<tt> [virtual]</tt>
</h3>
Sets <em>item</em> to be open if <em>open</em> is TRUE and <em>item</em> is
expandable, and to be closed if <em>open</em> is FALSE. Repaints
accordingly.
<p> <p>See also <a href="qlistviewitem.html#setOpen">TQListViewItem::setOpen</a>() and <a href="qlistviewitem.html#setExpandable">TQListViewItem::setExpandable</a>().
<h3 class=fn>void <a name="setResizeMode"></a>TQListView::setResizeMode ( <a href="qlistview.html#ResizeMode-enum">ResizeMode</a>&nbsp;m )<tt> [virtual]</tt>
</h3><p>Sets whether all, none or the only the last column should be resized to <em>m</em>.
See the <a href="qlistview.html#resizeMode-prop">"resizeMode"</a> property for details.
<h3 class=fn>void <a name="setRootIsDecorated"></a>TQListView::setRootIsDecorated ( bool )<tt> [virtual]</tt>
</h3><p>Sets whether the list view shows open/close signs on root items.
See the <a href="qlistview.html#rootIsDecorated-prop">"rootIsDecorated"</a> property for details.
<h3 class=fn>void <a name="setSelected"></a>TQListView::setSelected ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item, bool&nbsp;selected )<tt> [virtual]</tt>
</h3>
If <em>selected</em> is TRUE the <em>item</em> is selected; otherwise it is
unselected.
<p> If the list view is in <a href="#SelectionMode-enum">Single</a> selection mode and <em>selected</em> is
TRUE, the currently selected item is unselected and <em>item</em> is
made current. Unlike <a href="qlistviewitem.html#setSelected">TQListViewItem::setSelected</a>(), this function
updates the list view as necessary and emits the
<a href="#selectionChanged">selectionChanged</a>() signals.
<p> <p>See also <a href="#isSelected">isSelected</a>(), <a href="#multiSelection-prop">multiSelection</a>, <a href="#multiSelection-prop">multiSelection</a>, <a href="#setCurrentItem">setCurrentItem</a>(), and <a href="#setSelectionAnchor">setSelectionAnchor</a>().
<p>Example: <a href="listviews-example.html#x153">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="setSelectionAnchor"></a>TQListView::setSelectionAnchor ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;item )
</h3>
Sets the selection anchor to <em>item</em>, if <em>item</em> is selectable.
<p> The selection anchor is the item that remains selected when
Shift-selecting with either mouse or keyboard in <a href="#SelectionMode-enum">Extended</a>
selection mode.
<p> <p>See also <a href="#setSelected">setSelected</a>().
<h3 class=fn>void <a name="setSelectionMode"></a>TQListView::setSelectionMode ( <a href="qlistview.html#SelectionMode-enum">SelectionMode</a>&nbsp;mode )
</h3><p>Sets the list view's selection mode to <em>mode</em>.
See the <a href="qlistview.html#selectionMode-prop">"selectionMode"</a> property for details.
<h3 class=fn>void <a name="setShowSortIndicator"></a>TQListView::setShowSortIndicator ( bool&nbsp;show )<tt> [virtual]</tt>
</h3><p>Sets whether the list view header should display a sort indicator to <em>show</em>.
See the <a href="qlistview.html#showSortIndicator-prop">"showSortIndicator"</a> property for details.
<h3 class=fn>void <a name="setShowToolTips"></a>TQListView::setShowToolTips ( bool&nbsp;b )<tt> [virtual]</tt>
</h3><p>Sets whether this list view should show tooltips for truncated column texts to <em>b</em>.
See the <a href="qlistview.html#showToolTips-prop">"showToolTips"</a> property for details.
<h3 class=fn>void <a name="setSortColumn"></a>TQListView::setSortColumn ( int&nbsp;column )
</h3>
Sets the sorting column for the list view.
<p> If <em>column</em> is -1, sorting is disabled and the user cannot sort
columns by clicking on the column headers. If <em>column</em> is larger
than the number of columns the user must click on a column header
to sort the list view.
<p> <p>See also <a href="#setSorting">setSorting</a>().
<h3 class=fn>void <a name="setSortOrder"></a>TQListView::setSortOrder ( <a href="qt.html#SortOrder-enum">SortOrder</a>&nbsp;order )
</h3>
Sets the sort order for the items in the list view to <em>order</em>.
<p> <p>See also <a href="#setSorting">setSorting</a>().
<h3 class=fn>void <a name="setSorting"></a>TQListView::setSorting ( int&nbsp;column, bool&nbsp;ascending = TRUE )<tt> [virtual]</tt>
</h3>
Sets the list view to be sorted by column <em>column</em> in ascending
order if <em>ascending</em> is TRUE or descending order if it is FALSE.
<p> If <em>column</em> is -1, sorting is disabled and the user cannot sort
columns by clicking on the column headers. If <em>column</em> is larger
than the number of columns the user must click on a column
header to sort the list view.
<h3 class=fn>void <a name="setTreeStepSize"></a>TQListView::setTreeStepSize ( int )<tt> [virtual]</tt>
</h3><p>Sets the number of pixels a child is offset from its parent.
See the <a href="qlistview.html#treeStepSize-prop">"treeStepSize"</a> property for details.
<h3 class=fn>bool <a name="showSortIndicator"></a>TQListView::showSortIndicator () const
</h3><p>Returns TRUE if the list view header should display a sort indicator; otherwise returns FALSE.
See the <a href="qlistview.html#showSortIndicator-prop">"showSortIndicator"</a> property for details.
<h3 class=fn>bool <a name="showToolTips"></a>TQListView::showToolTips () const
</h3><p>Returns TRUE if this list view should show tooltips for truncated column texts; otherwise returns FALSE.
See the <a href="qlistview.html#showToolTips-prop">"showToolTips"</a> property for details.
<h3 class=fn>void <a name="sort"></a>TQListView::sort ()<tt> [virtual]</tt>
</h3>
Sorts the list view using the last sorting configuration (sort
column and ascending/descending).
<h3 class=fn>int <a name="sortColumn"></a>TQListView::sortColumn () const
</h3>
Returns the column by which the list view is sorted, or -1 if
sorting is disabled.
<p> <p>See also <a href="#sortOrder">sortOrder</a>().
<h3 class=fn><a href="qt.html#SortOrder-enum">SortOrder</a> <a name="sortOrder"></a>TQListView::sortOrder () const
</h3>
Returns the sorting order of the list view items.
<p> <p>See also <a href="#sortColumn">sortColumn</a>().
<h3 class=fn>void <a name="spacePressed"></a>TQListView::spacePressed ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;* )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when Space is pressed. The argument is
the <a href="#currentItem">currentItem</a>().
<h3 class=fn>void <a name="startDrag"></a>TQListView::startDrag ()<tt> [virtual protected]</tt>
</h3>
Starts a drag.
<h3 class=fn>void <a name="takeItem"></a>TQListView::takeItem ( <a href="qlistviewitem.html">TQListViewItem</a>&nbsp;*&nbsp;i )<tt> [virtual]</tt>
</h3>
Removes item <em>i</em> from the list view; <em>i</em> must be a top-level
item. The warnings regarding <a href="qlistviewitem.html#takeItem">TQListViewItem::takeItem</a>() apply to
this function, too.
<p> <p>See also <a href="#insertItem">insertItem</a>().
<h3 class=fn>int <a name="treeStepSize"></a>TQListView::treeStepSize () const
</h3><p>Returns the number of pixels a child is offset from its parent.
See the <a href="qlistview.html#treeStepSize-prop">"treeStepSize"</a> property for details.
<h3 class=fn>void <a name="triggerUpdate"></a>TQListView::triggerUpdate ()<tt> [slot]</tt>
</h3>
Triggers a size, geometry and content update during the next
iteration of the event loop. Ensures that there'll be just one
update to avoid flicker.
<h3 class=fn>void <a name="updateContents"></a>TQListView::updateContents ()<tt> [protected slot]</tt>
</h3>
Updates the sizes of the viewport, header, scroll bars and so on.
<p> <b>Warning:</b> Don't call this directly; call <a href="#triggerUpdate">triggerUpdate</a>() instead.
<hr><h2>Property Documentation</h2>
<h3 class=fn>bool <a name="allColumnsShowFocus-prop"></a>allColumnsShowFocus</h3>
<p>This property holds whether items should show <a href="focus.html#keyboard-focus">keyboard focus</a> using all columns.
<p>If this property is TRUE all columns will show focus and selection
states, otherwise only column 0 will show focus.
<p> The default is FALSE.
<p> Setting this to TRUE if it's not necessary may cause noticeable
flicker.
<p>Set this property's value with <a href="#setAllColumnsShowFocus">setAllColumnsShowFocus</a>() and get this property's value with <a href="#allColumnsShowFocus">allColumnsShowFocus</a>().
<h3 class=fn>int <a name="childCount-prop"></a>childCount</h3>
<p>This property holds the number of parentless (top-level) <a href="qlistviewitem.html">TQListViewItem</a> objects in this TQListView.
<p>Holds the current number of parentless (top-level) TQListViewItem
objects in this TQListView.
<p> <p>See also <a href="qlistviewitem.html#childCount">TQListViewItem::childCount</a>().
<p>Get this property's value with <a href="#childCount">childCount</a>().
<h3 class=fn>int <a name="columns-prop"></a>columns</h3>
<p>This property holds the number of columns in this list view.
<p>Get this property's value with <a href="#columns">columns</a>().
<p><p>See also <a href="#addColumn">addColumn</a>() and <a href="#removeColumn">removeColumn</a>().
<h3 class=fn><a href="qlistview.html#RenameAction-enum">RenameAction</a> <a name="defaultRenameAction-prop"></a>defaultRenameAction</h3>
<p>This property holds what action to perform when the editor loses focus during renaming.
<p>If this property is <a href="#RenameAction-enum">Accept</a>, and the user renames an item and
the editor loses focus (without the user pressing Enter), the
item will still be renamed. If the property's value is <a href="#RenameAction-enum">Reject</a>,
the item will not be renamed unless the user presses Enter. The
default is <a href="#RenameAction-enum">Reject</a>.
<p>Set this property's value with <a href="#setDefaultRenameAction">setDefaultRenameAction</a>() and get this property's value with <a href="#defaultRenameAction">defaultRenameAction</a>().
<h3 class=fn>int <a name="itemMargin-prop"></a>itemMargin</h3>
<p>This property holds the advisory item margin that list items may use.
<p>The item margin defaults to one pixel and is the margin between
the item's edges and the area where it draws its contents.
<a href="qlistviewitem.html#paintFocus">TQListViewItem::paintFocus</a>() draws in the margin.
<p> <p>See also <a href="qlistviewitem.html#paintCell">TQListViewItem::paintCell</a>().
<p>Set this property's value with <a href="#setItemMargin">setItemMargin</a>() and get this property's value with <a href="#itemMargin">itemMargin</a>().
<h3 class=fn>bool <a name="multiSelection-prop"></a>multiSelection</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> <p>This property holds whether the list view is in multi-selection or extended-selection mode.
<p>If you enable multi-selection, <a href="#SelectionMode-enum">Multi</a>, mode, it is possible to
specify whether or not this mode should be extended. <a href="#SelectionMode-enum">Extended</a>
means that the user can select multiple items only when pressing
the Shift or Ctrl key at the same time.
<p> The default selection mode is <a href="#SelectionMode-enum">Single</a>.
<p> <p>See also <a href="#selectionMode-prop">selectionMode</a>.
<p>Set this property's value with <a href="#setMultiSelection">setMultiSelection</a>() and get this property's value with <a href="#isMultiSelection">isMultiSelection</a>().
<h3 class=fn><a href="qlistview.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode-prop"></a>resizeMode</h3>
<p>This property holds whether all, none or the only the last column should be resized.
<p>Specifies whether all, none or only the last column should be
resized to fit the full width of the list view. The values for this
property can be one of: <a href="#ResizeMode-enum">NoColumn</a> (the default), <a href="#ResizeMode-enum">AllColumns</a>
or <a href="#ResizeMode-enum">LastColumn</a>.
<p> <b>Warning:</b> Setting the resize mode should be done after all necessary
columns have been added to the list view, otherwise the behavior is
undefined.
<p> <p>See also <a href="qheader.html">TQHeader</a> and <a href="#header">header</a>().
<p>Set this property's value with <a href="#setResizeMode">setResizeMode</a>() and get this property's value with <a href="#resizeMode">resizeMode</a>().
<h3 class=fn>bool <a name="rootIsDecorated-prop"></a>rootIsDecorated</h3>
<p>This property holds whether the list view shows open/close signs on root items.
<p>Open/close signs are small <b>+</b> or <b>-</b> symbols in windows
style, or arrows in <a href="motif-extension.html#Motif">Motif</a> style. The default is FALSE.
<p>Set this property's value with <a href="#setRootIsDecorated">setRootIsDecorated</a>() and get this property's value with <a href="#rootIsDecorated">rootIsDecorated</a>().
<h3 class=fn><a href="qlistview.html#SelectionMode-enum">SelectionMode</a> <a name="selectionMode-prop"></a>selectionMode</h3>
<p>This property holds the list view's selection mode.
<p>The mode can be <a href="#SelectionMode-enum">Single</a> (the default), <a href="#SelectionMode-enum">Extended</a>, <a href="#SelectionMode-enum">Multi</a> or
<a href="#SelectionMode-enum">NoSelection</a>.
<p> <p>See also <a href="#multiSelection-prop">multiSelection</a>.
<p>Set this property's value with <a href="#setSelectionMode">setSelectionMode</a>() and get this property's value with <a href="#selectionMode">selectionMode</a>().
<h3 class=fn>bool <a name="showSortIndicator-prop"></a>showSortIndicator</h3>
<p>This property holds whether the list view header should display a sort indicator.
<p>If this property is TRUE, an arrow is drawn in the header of the
list view to indicate the sort order of the list view contents.
The arrow will be drawn in the correct column and will point up or
down, depending on the current sort direction. The default is
FALSE (don't show an indicator).
<p> <p>See also <a href="qheader.html#setSortIndicator">TQHeader::setSortIndicator</a>().
<p>Set this property's value with <a href="#setShowSortIndicator">setShowSortIndicator</a>() and get this property's value with <a href="#showSortIndicator">showSortIndicator</a>().
<h3 class=fn>bool <a name="showToolTips-prop"></a>showToolTips</h3>
<p>This property holds whether this list view should show tooltips for truncated column texts.
<p>The default is TRUE.
<p>Set this property's value with <a href="#setShowToolTips">setShowToolTips</a>() and get this property's value with <a href="#showToolTips">showToolTips</a>().
<h3 class=fn>int <a name="treeStepSize-prop"></a>treeStepSize</h3>
<p>This property holds the number of pixels a child is offset from its parent.
<p>The default is 20 pixels.
<p> Of course, this property is only meaningful for hierarchical list
views.
<p>Set this property's value with <a href="#setTreeStepSize">setTreeStepSize</a>() and get this property's value with <a href="#treeStepSize">treeStepSize</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>