<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/widgets/qlistview.cpp:2160 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>QListView Class</title> <style type="text/css"><!-- h3.fn,span.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 Classes</font></a> | <a href="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped 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>QListView Class Reference</h1> <p>The QListView class implements a list/tree view. <a href="#details">More...</a> <p><tt>#include <<a href="qlistview-h.html">qlistview.h</a>></tt> <p>Inherits <a href="qscrollview.html">QScrollView</a>. <p><a href="qlistview-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li><div class=fn><a href="#QListView"><b>QListView</b></a> ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )</div></li> <li><div class=fn><a href="#~QListView"><b>~QListView</b></a> ()</div></li> <li><div class=fn>int <a href="#treeStepSize"><b>treeStepSize</b></a> () const</div></li> <li><div class=fn>virtual void <a href="#setTreeStepSize"><b>setTreeStepSize</b></a> ( int )</div></li> <li><div class=fn>virtual void <a href="#insertItem"><b>insertItem</b></a> ( QListViewItem * i )</div></li> <li><div class=fn>virtual void <a href="#takeItem"><b>takeItem</b></a> ( QListViewItem * i )</div></li> <li><div class=fn>virtual void removeItem ( QListViewItem * item ) <em>(obsolete)</em></div></li> <li><div class=fn>QHeader * <a href="#header"><b>header</b></a> () const</div></li> <li><div class=fn>virtual int <a href="#addColumn"><b>addColumn</b></a> ( const QString & label, int width = -1 )</div></li> <li><div class=fn>virtual int <a href="#addColumn-2"><b>addColumn</b></a> ( const QIconSet & iconset, const QString & label, int width = -1 )</div></li> <li><div class=fn>virtual void <a href="#removeColumn"><b>removeColumn</b></a> ( int index )</div></li> <li><div class=fn>virtual void <a href="#setColumnText"><b>setColumnText</b></a> ( int column, const QString & label )</div></li> <li><div class=fn>virtual void <a href="#setColumnText-2"><b>setColumnText</b></a> ( int column, const QIconSet & iconset, const QString & label )</div></li> <li><div class=fn>QString <a href="#columnText"><b>columnText</b></a> ( int c ) const</div></li> <li><div class=fn>virtual void <a href="#setColumnWidth"><b>setColumnWidth</b></a> ( int column, int w )</div></li> <li><div class=fn>int <a href="#columnWidth"><b>columnWidth</b></a> ( int c ) const</div></li> <li><div class=fn>enum <a href="#WidthMode-enum"><b>WidthMode</b></a> { Manual, Maximum }</div></li> <li><div class=fn>virtual void <a href="#setColumnWidthMode"><b>setColumnWidthMode</b></a> ( int c, WidthMode mode )</div></li> <li><div class=fn>WidthMode <a href="#columnWidthMode"><b>columnWidthMode</b></a> ( int c ) const</div></li> <li><div class=fn>int <a href="#columns"><b>columns</b></a> () const</div></li> <li><div class=fn>virtual void <a href="#setColumnAlignment"><b>setColumnAlignment</b></a> ( int column, int align )</div></li> <li><div class=fn>int <a href="#columnAlignment"><b>columnAlignment</b></a> ( int column ) const</div></li> <li><div class=fn>QListViewItem * <a href="#itemAt"><b>itemAt</b></a> ( const QPoint & viewPos ) const</div></li> <li><div class=fn>QRect <a href="#itemRect"><b>itemRect</b></a> ( const QListViewItem * i ) const</div></li> <li><div class=fn>int <a href="#itemPos"><b>itemPos</b></a> ( const QListViewItem * item )</div></li> <li><div class=fn>void <a href="#ensureItemVisible"><b>ensureItemVisible</b></a> ( const QListViewItem * i )</div></li> <li><div class=fn>void <a href="#repaintItem"><b>repaintItem</b></a> ( const QListViewItem * item ) const</div></li> <li><div class=fn>virtual void <a href="#setMultiSelection"><b>setMultiSelection</b></a> ( bool enable )</div></li> <li><div class=fn>bool <a href="#isMultiSelection"><b>isMultiSelection</b></a> () const</div></li> <li><div class=fn>enum <a href="#SelectionMode-enum"><b>SelectionMode</b></a> { Single, Multi, Extended, NoSelection }</div></li> <li><div class=fn>void <a href="#setSelectionMode"><b>setSelectionMode</b></a> ( SelectionMode mode )</div></li> <li><div class=fn>SelectionMode <a href="#selectionMode"><b>selectionMode</b></a> () const</div></li> <li><div class=fn>virtual void <a href="#clearSelection"><b>clearSelection</b></a> ()</div></li> <li><div class=fn>virtual void <a href="#setSelected"><b>setSelected</b></a> ( QListViewItem * item, bool selected )</div></li> <li><div class=fn>bool <a href="#isSelected"><b>isSelected</b></a> ( const QListViewItem * i ) const</div></li> <li><div class=fn>QListViewItem * <a href="#selectedItem"><b>selectedItem</b></a> () const</div></li> <li><div class=fn>virtual void <a href="#setOpen"><b>setOpen</b></a> ( QListViewItem * item, bool open )</div></li> <li><div class=fn>bool <a href="#isOpen"><b>isOpen</b></a> ( const QListViewItem * item ) const</div></li> <li><div class=fn>virtual void <a href="#setCurrentItem"><b>setCurrentItem</b></a> ( QListViewItem * i )</div></li> <li><div class=fn>QListViewItem * <a href="#currentItem"><b>currentItem</b></a> () const</div></li> <li><div class=fn>QListViewItem * <a href="#firstChild"><b>firstChild</b></a> () const</div></li> <li><div class=fn>QListViewItem * <a href="#lastItem"><b>lastItem</b></a> () const</div></li> <li><div class=fn>int <a href="#childCount"><b>childCount</b></a> () const</div></li> <li><div class=fn>virtual void <a href="#setAllColumnsShowFocus"><b>setAllColumnsShowFocus</b></a> ( bool )</div></li> <li><div class=fn>bool <a href="#allColumnsShowFocus"><b>allColumnsShowFocus</b></a> () const</div></li> <li><div class=fn>virtual void <a href="#setItemMargin"><b>setItemMargin</b></a> ( int )</div></li> <li><div class=fn>int <a href="#itemMargin"><b>itemMargin</b></a> () const</div></li> <li><div class=fn>virtual void <a href="#setRootIsDecorated"><b>setRootIsDecorated</b></a> ( bool )</div></li> <li><div class=fn>bool <a href="#rootIsDecorated"><b>rootIsDecorated</b></a> () const</div></li> <li><div class=fn>virtual void <a href="#setSorting"><b>setSorting</b></a> ( int column, bool ascending = TRUE )</div></li> <li><div class=fn>virtual void <a href="#sort"><b>sort</b></a> ()</div></li> <li><div class=fn>virtual bool <a href="#eventFilter"><b>eventFilter</b></a> ( QObject * o, QEvent * e )</div></li> <li><div class=fn>virtual void <a href="#setShowSortIndicator"><b>setShowSortIndicator</b></a> ( bool show )</div></li> <li><div class=fn>bool <a href="#showSortIndicator"><b>showSortIndicator</b></a> () const</div></li> <li><div class=fn>virtual void <a href="#setShowToolTips"><b>setShowToolTips</b></a> ( bool b )</div></li> <li><div class=fn>bool <a href="#showToolTips"><b>showToolTips</b></a> () const</div></li> <li><div class=fn>enum <a href="#ResizeMode-enum"><b>ResizeMode</b></a> { NoColumn, AllColumns, LastColumn }</div></li> <li><div class=fn>virtual void <a href="#setResizeMode"><b>setResizeMode</b></a> ( ResizeMode m )</div></li> <li><div class=fn>ResizeMode <a href="#resizeMode"><b>resizeMode</b></a> () const</div></li> <li><div class=fn>QListViewItem * <a href="#findItem"><b>findItem</b></a> ( const QString & text, int column, ComparisonFlags compare = ExactMatch | CaseSensitive ) const</div></li> <li><div class=fn>enum <a href="#RenameAction-enum"><b>RenameAction</b></a> { Accept, Reject }</div></li> <li><div class=fn>virtual void <a href="#setDefaultRenameAction"><b>setDefaultRenameAction</b></a> ( RenameAction a )</div></li> <li><div class=fn>RenameAction <a href="#defaultRenameAction"><b>defaultRenameAction</b></a> () const</div></li> <li><div class=fn>bool <a href="#isRenaming"><b>isRenaming</b></a> () const</div></li> </ul> <h2>Public Slots</h2> <ul> <li><div class=fn>virtual void <a href="#clear"><b>clear</b></a> ()</div></li> <li><div class=fn>virtual void <a href="#invertSelection"><b>invertSelection</b></a> ()</div></li> <li><div class=fn>virtual void <a href="#selectAll"><b>selectAll</b></a> ( bool select )</div></li> <li><div class=fn>void <a href="#triggerUpdate"><b>triggerUpdate</b></a> ()</div></li> </ul> <h2>Signals</h2> <ul> <li><div class=fn>void <a href="#selectionChanged"><b>selectionChanged</b></a> ()</div></li> <li><div class=fn>void <a href="#selectionChanged-2"><b>selectionChanged</b></a> ( QListViewItem * )</div></li> <li><div class=fn>void <a href="#currentChanged"><b>currentChanged</b></a> ( QListViewItem * )</div></li> <li><div class=fn>void <a href="#clicked"><b>clicked</b></a> ( QListViewItem * item )</div></li> <li><div class=fn>void <a href="#clicked-2"><b>clicked</b></a> ( QListViewItem * item, const QPoint & pnt, int c )</div></li> <li><div class=fn>void <a href="#pressed"><b>pressed</b></a> ( QListViewItem * item )</div></li> <li><div class=fn>void <a href="#pressed-2"><b>pressed</b></a> ( QListViewItem * item, const QPoint & pnt, int c )</div></li> <li><div class=fn>void <a href="#doubleClicked"><b>doubleClicked</b></a> ( QListViewItem * item )</div></li> <li><div class=fn>void <a href="#returnPressed"><b>returnPressed</b></a> ( QListViewItem * )</div></li> <li><div class=fn>void <a href="#spacePressed"><b>spacePressed</b></a> ( QListViewItem * )</div></li> <li><div class=fn>void <a href="#rightButtonClicked"><b>rightButtonClicked</b></a> ( QListViewItem *, const QPoint &, int )</div></li> <li><div class=fn>void <a href="#rightButtonPressed"><b>rightButtonPressed</b></a> ( QListViewItem *, const QPoint &, int )</div></li> <li><div class=fn>void <a href="#mouseButtonPressed"><b>mouseButtonPressed</b></a> ( int button, QListViewItem * item, const QPoint & pos, int c )</div></li> <li><div class=fn>void <a href="#mouseButtonClicked"><b>mouseButtonClicked</b></a> ( int button, QListViewItem * item, const QPoint & pos, int c )</div></li> <li><div class=fn>void <a href="#contextMenuRequested"><b>contextMenuRequested</b></a> ( QListViewItem * item, const QPoint & pos, int col )</div></li> <li><div class=fn>void <a href="#onItem"><b>onItem</b></a> ( QListViewItem * i )</div></li> <li><div class=fn>void <a href="#onViewport"><b>onViewport</b></a> ()</div></li> <li><div class=fn>void <a href="#expanded"><b>expanded</b></a> ( QListViewItem * item )</div></li> <li><div class=fn>void <a href="#collapsed"><b>collapsed</b></a> ( QListViewItem * item )</div></li> <li><div class=fn>void <a href="#dropped"><b>dropped</b></a> ( QDropEvent * e )</div></li> <li><div class=fn>void <a href="#itemRenamed"><b>itemRenamed</b></a> ( QListViewItem * item, int col, const QString & text )</div></li> <li><div class=fn>void <a href="#itemRenamed-2"><b>itemRenamed</b></a> ( QListViewItem * item, int col )</div></li> </ul> <h2>Properties</h2> <ul> <li><div class=fn>bool <a href="#allColumnsShowFocus-prop"><b>allColumnsShowFocus</b></a> - whether items should show keyboard focus using all columns</div></li> <li><div class=fn>int <a href="#childCount-prop"><b>childCount</b></a> - the number of parentless (top level) QListViewItem objects in this QListView <em>(read only)</em></div></li> <li><div class=fn>int <a href="#columns-prop"><b>columns</b></a> - the number of columns in this list view <em>(read only)</em></div></li> <li><div class=fn>RenameAction <a href="#defaultRenameAction-prop"><b>defaultRenameAction</b></a> - whether the list view accepts the rename operation by default</div></li> <li><div class=fn>int <a href="#itemMargin-prop"><b>itemMargin</b></a> - the advisory item margin that list items may use</div></li> <li><div class=fn>bool <a href="#multiSelection-prop"><b>multiSelection</b></a> - whether the list view is in multi-selection or single selection mode</div></li> <li><div class=fn>ResizeMode <a href="#resizeMode-prop"><b>resizeMode</b></a> - whether all, none or the last column should be resized</div></li> <li><div class=fn>bool <a href="#rootIsDecorated-prop"><b>rootIsDecorated</b></a> - whether the list view show open/close signs on root items</div></li> <li><div class=fn>SelectionMode <a href="#selectionMode-prop"><b>selectionMode</b></a> - the list view's multi-selection mode</div></li> <li><div class=fn>bool <a href="#showSortIndicator-prop"><b>showSortIndicator</b></a> - whether the list view header should display a sort indicator</div></li> <li><div class=fn>bool <a href="#showToolTips-prop"><b>showToolTips</b></a> - whether this list view should show tooltips for truncated column texts</div></li> <li><div class=fn>int <a href="#treeStepSize-prop"><b>treeStepSize</b></a> - the number of pixels a child is offset from its parent</div></li> </ul> <h2>Protected Members</h2> <ul> <li><div class=fn>virtual void <a href="#contentsMousePressEvent"><b>contentsMousePressEvent</b></a> ( QMouseEvent * e )</div></li> <li><div class=fn>virtual void <a href="#contentsMouseReleaseEvent"><b>contentsMouseReleaseEvent</b></a> ( QMouseEvent * e )</div></li> <li><div class=fn>virtual void <a href="#contentsMouseMoveEvent"><b>contentsMouseMoveEvent</b></a> ( QMouseEvent * e )</div></li> <li><div class=fn>virtual void <a href="#contentsMouseDoubleClickEvent"><b>contentsMouseDoubleClickEvent</b></a> ( QMouseEvent * e )</div></li> <li><div class=fn>virtual QDragObject * <a href="#dragObject"><b>dragObject</b></a> ()</div></li> <li><div class=fn>virtual void <a href="#startDrag"><b>startDrag</b></a> ()</div></li> <li><div class=fn>virtual void <a href="#resizeEvent"><b>resizeEvent</b></a> ( QResizeEvent * e )</div></li> <li><div class=fn>virtual void <a href="#drawContentsOffset"><b>drawContentsOffset</b></a> ( QPainter * p, int ox, int oy, int cx, int cy, int cw, int ch )</div></li> <li><div class=fn>virtual void <a href="#paintEmptyArea"><b>paintEmptyArea</b></a> ( QPainter * p, const QRect & rect )</div></li> </ul> <h2>Protected Slots</h2> <ul> <li><div class=fn>void <a href="#updateContents"><b>updateContents</b></a> ()</div></li> <li><div class=fn>void <a href="#doAutoScroll"><b>doAutoScroll</b></a> ()</div></li> </ul> <hr><a name="details"></a><h2>Detailed Description</h2> The QListView class implements a list/tree view. <p> It can display and control a hierarchy of multi-column items, and provides the ability to add new items at any time. Among others the user may select one or many items and sort the list in increasing or decreasing order by any column. <p> The simplest mode of use is to create a QListView, add some column headers using <a href="#addColumn">addColumn</a>() and create one or more <a href="qlistviewitem.html">QListViewItem</a> or <a href="qchecklistitem.html">QCheckListItem</a> objects with the QListView as parent: <p> <pre> QListView * table; </pre> <pre> table->addColumn( "Qualified name" ); table->addColumn( "Namespace" ); </pre><pre> element = new <a href="qlistviewitem.html">QListViewItem</a>( table, qName, namespaceURI ); </pre> <p> Further nodes can be added to the listview object (the root of the tree) or as child nodes to QListViewItems: <p> <pre> <a name="x9"></a> for ( int i = 0 ; i < attributes.<a href="qxmlattributes.html#length">length</a>(); i++ ) { <a name="x11"></a><a name="x10"></a> new <a href="qlistviewitem.html">QListViewItem</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 <ul> <li> <a href="#addColumn">addColumn</a>() - adds a column with text and perhaps width. <p> <li> <a href="#setColumnWidthMode">setColumnWidthMode</a>() - sets the column to be resized automatically or not. <p> <li> <a href="#setAllColumnsShowFocus">setAllColumnsShowFocus</a>() - 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 using just column 0. <p> <li> <a href="#setRootIsDecorated">setRootIsDecorated</a>() - sets whether root items can be opened and closed by the user and have open/close decoration to their left. The default is FALSE. <p> <li> <a href="#setTreeStepSize">setTreeStepSize</a>() - 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. <p> <li> <a href="#setSorting">setSorting</a>() - sets whether the items should be sorted, whether it should be in ascending or descending order, and by what column it 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 ). </ul> <p> To handle events such as mouse presses on the list view, derived classes can reimplement the <a href="qscrollview.html">QScrollView</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 (not on-screen in the list view). <a href="#firstChild">firstChild</a>() returns the item at the top of the view (not necessarily on-screen) so you can iterate over the items using either <a href="qlistviewitem.html#itemBelow">QListViewItem::itemBelow</a>() or a combination of <a href="qlistviewitem.html#firstChild">QListViewItem::firstChild</a>() and <a href="qlistviewitem.html#nextSibling">QListViewItem::nextSibling</a>(). <p> If you need to move a list view item you can use <a href="#takeItem">takeItem</a>() and <a href="#insertItem">insertItem</a>(). Item's are deleted with delete; to delete all items use <a href="#clear">clear</a>(). See the <a href="qlistviewitem.html">QListViewItem</a> documentation for examples of traversal. <p> There are a variety of selection modes described in the QListView::SelectionMode documentation. The default is Single selection, which you can change using <a href="#setSelectionMode">setSelectionMode</a>(). <p> Because QListView offers multiple selection it has to 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 select which item displays keyboard focus (<a href="#setCurrentItem">setCurrentItem</a>()). <p> QListView emits two groups of signals; one group signals changes in selection/focus state and one signals selection. The first group consists of <a href="#selectionChanged">selectionChanged</a>() (applicable to all list views), selectionChanged( QListViewItem * ) (applicable only to Single selection list view), and <a href="#currentChanged">currentChanged</a>( QListViewItem * ). The second group consists of <a href="#doubleClicked">doubleClicked</a>( <a href="qlistviewitem.html">QListViewItem</a> * ), <a href="#returnPressed">returnPressed</a>( QListViewItem * ) and <a href="#rightButtonClicked">rightButtonClicked</a>( QListViewItem *, const <a href="qpoint.html">QPoint</a>&, int ), etc. <p> In Motif style, QListView 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 Single (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">QListView::SelectionMode</a> for details. <p> The listview can be navigated either using the mouse or the keyboard. Clicking an <em>-</em> icon closes an item (hides its children) and clicking an <em>+</em> icon opens an item (shows its children). The keyboard controls are these: <ul> <li> <em>Home</em> - Make the first item current and visible. <li> <em>End</em> - Make the last item current and visible. <li> <em>Page Up</em> - Make the item above the top visible item current and visible. <li> <em>Page Down</em> - Make the item below the bottom visible item current and visible. <li> <em>Up Arrow</em> - Make the item above the current item current and visible. <li> <em>Down Arrow</em> - Make the item below the current item current and visible. <li> <em>Left Arrow</em> - If the current item is closed (<em>+</em> icon) or has no children make its parent item current and visible. If the current item is open (<em>-</em> 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 listview will be scrolled left. <li> <em>Right Arrow</em> - If the current item is closed (<em>+</em> icon) and has children the item is opened. If the current item is opened (<em>-</em> icon) and has children the item's first child is made current and visible. If the current item has no children the listview is scrolled right. </ul> If the user starts typing letters with the focus in the listview 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">QListViewItem</a>, <a href="qchecklistitem.html">QCheckListItem</a> and <a href="advanced.html">Advanced Widgets</a>. <hr><h2>Member Type Documentation</h2> <h3 class=fn><a name="RenameAction-enum"></a>QListView::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>QListView::Accept</tt> - Rename if Enter is pressed or focus is lost. <li><tt>QListView::Reject</tt> - Discard the rename operation if focus is lost (and Enter has not been pressed). </ul><p> <h3 class=fn><a name="ResizeMode-enum"></a>QListView::ResizeMode</h3> <p> This enum describes how the header adjusts to resize events which affect the width of the listview. <ul> <li><tt>QListView::NoColumn</tt> - The columns do not get resized in resize events. <li><tt>QListView::AllColumns</tt> - All columns are resized equally to fit the width of the listview. <li><tt>QListView::LastColumn</tt> - The last columns is resized to fit the with of the listview. </ul><p> <h3 class=fn><a name="SelectionMode-enum"></a>QListView::SelectionMode</h3> <p> This enumerated type is used by QListView to indicate how it reacts to selection by the user. It has four values: <ul> <li><tt>QListView::Single</tt> - When the user selects an item, any already-selected item becomes unselected, and the user cannot unselect the selected item. This means that the user can never clear the selection, even though the selection may be cleared by the application programmer using <a href="#clearSelection">QListView::clearSelection</a>(). <li><tt>QListView::Multi</tt> - When the user selects an item in the most ordinary way, the selection status of that item is toggled and the other items are left alone. <li><tt>QListView::Extended</tt> - When the user selects an item in the most ordinary 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 while the left mouse button stays pressed. <li><tt>QListView::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>QListView::WidthMode</h3> <p> This enum type describes how the width of a column in the view changes. The currently defined modes are: <ul> <li><tt>QListView::Manual</tt> - the column width does not change automatically. <li><tt>QListView::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 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="QListView"></a>QListView::QListView ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0, WFlags f = 0 ) </h3> Constructs a new empty list view, with <em>parent</em> as a parent and <em>name</em> as object name. <p> Performance is boosted by modifying the <a href="qt.html#WidgetFlags">widget flags</a> <em>f</em> so that only part of the <a href="qlistviewitem.html">QListViewItem</a> children is redrawn. This may be unsuitable for custom QListViewItem classes, in which case <a href="qt.html#WidgetFlags-enum">WStaticContents</a> and <a href="qt.html#WidgetFlags-enum">WRepaintNoErase</a> should be cleared. <p> <p>See also <a href="qwidget.html#clearWFlags">QWidget::clearWFlags</a>() and <a href="qt.html#WidgetFlags-enum">Qt::WidgetFlags</a>. <h3 class=fn><a name="~QListView"></a>QListView::~QListView () </h3> Destroys the list view, deleting all its items, and frees up all allocated resources. <h3 class=fn>int <a name="addColumn"></a>QListView::addColumn ( const <a href="qstring.html">QString</a> & label, int width = -1 )<tt> [virtual]</tt> </h3> Adds a <em>width</em> pixels wide column with the column header <em>label</em> to <em>this</em> QListView, 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 Maximum instead of Manual. <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#x1974">addressbook/centralwidget.cpp</a>, <a href="checklists-example.html#x1868">checklists/checklists.cpp</a>, <a href="dirview-example.html#x1709">dirview/main.cpp</a>, <a href="fileiconview-example.html#x1599">fileiconview/mainwindow.cpp</a>, <a href="listviews-example.html#x1210">listviews/listviews.cpp</a> and <a href="qdir-example.html#x785">qdir/qdir.cpp</a>. <h3 class=fn>int <a name="addColumn-2"></a>QListView::addColumn ( const <a href="qiconset.html">QIconSet</a> & iconset, const <a href="qstring.html">QString</a> & label, int 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 <em>iconset</em> to <em>this</em> QListView, 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 Maximum, and to Manual otherwise. <p> <p>See also <a href="#setColumnText">setColumnText</a>(), <a href="#setColumnWidth">setColumnWidth</a>() and <a href="#setColumnWidthMode">setColumnWidthMode</a>(). <h3 class=fn>bool <a name="allColumnsShowFocus"></a>QListView::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>QListView::childCount () const </h3><p>Returns the number of parentless (top level) <a href="qlistviewitem.html">QListViewItem</a> objects in this QListView. See the <a href="qlistview.html#childCount-prop">"childCount"</a> property for details. <h3 class=fn>void <a name="clear"></a>QListView::clear ()<tt> [virtual slot]</tt> </h3> Removes and deletes all the items in this list view and triggers an update. <p> <p>See also <a href="#triggerUpdate">triggerUpdate</a>(). <p>Examples: <a href="addressbook-example.html#x1975">addressbook/centralwidget.cpp</a>, <a href="checklists-example.html#x1869">checklists/checklists.cpp</a>, <a href="listviews-example.html#x1211">listviews/listviews.cpp</a> and <a href="ftpclient-example.html#x1015">network/ftpclient/ftpmainwindow.cpp</a>. <h3 class=fn>void <a name="clearSelection"></a>QListView::clearSelection ()<tt> [virtual]</tt> </h3> Sets all items to be not selected, updates the list view as necessary and emits the <a href="#selectionChanged">selectionChanged</a>() signals. Note that for Multi 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#x1976">addressbook/centralwidget.cpp</a>. <h3 class=fn>void <a name="clicked"></a>QListView::clicked ( <a href="qlistviewitem.html">QListViewItem</a> * 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 pointer to the clicked list view item, or 0 if the user didn't click on an item. <p> Note that you may not delete any <a href="qlistviewitem.html">QListViewItem</a> objects in slots connected to this signal. <p>Example: <a href="addressbook-example.html#x1977">addressbook/centralwidget.cpp</a>. <h3 class=fn>void <a name="clicked-2"></a>QListView::clicked ( <a href="qlistviewitem.html">QListViewItem</a> * item, const <a href="qpoint.html">QPoint</a> & pnt, int 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 pointer to 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. 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> Note that you may not delete any <a href="qlistviewitem.html">QListViewItem</a> objects in slots connected to this signal. <h3 class=fn>void <a name="collapsed"></a>QListView::collapsed ( <a href="qlistviewitem.html">QListViewItem</a> * 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>QListView::columnAlignment ( int 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">Qt::AlignmentFlags</a>. <h3 class=fn><a href="qstring.html">QString</a> <a name="columnText"></a>QListView::columnText ( int 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>QListView::columnWidth ( int 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>QListView::columnWidthMode ( int c ) const </h3> Returns the WidthMode for column <em>c</em>. <p>See also <a href="#setColumnWidthMode">setColumnWidthMode</a>(). <h3 class=fn>int <a name="columns"></a>QListView::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>QListView::contentsMouseDoubleClickEvent ( <a href="qmouseevent.html">QMouseEvent</a> * 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">QScrollView</a>. <h3 class=fn>void <a name="contentsMouseMoveEvent"></a>QListView::contentsMouseMoveEvent ( <a href="qmouseevent.html">QMouseEvent</a> * 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#x1676">dirview/dirview.cpp</a>. <p>Reimplemented from <a href="qscrollview.html#contentsMouseMoveEvent">QScrollView</a>. <h3 class=fn>void <a name="contentsMousePressEvent"></a>QListView::contentsMousePressEvent ( <a href="qmouseevent.html">QMouseEvent</a> * 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#x1677">dirview/dirview.cpp</a>. <p>Reimplemented from <a href="qscrollview.html#contentsMousePressEvent">QScrollView</a>. <h3 class=fn>void <a name="contentsMouseReleaseEvent"></a>QListView::contentsMouseReleaseEvent ( <a href="qmouseevent.html">QMouseEvent</a> * 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#x1678">dirview/dirview.cpp</a>. <p>Reimplemented from <a href="qscrollview.html#contentsMouseReleaseEvent">QScrollView</a>. <h3 class=fn>void <a name="contextMenuRequested"></a>QListView::contextMenuRequested ( <a href="qlistviewitem.html">QListViewItem</a> * item, const <a href="qpoint.html">QPoint</a> & pos, int 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, with <em>item</em> being the item under the mouse cursor or the current item, respectively. <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#x1212">listviews/listviews.cpp</a>. <h3 class=fn>void <a name="currentChanged"></a>QListView::currentChanged ( <a href="qlistviewitem.html">QListViewItem</a> * )<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 was to make no item current. This can happen, for example, if all items in the list view are deleted. <p> Note that you may not delete any <a href="qlistviewitem.html">QListViewItem</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#x1213">listviews/listviews.cpp</a>. <h3 class=fn><a href="qlistviewitem.html">QListViewItem</a> * <a name="currentItem"></a>QListView::currentItem () const </h3> Returns a pointer to the currently highlighted item, or 0 if there isn't one. <p> <p>See also <a href="#setCurrentItem">setCurrentItem</a>(). <p>Examples: <a href="addressbook-example.html#x1978">addressbook/centralwidget.cpp</a> and <a href="listviews-example.html#x1214">listviews/listviews.cpp</a>. <h3 class=fn><a href="qlistview.html#RenameAction-enum">RenameAction</a> <a name="defaultRenameAction"></a>QListView::defaultRenameAction () const </h3><p>Returns TRUE if the list view accepts the rename operation by default; otherwise returns FALSE. See the <a href="qlistview.html#defaultRenameAction-prop">"defaultRenameAction"</a> property for details. <h3 class=fn>void <a name="doAutoScroll"></a>QListView::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>QListView::doubleClicked ( <a href="qlistviewitem.html">QListViewItem</a> * item )<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. <em>item</em> is the list view item on which the user did the double-click. <h3 class=fn><a href="qdragobject.html">QDragObject</a> * <a name="dragObject"></a>QListView::dragObject ()<tt> [virtual protected]</tt> </h3> If the user presses the mouse on an item and starts moving the mouse, and the items allow dragging (see <a href="qlistviewitem.html#setDragEnabled">QListViewItem::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">QDragObject</a> depending on the selected items. <h3 class=fn>void <a name="drawContentsOffset"></a>QListView::drawContentsOffset ( <a href="qpainter.html">QPainter</a> * p, int ox, int oy, int cx, int cy, int cw, int ch )<tt> [virtual protected]</tt> </h3> Calls <a href="qlistviewitem.html#paintCell">QListViewItem::paintCell</a>() and/or <a href="qlistviewitem.html#paintBranches">QListViewItem::paintBranches</a>() 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">QScrollView</a>. <h3 class=fn>void <a name="dropped"></a>QListView::dropped ( <a href="qdropevent.html">QDropEvent</a> * e )<tt> [signal]</tt> </h3> <p> This signal is emitted, when a drop event occurred onto the viewport (not onto an item). <p> <em>e</em> gives you all information about the drop. <h3 class=fn>void <a name="ensureItemVisible"></a>QListView::ensureItemVisible ( const <a href="qlistviewitem.html">QListViewItem</a> * i ) </h3> Ensures that item <em>i</em> is made visible, scrolling the list view vertically as required and also opening (expanding) any parent items if this is necessary to show the item. <p> <p>See also <a href="#itemRect">itemRect</a>() and <a href="qscrollview.html#ensureVisible">QScrollView::ensureVisible</a>(). <h3 class=fn>bool <a name="eventFilter"></a>QListView::eventFilter ( <a href="qobject.html">QObject</a> * o, <a href="qevent.html">QEvent</a> * 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">QScrollView</a>. <h3 class=fn>void <a name="expanded"></a>QListView::expanded ( <a href="qlistviewitem.html">QListViewItem</a> * 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">QListViewItem</a> * <a name="findItem"></a>QListView::findItem ( const <a href="qstring.html">QString</a> & text, int column, ComparisonFlags 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. Pass OR-ed together <a href="qt.html#StringComparisonMode-enum">Qt::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">QListViewItem</a> * <a name="firstChild"></a>QListView::firstChild () const </h3> Returns the first item in this QListView. You can use its <a href="qlistviewitem.html#firstChild">firstChild()</a> and <a href="qlistviewitem.html#nextSibling">nextSibling()</a> functions to traverse the entire tree of items. <p> Returns 0 if there is no first item. <p> <p>See also <a href="#itemAt">itemAt</a>(), <a href="qlistviewitem.html#itemBelow">QListViewItem::itemBelow</a>() and <a href="qlistviewitem.html#itemAbove">QListViewItem::itemAbove</a>(). <p>Examples: <a href="addressbook-example.html#x1979">addressbook/centralwidget.cpp</a> and <a href="listviews-example.html#x1215">listviews/listviews.cpp</a>. <h3 class=fn><a href="qheader.html">QHeader</a> * <a name="header"></a>QListView::header () const </h3> Returns a pointer to the <a href="qheader.html">QHeader</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">QHeader::setClickEnabled</a>(), <a href="qheader.html#setResizeEnabled">QHeader::setResizeEnabled</a>(), <a href="qheader.html#setMovingEnabled">QHeader::setMovingEnabled</a>() and all the const QHeader functions. <p>Examples: <a href="listviews-example.html#x1216">listviews/listviews.cpp</a> and <a href="qdir-example.html#x786">qdir/qdir.cpp</a>. <h3 class=fn>void <a name="insertItem"></a>QListView::insertItem ( <a href="qlistviewitem.html">QListViewItem</a> * 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">QListViewItem::takeItem</a>(<em>i</em>) and need to reinsert <em>i</em> elsewhere. <p> <p>See also <a href="qlistviewitem.html#takeItem">QListViewItem::takeItem</a>() and <a href="#takeItem">takeItem</a>(). <h3 class=fn>void <a name="invertSelection"></a>QListView::invertSelection ()<tt> [virtual slot]</tt> </h3> Inverts the selection. Works only in Multi and Extended selection mode. <h3 class=fn>bool <a name="isMultiSelection"></a>QListView::isMultiSelection () const </h3><p>Returns TRUE if the list view is in multi-selection or single 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>QListView::isOpen ( const <a href="qlistviewitem.html">QListViewItem</a> * 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>QListView::isRenaming () const </h3> Returns whether currently an item of the listview is being renamed <h3 class=fn>bool <a name="isSelected"></a>QListView::isSelected ( const <a href="qlistviewitem.html">QListViewItem</a> * 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">QListViewItem::isSelected</a>(). <h3 class=fn><a href="qlistviewitem.html">QListViewItem</a> * <a name="itemAt"></a>QListView::itemAt ( const <a href="qpoint.html">QPoint</a> & viewPos ) const </h3> Returns a pointer to the <a href="qlistviewitem.html">QListViewItem</a> at <em>viewPos</em>. Note that <em>viewPos</em> is in the coordinate system of <a href="qscrollview.html#viewport">viewport</a>(), 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">QListViewItem</a> *i = <a href="#itemAt">itemAt</a>( p ); if ( i ) { if ( p.x() > header()->cellPos( <a href="#header">header</a>()->mapToActual( 0 ) ) + <a href="#treeStepSize">treeStepSize</a>() * ( i-><a href="qlistviewitem.html#depth">depth</a>() + ( <a href="#rootIsDecorated">rootIsDecorated</a>() ? 1 : 0) ) + itemMargin() || p.x() < header()->cellPos( <a href="#header">header</a>()->mapToActual( 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>() and <a href="#itemRect">itemRect</a>(). <h3 class=fn>int <a name="itemMargin"></a>QListView::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>QListView::itemPos ( const <a href="qlistviewitem.html">QListViewItem</a> * 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">QListViewItem::itemPos</a>(). <p> <p>See also <a href="#itemAt">itemAt</a>() and <a href="#itemRect">itemRect</a>(). <h3 class=fn><a href="qrect.html">QRect</a> <a name="itemRect"></a>QListView::itemRect ( const <a href="qlistviewitem.html">QListViewItem</a> * 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 a null pointer 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">QListViewItem::height</a>(), rather than <a href="qlistviewitem.html#totalHeight">QListViewItem::totalHeight</a>()). If you want the rectangle to include children you can use something like this: <p> <pre> <a href="qrect.html">QRect</a> r( listView->itemRect( item ) ); r.<a href="qrect.html#setHeight">setHeight</a>( (QCOORD)(QMIN( item->totalHeight(), listView->viewport->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>QListView::itemRenamed ( <a href="qlistviewitem.html">QListViewItem</a> * item, int col, const <a href="qstring.html">QString</a> & 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>. <h3 class=fn>void <a name="itemRenamed-2"></a>QListView::itemRenamed ( <a href="qlistviewitem.html">QListViewItem</a> * item, int 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>. <h3 class=fn><a href="qlistviewitem.html">QListViewItem</a> * <a name="lastItem"></a>QListView::lastItem () const </h3> Returns the last item in the list view tree. <p> Returns 0 if there are no items in the QListView. <p> This function is slow. <h3 class=fn>void <a name="mouseButtonClicked"></a>QListView::mouseButtonClicked ( int button, <a href="qlistviewitem.html">QListViewItem</a> * item, const <a href="qpoint.html">QPoint</a> & pos, int 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 pointer to 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> Note that you may not delete any <a href="qlistviewitem.html">QListViewItem</a> objects in slots connected to this signal. <h3 class=fn>void <a name="mouseButtonPressed"></a>QListView::mouseButtonPressed ( int button, <a href="qlistviewitem.html">QListViewItem</a> * item, const <a href="qpoint.html">QPoint</a> & pos, int 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 pointer to 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> Note that you may not delete any <a href="qlistviewitem.html">QListViewItem</a> objects in slots connected to this signal. <h3 class=fn>void <a name="onItem"></a>QListView::onItem ( <a href="qlistviewitem.html">QListViewItem</a> * i )<tt> [signal]</tt> </h3> <p> This signal is emitted when the user moves the mouse cursor onto the item <em>i</em>, similar to the <a href="qwidget.html#enterEvent">QWidget::enterEvent</a>() function. <h3 class=fn>void <a name="onViewport"></a>QListView::onViewport ()<tt> [signal]</tt> </h3> 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>QListView::paintEmptyArea ( <a href="qpainter.html">QPainter</a> * p, const <a href="qrect.html">QRect</a> & 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 is 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>QListView::pressed ( <a href="qlistviewitem.html">QListViewItem</a> * 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 pointer to 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> Note that you may not delete any <a href="qlistviewitem.html">QListViewItem</a> objects in slots connected to this signal. <h3 class=fn>void <a name="pressed-2"></a>QListView::pressed ( <a href="qlistviewitem.html">QListViewItem</a> * item, const <a href="qpoint.html">QPoint</a> & pnt, int 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 pointer to 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, and <em>c</em> is the column where the mouse cursor was when the user pressed the mouse button. <p> Note that you may not delete any <a href="qlistviewitem.html">QListViewItem</a> objects in slots connected to this signal. <h3 class=fn>void <a name="removeColumn"></a>QListView::removeColumn ( int index )<tt> [virtual]</tt> </h3> Removes the column at position <em>index</em>. <h3 class=fn>void <a name="removeItem"></a>QListView::removeItem ( <a href="qlistviewitem.html">QListViewItem</a> * 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>QListView::repaintItem ( const <a href="qlistviewitem.html">QListViewItem</a> * 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>QListView::resizeEvent ( <a href="qresizeevent.html">QResizeEvent</a> * 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>QListView::resizeMode () const </h3><p>Returns TRUE if all, none or 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>QListView::returnPressed ( <a href="qlistviewitem.html">QListViewItem</a> * )<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>QListView::rightButtonClicked ( <a href="qlistviewitem.html">QListViewItem</a> *, const <a href="qpoint.html">QPoint</a> &, 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">QListViewItem</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>QListView::rightButtonPressed ( <a href="qlistviewitem.html">QListViewItem</a> *, const <a href="qpoint.html">QPoint</a> &, int )<tt> [signal]</tt> </h3> <p> This signal is emitted when the right button is pressed. Arguments are then the relevant <a href="qlistviewitem.html">QListViewItem</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>QListView::rootIsDecorated () const </h3><p>Returns TRUE if the list view show 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>QListView::selectAll ( bool select )<tt> [virtual slot]</tt> </h3> If <em>select</em> is TRUE, all items get selected; otherwise all items get unselected. This works only in the selection modes Multi and Extended. In Single and NoSelection mode the selection of the current item is just set to <em>select</em>. <h3 class=fn><a href="qlistviewitem.html">QListViewItem</a> * <a name="selectedItem"></a>QListView::selectedItem () const </h3> Returns a pointer to the selected item if the list view is in single-selection mode and an item is selected. <p> If no items are selected or the list view is in multi-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>QListView::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 both in Single selection and Multi selection mode but is most useful in Multi selection mode. <p> Note that you may not delete any <a href="qlistviewitem.html">QListViewItem</a> objects in slots connected to this signal. <p> <p>See also <a href="#setSelected">setSelected</a>() and <a href="qlistviewitem.html#setSelected">QListViewItem::setSelected</a>(). <p>Example: <a href="listviews-example.html#x1217">listviews/listviews.cpp</a>. <h3 class=fn>void <a name="selectionChanged-2"></a>QListView::selectionChanged ( <a href="qlistviewitem.html">QListViewItem</a> * )<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 Single selection mode (normally after the screen update). The argument is the newly selected item. <p> The no argument overload of this signal is more useful in Multi selection mode. <p> Note that you may not delete any <a href="qlistviewitem.html">QListViewItem</a> objects in slots connected to this signal. <p> <p>See also <a href="#setSelected">setSelected</a>(), <a href="qlistviewitem.html#setSelected">QListViewItem::setSelected</a>() and <a href="#currentChanged">currentChanged</a>(). <h3 class=fn><a href="qlistview.html#SelectionMode-enum">SelectionMode</a> <a name="selectionMode"></a>QListView::selectionMode () const </h3><p>Returns the list view's multi-selection mode. See the <a href="qlistview.html#selectionMode-prop">"selectionMode"</a> property for details. <h3 class=fn>void <a name="setAllColumnsShowFocus"></a>QListView::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>QListView::setColumnAlignment ( int column, int 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">QListViewItem::paintCell</a>() for each item in the view. <p> <p>See also <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a>. <p>Example: <a href="listviews-example.html#x1219">listviews/listviews.cpp</a>. <h3 class=fn>void <a name="setColumnText"></a>QListView::setColumnText ( int column, const <a href="qstring.html">QString</a> & label )<tt> [virtual]</tt> </h3> Sets the heading of column <em>column</em> to <em>label</em>. The leftmost column is 0. <p> <p>See also <a href="#columnText">columnText</a>(). <h3 class=fn>void <a name="setColumnText-2"></a>QListView::setColumnText ( int column, const <a href="qiconset.html">QIconSet</a> & iconset, const <a href="qstring.html">QString</a> & 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>. The leftmost column is 0. <p> <p>See also <a href="#columnText">columnText</a>(). <h3 class=fn>void <a name="setColumnWidth"></a>QListView::setColumnWidth ( int column, int 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 WidthMode other than Manual, this width setting may be subsequently overridden. The leftmost column is 0. <p> <p>See also <a href="#columnWidth">columnWidth</a>(). <h3 class=fn>void <a name="setColumnWidthMode"></a>QListView::setColumnWidthMode ( int c, <a href="qlistview.html#WidthMode-enum">WidthMode</a> mode )<tt> [virtual]</tt> </h3> Sets column <em>c</em>'s width mode to <em>mode</em>. The default depends on whether the width argument to addColumn was positive or negative. <p> <p>See also <a href="qlistviewitem.html#width">QListViewItem::width</a>(). <h3 class=fn>void <a name="setCurrentItem"></a>QListView::setCurrentItem ( <a href="qlistviewitem.html">QListViewItem</a> * i )<tt> [virtual]</tt> </h3> Sets item <em>i</em> to be the current highlighted item and repaints appropriately. This highlighted item is used for keyboard navigation and focus indication; it doesn't mean anything else, e.g. it is different from selection. <p> <p>See also <a href="#currentItem">currentItem</a>() and <a href="#setSelected">setSelected</a>(). <p>Example: <a href="listviews-example.html#x1220">listviews/listviews.cpp</a>. <h3 class=fn>void <a name="setDefaultRenameAction"></a>QListView::setDefaultRenameAction ( <a href="qlistview.html#RenameAction-enum">RenameAction</a> a )<tt> [virtual]</tt> </h3><p>Sets whether the list view accepts the rename operation by default 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>QListView::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>QListView::setMultiSelection ( bool enable )<tt> [virtual]</tt> </h3><p>Sets whether the list view is in multi-selection or single 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>QListView::setOpen ( <a href="qlistviewitem.html">QListViewItem</a> * item, bool 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> Does nothing if <em>item</em> is not expandable. <p> <p>See also <a href="qlistviewitem.html#setOpen">QListViewItem::setOpen</a>() and <a href="qlistviewitem.html#setExpandable">QListViewItem::setExpandable</a>(). <h3 class=fn>void <a name="setResizeMode"></a>QListView::setResizeMode ( <a href="qlistview.html#ResizeMode-enum">ResizeMode</a> m )<tt> [virtual]</tt> </h3><p>Sets whether all, none or 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>QListView::setRootIsDecorated ( bool )<tt> [virtual]</tt> </h3><p>Sets whether the list view show 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>QListView::setSelected ( <a href="qlistviewitem.html">QListViewItem</a> * item, bool 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 Single 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">QListViewItem::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> and <a href="#setCurrentItem">setCurrentItem</a>(). <p>Example: <a href="listviews-example.html#x1222">listviews/listviews.cpp</a>. <h3 class=fn>void <a name="setSelectionMode"></a>QListView::setSelectionMode ( <a href="qlistview.html#SelectionMode-enum">SelectionMode</a> mode ) </h3><p>Sets the list view's multi-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>QListView::setShowSortIndicator ( bool 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>QListView::setShowToolTips ( bool 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="setSorting"></a>QListView::setSorting ( int column, bool ascending = TRUE )<tt> [virtual]</tt> </h3> Sets the list view to be sorted by <em>column</em> and 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. <h3 class=fn>void <a name="setTreeStepSize"></a>QListView::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>QListView::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>QListView::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>QListView::sort ()<tt> [virtual]</tt> </h3> (Re)sorts the list view using the last sorting configuration (sort column and ascending/descending). <h3 class=fn>void <a name="spacePressed"></a>QListView::spacePressed ( <a href="qlistviewitem.html">QListViewItem</a> * )<tt> [signal]</tt> </h3> <p> This signal is emitted when Space is pressed. The argument is <a href="#currentItem">currentItem</a>(). <h3 class=fn>void <a name="startDrag"></a>QListView::startDrag ()<tt> [virtual protected]</tt> </h3> Starts a drag. <h3 class=fn>void <a name="takeItem"></a>QListView::takeItem ( <a href="qlistviewitem.html">QListViewItem</a> * 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">QListViewItem::takeItem</a>() apply to this function, too. <p> <p>See also <a href="#insertItem">insertItem</a>(). <h3 class=fn>int <a name="treeStepSize"></a>QListView::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>QListView::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>QListView::updateContents ()<tt> [protected slot]</tt> </h3> Updates the sizes of the viewport, header, scroll bars and so on. 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 keyboard focus 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">QListViewItem</a> objects in this QListView. <p>Represents the current number of parentless (top level) QListViewItem objects in this QListView, like <a href="qlistviewitem.html#childCount">QListViewItem::childCount</a>() returns the number of child items for a QListViewItem. <p> <p>See also <a href="qlistviewitem.html#childCount">QListViewItem::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 whether the list view accepts the rename operation by default. <p>If this property is Accept, and the user renames an item and the editor looses focus (without the user pressing Enter), the item will still be renamed. If the property's value is Reject, the item will not be renamed unless the user presses Enter. The default is Reject. <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">QListViewItem::paintFocus</a>() draws in the margin. <p> <p>See also <a href="qlistviewitem.html#paintCell">QListViewItem::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> <p>This property holds whether the list view is in multi-selection or single selection mode. <p>If you enable multi-selection mode, it is possible to specify whether or not this mode should be extended. Extended 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 last column should be resized. <p>Specifies whether all, none or the last column should be resized to fit the full width of the listview. The values for this property can be one of the following: <a href="#ResizeMode-enum">NoColumn</a> (the default), <a href="#ResizeMode-enum">AllColumns</a> or <a href="#ResizeMode-enum">LastColumn</a>. <p> <p>See also <a href="qheader.html">QHeader</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 show open/close signs on root items. <p>Open/close signs are small + or - symbols in windows style, or arrows in Motif 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 multi-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">QHeader::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">Qt toolkit</a>. Copyright © 1995-2001 <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 © 2001 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a> <td align=right><div align=right>Qt version 3.0.2</div> </table></div></address></body> </html>