📄 qlistview.3qt
字号:
Ensures that the header is correctly sized and positioned when the resize event \fIe\fR occurs..SH "ResizeMode QListView::resizeMode () const"Returns TRUE if all, none or the only the last column should be resized; otherwise returns FALSE. See the "resizeMode" property for details..SH "void QListView::returnPressed ( QListViewItem * )\fC [signal]\fR"This signal is emitted when Enter or Return is pressed. The argument is the currentItem()..SH "void QListView::rightButtonClicked ( QListViewItem *, const QPoint &, int )\fC [signal]\fR"This signal is emitted when the right button is clicked (i.e. when it's released). The arguments are the relevant QListViewItem (may be 0), the point in global coordinates and the relevant column (or -1 if the click was outside the list)..SH "void QListView::rightButtonPressed ( QListViewItem *, const QPoint &, int )\fC [signal]\fR"This signal is emitted when the right button is pressed. The arguments are the relevant QListViewItem (may be 0), the point in global coordinates and the relevant column (or -1 if the click was outside the list)..SH "bool QListView::rootIsDecorated () const"Returns TRUE if the list view shows open/close signs on root items; otherwise returns FALSE. See the "rootIsDecorated" property for details..SH "void QListView::selectAll ( bool select )\fC [virtual slot]\fR"If \fIselect\fR is TRUE, all the items get selected; otherwise all the items get unselected. This only works in the selection modes Multi and Extended. In Single and NoSelection mode the selection of the current item is just set to \fIselect\fR..SH "QListViewItem * QListView::selectedItem () const"Returns the selected item if the list view is in Single selection mode and an item is selected..PPIf no items are selected or the list view is not in Single selection mode this function returns 0..PPSee also setSelected() and multiSelection..SH "void QListView::selectionChanged ()\fC [signal]\fR"This signal is emitted whenever the set of selected items has changed (normally before the screen update). It is available in Single, Multi, and Extended selection modes, but is most useful in Multi selection mode..PP\fBWarning:\fR Do not delete any QListViewItem objects in slots connected to this signal..PPSee also setSelected() and QListViewItem::setSelected()..PPExample: listviews/listviews.cpp..SH "void QListView::selectionChanged ( QListViewItem * )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThis 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. 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..PPIn Multi selection mode, use the no argument overload of this signal..PP\fBWarning:\fR Do not delete any QListViewItem objects in slots connected to this signal..PPSee also setSelected(), QListViewItem::setSelected(), and currentChanged()..SH "SelectionMode QListView::selectionMode () const"Returns the list view's selection mode. See the "selectionMode" property for details..SH "void QListView::setAllColumnsShowFocus ( bool )\fC [virtual]\fR"Sets whether items should show keyboard focus using all columns. See the "allColumnsShowFocus" property for details..SH "void QListView::setColumnAlignment ( int column, int align )\fC [virtual]\fR"Sets column \fIcolumn\fR's alignment to \fIalign\fR. The alignment is ultimately passed to QListViewItem::paintCell() for each item in the list view. For horizontally aligned text with Qt::AlignLeft or Qt::AlignHCenter the ellipsis (...) will be to the right, for Qt::AlignRight the ellipsis will be to the left..PPSee also Qt::AlignmentFlags..PPExample: listviews/listviews.cpp..SH "void QListView::setColumnText ( int column, const QString & label )\fC [virtual]\fR"Sets the heading of column \fIcolumn\fR to \fIlabel\fR..PPSee also columnText()..SH "void QListView::setColumnText ( int column, const QIconSet & iconset, const QString & label )\fC [virtual]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the heading of column \fIcolumn\fR to \fIiconset\fR and \fIlabel\fR..PPSee also columnText()..SH "void QListView::setColumnWidth ( int column, int w )\fC [virtual]\fR"Sets the width of column \fIcolumn\fR to \fIw\fR pixels. Note that if the column has a WidthMode other than Manual, this width setting may be subsequently overridden..PPSee also columnWidth()..SH "void QListView::setColumnWidthMode ( int c, WidthMode mode )\fC [virtual]\fR"Sets column \fIc\fR's width mode to \fImode\fR. The default depends on the original width argument to addColumn()..PPSee also QListViewItem::width()..SH "void QListView::setCurrentItem ( QListViewItem * i )\fC [virtual]\fR"Sets item \fIi\fR 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..PPThis function does not set the selection anchor. Use setSelectionAnchor() instead..PPSee also currentItem() and setSelected()..PPExample: listviews/listviews.cpp..SH "void QListView::setDefaultRenameAction ( RenameAction a )\fC [virtual]\fR"Sets what action to perform when the editor loses focus during renaming to \fIa\fR. See the "defaultRenameAction" property for details..SH "void QListView::setItemMargin ( int )\fC [virtual]\fR"Sets the advisory item margin that list items may use. See the "itemMargin" property for details..SH "void QListView::setMultiSelection ( bool enable )\fC [virtual]\fR"Sets whether the list view is in multi-selection or extended-selection mode to \fIenable\fR. See the "multiSelection" property for details..SH "void QListView::setOpen ( QListViewItem * item, bool open )\fC [virtual]\fR"Sets \fIitem\fR to be open if \fIopen\fR is TRUE and \fIitem\fR is expandable, and to be closed if \fIopen\fR is FALSE. Repaints accordingly..PPSee also QListViewItem::setOpen() and QListViewItem::setExpandable()..SH "void QListView::setResizeMode ( ResizeMode m )\fC [virtual]\fR"Sets whether all, none or the only the last column should be resized to \fIm\fR. See the "resizeMode" property for details..SH "void QListView::setRootIsDecorated ( bool )\fC [virtual]\fR"Sets whether the list view shows open/close signs on root items. See the "rootIsDecorated" property for details..SH "void QListView::setSelected ( QListViewItem * item, bool selected )\fC [virtual]\fR"If \fIselected\fR is TRUE the \fIitem\fR is selected; otherwise it is unselected..PPIf the list view is in Single selection mode and \fIselected\fR is TRUE, the currently selected item is unselected and \fIitem\fR is made current. Unlike QListViewItem::setSelected(), this function updates the list view as necessary and emits the selectionChanged() signals..PPSee also isSelected(), multiSelection, multiSelection, setCurrentItem(), and setSelectionAnchor()..PPExample: listviews/listviews.cpp..SH "void QListView::setSelectionAnchor ( QListViewItem * item )"Sets the selection anchor to \fIitem\fR, if \fIitem\fR is selectable..PPThe selection anchor is the item that remains selected when Shift-selecting with either mouse or keyboard in Extended selection mode..PPSee also setSelected()..SH "void QListView::setSelectionMode ( SelectionMode mode )"Sets the list view's selection mode to \fImode\fR. See the "selectionMode" property for details..SH "void QListView::setShowSortIndicator ( bool show )\fC [virtual]\fR"Sets whether the list view header should display a sort indicator to \fIshow\fR. See the "showSortIndicator" property for details..SH "void QListView::setShowToolTips ( bool b )\fC [virtual]\fR"Sets whether this list view should show tooltips for truncated column texts to \fIb\fR. See the "showToolTips" property for details..SH "void QListView::setSortColumn ( int column )"Sets the sorting column for the list view..PPIf \fIcolumn\fR is -1, sorting is disabled and the user cannot sort columns by clicking on the column headers. If \fIcolumn\fR is larger than the number of columns the user must click on a column header to sort the list view..PPSee also setSorting()..SH "void QListView::setSortOrder ( SortOrder order )"Sets the sort order for the items in the list view to \fIorder\fR..PPSee also setSorting()..SH "void QListView::setSorting ( int column, bool ascending = TRUE )\fC [virtual]\fR"Sets the list view to be sorted by column \fIcolumn\fR in ascending order if \fIascending\fR is TRUE or descending order if it is FALSE..PPIf \fIcolumn\fR is -1, sorting is disabled and the user cannot sort columns by clicking on the column headers. If \fIcolumn\fR is larger than the number of columns the user must click on a column header to sort the list view..SH "void QListView::setTreeStepSize ( int )\fC [virtual]\fR"Sets the number of pixels a child is offset from its parent. See the "treeStepSize" property for details..SH "bool QListView::showSortIndicator () const"Returns TRUE if the list view header should display a sort indicator; otherwise returns FALSE. See the "showSortIndicator" property for details..SH "bool QListView::showToolTips () const"Returns TRUE if this list view should show tooltips for truncated column texts; otherwise returns FALSE. See the "showToolTips" property for details..SH "void QListView::sort ()\fC [virtual]\fR"Sorts the list view using the last sorting configuration (sort column and ascending/descending)..SH "int QListView::sortColumn () const"Returns the column by which the list view is sorted, or -1 if sorting is disabled..PPSee also sortOrder()..SH "SortOrder QListView::sortOrder () const"Returns the sorting order of the list view items..PPSee also sortColumn()..SH "void QListView::spacePressed ( QListViewItem * )\fC [signal]\fR"This signal is emitted when Space is pressed. The argument is the currentItem()..SH "void QListView::startDrag ()\fC [virtual protected]\fR"Starts a drag..SH "void QListView::takeItem ( QListViewItem * i )\fC [virtual]\fR"Removes item \fIi\fR from the list view; \fIi\fR must be a top-level item. The warnings regarding QListViewItem::takeItem() apply to this function, too..PPSee also insertItem()..SH "int QListView::treeStepSize () const"Returns the number of pixels a child is offset from its parent. See the "treeStepSize" property for details..SH "void QListView::triggerUpdate ()\fC [slot]\fR"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..SH "void QListView::updateContents ()\fC [protected slot]\fR"Updates the sizes of the viewport, header, scroll bars and so on..PP\fBWarning:\fR Don't call this directly; call triggerUpdate() instead..SS "Property Documentation".SH "bool allColumnsShowFocus"This property holds whether items should show keyboard focus using all columns..PPIf this property is TRUE all columns will show focus and selection states, otherwise only column 0 will show focus..PPThe default is FALSE..PPSetting this to TRUE if it's not necessary may cause noticeable flicker..PPSet this property's value with setAllColumnsShowFocus() and get this property's value with allColumnsShowFocus()..SH "int childCount"This property holds the number of parentless (top-level) QListViewItem objects in this QListView..PPHolds the current number of parentless (top-level) QListViewItem objects in this QListView..PPSee also QListViewItem::childCount()..PPGet this property's value with childCount()..SH "int columns"This property holds the number of columns in this list view..PPGet this property's value with columns()..PPSee also addColumn() and removeColumn()..SH "RenameAction defaultRenameAction"This property holds what action to perform when the editor loses focus during renaming..PPIf this property is Accept, 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 Reject, the item will not be renamed unless the user presses Enter. The default is Reject..PPSet this property's value with setDefaultRenameAction() and get this property's value with defaultRenameAction()..SH "int itemMargin"This property holds the advisory item margin that list items may use..PPThe item margin defaults to one pixel and is the margin between the item's edges and the area where it draws its contents. QListViewItem::paintFocus() draws in the margin..PPSee also QListViewItem::paintCell()..PPSet this property's value with setItemMargin() and get this property's value with itemMargin()..SH "bool multiSelection"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPThis property holds whether the list view is in multi-selection or extended-selection mode..PPIf you enable multi-selection, Multi, 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..PPThe default selection mode is Single..PPSee also selectionMode..PPSet this property's value with setMultiSelection() and get this property's value with isMultiSelection()..SH "ResizeMode resizeMode"This property holds whether all, none or the only the last column should be resized..PPSpecifies 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: NoColumn (the default), AllColumns or LastColumn..PP\fBWarning:\fR Setting the resize mode should be done after all necessary columns have been added to the list view, otherwise the behavior is undefined..PPSee also QHeader and header()..PPSet this property's value with setResizeMode() and get this property's value with resizeMode()..SH "bool rootIsDecorated"This property holds whether the list view shows open/close signs on root items..PPOpen/close signs are small \fB+\fR or \fB-\fR symbols in windows style, or arrows in Motif style. The default is FALSE..PPSet this property's value with setRootIsDecorated() and get this property's value with rootIsDecorated()..SH "SelectionMode selectionMode"This property holds the list view's selection mode..PPThe mode can be Single (the default), Extended, Multi or NoSelection..PPSee also multiSelection..PPSet this property's value with setSelectionMode() and get this property's value with selectionMode()..SH "bool showSortIndicator"This property holds whether the list view header should display a sort indicator..PPIf 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)..PPSee also QHeader::setSortIndicator()..PPSet this property's value with setShowSortIndicator() and get this property's value with showSortIndicator()..SH "bool showToolTips"This property holds whether this list view should show tooltips for truncated column texts..PPThe default is TRUE..PPSet this property's value with setShowToolTips() and get this property's value with showToolTips()..SH "int treeStepSize"This property holds the number of pixels a child is offset from its parent..PPThe default is 20 pixels..PPOf course, this property is only meaningful for hierarchical list views..PPSet this property's value with setTreeStepSize() and get this property's value with treeStepSize()..SH "SEE ALSO".BR http://doc.trolltech.com/qlistview.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qlistview.3qt) and the Qtversion (3.3.5).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -