⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qlistview.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
📖 第 1 页 / 共 2 页
字号:
Examples:.(ldirview/main.cpp.)l.SH "int QListView::addColumn ( const QString & label, int width = -1 ) \fC[virtual]\fR"Adds a new column at the right end of the widget, with the header \fIlabel,\fR and returns the index of the column..PPIf \fIwidth\fR is negative, the new column will have WidthMode Maximum, otherwise it will be Manual at \fIwidth\fR pixels wide..PPSee also: setColumnText(), setColumnWidth() and setColumnWidthMode()..SH "bool QListView::allColumnsShowFocus () const"Returns TRUE if the items in this list view indicate focus and selection state using all of their columns, else FALSE..PPSee also: setAllColumnsShowFocus()..SH "int QListView::childCount () const"Returns the current number of parentless QListViewItem objects in this QListView, like QListViewItem::childCount() returns the number of child items for a QListViewItem..PPSee also: QListViewItem::childCount()..SH "void QListView::clear () \fC[virtual]\fR"Remove and delete all the items in this list view, and trigger an update..PPSee also: triggerUpdate()..SH "void QListView::clearSelection () \fC[virtual]\fR"Sets all items to be not selected, updates the list view as necessary and emits the selectionChanged() signals. Note that for multi-selection list views, this function needs to iterate over \fIall\fR items..PPSee also: setSelected() and setMultiSelection()..SH "int QListView::columnAlignment ( int column ) const"Returns the alignment of logical column \fIcolumn.\fR The default is \fCAlignLeft.\fR.SH "QString QListView::columnText ( int c ) const"Returns the text for the heading of column \fIc.\fR.SH "int QListView::columnWidth ( int c ) const"Returns the width of the heading of column \fIc.\fR.SH "void QListView::contentsMouseDoubleClickEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Processes mouse double-click events on behalf of the viewed widget..PPReimplemented from QScrollView..SH "void QListView::contentsMouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Processes mouse move events on behalf of the viewed widget..PPReimplemented from QScrollView..SH "void QListView::contentsMousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Processes mouse move events on behalf of the viewed widget..PPReimplemented from QScrollView..SH "void QListView::contentsMouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Processes mouse move events on behalf of the viewed widget..PPReimplemented from QScrollView..SH "void QListView::currentChanged ( QListViewItem * ) \fC[signal]\fR"This signal is emitted whenever the current item has changed (normally after the screen update). The current item is the item responsible for indicating keyboard focus..PPThe argument is the newly current item, or 0 if the change was to make no item current. This can happen e.g. if all items in the list view are deleted..PPNote that you may not delete any QListViewItem objects in slots connected to this signal..PPSee also: setCurrentItem() and currentItem()..SH "QListViewItem * QListView::currentItem () const"Returns a pointer to the currently highlighted item, or 0 if there isn't any..PPSee also: setCurrentItem()..SH "void QListView::doAutoScroll () \fC[protected slot]\fR"This slot handles auto-scrolling when the mouse button is pressed and the mouse is outside the widget..SH "void QListView::doubleClicked ( QListViewItem * ) \fC[signal]\fR"This signal is emitted whenever an item is double-clicked. It's emitted on the second button press, not the second button release..SH "void QListView::drawContentsOffset ( QPainter * p, int ox, int oy, int cx, int cy, int cw, int ch ) \fC[virtual protected]\fR"Calls QListViewItem::paintCell() and/or QListViewItem::paintBranches() for all list view items that require repainting. See the documentation for those functions for details..PPReimplemented from QScrollView..SH "void QListView::enabledChange ( bool e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QListView::ensureItemVisible ( const QListViewItem * i )"Ensures that \fIi\fR is made visible, scrolling the list view vertically as required..PPSee also: itemRect() and QScrollView::ensureVisible()..SH "bool QListView::eventFilter ( QObject * o, QEvent * e ) \fC[virtual]\fR"Redirects events for the viewport to mousePressEvent(), keyPressEvent() and friends..PPReimplemented from QObject..SH "QListViewItem * QListView::firstChild () const"Returns the first item in this QListView. You can use its firstChild() and nextSibling() functions to traverse the entire tree of items..PPReturns 0 if there is no first item..PPSee also: itemAt(), itemBelow() and itemAbove()..SH "void QListView::focusInEvent ( QFocusEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QListView::focusOutEvent ( QFocusEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QHeader * QListView::header () const"Returns a pointer to the QHeader object that manages this list view's columns. Please don't modify the header behind the list view's back..SH "void QListView::insertItem ( QListViewItem * i ) \fC[virtual]\fR"Inserts \fIi\fR into the list view as a top-level item. You do not need to call this unless you've called removeItem( \fIi\fR ) or QListViewItem::removeItem( i ) and need to reinsert \fIi\fR elsewhere..PPSee also: QListViewItem::removeItem(), (important) and removeItem()..SH "bool QListView::isMultiSelection () const"Returns TRUE if this list view is in multi-selection mode and FALSE if it is in single-selection mode..PPSee also: setMultiSelection()..SH "bool QListView::isOpen ( const QListViewItem * item ) const"Identical to \fIitem->isOpen().\fR Provided for completeness..PPSee also: setOpen()..SH "bool QListView::isSelected ( const QListViewItem * i ) const"Returns i->isSelected()..PPProvided only because QListView provides setSelected() and trolls are neat creatures and like neat, orthogonal interfaces..SH "QListViewItem * QListView::itemAt ( const QPoint & viewPos ) const"Returns a pointer to the QListViewItem at \fIviewPos.\fR Note that \fIviewPos\fR is in the coordinate system of viewport(), not in the listview's own, much larger, coordinate system..PPitemAt() returns 0 if there is no such item..PPSee also: itemPos() and itemRect()..SH "int QListView::itemMargin () const"Returns the advisory item margin which list items may use..PPSee also: QListViewItem::paintCell() and setItemMargin()..SH "int QListView::itemPos ( const QListViewItem * item )"Returns the y coordinate of \fIitem\fR in the list view's coordinate system. This functions is normally much slower than itemAt(), but it works for all items, while itemAt() normally works only for items on the screen..PPThis is a thin wrapper around QListViewItem::itemPos()..PPSee also: itemAt() and itemRect()..SH "QRect QListView::itemRect ( const QListViewItem * i ) const"Returns the rectangle on the screen \fIi\fR occupies in viewport()'s coordinates, or an invalid rectangle if \fIi\fR is a null pointer or is not currently visible..PPThe rectangle returned does not include any children of the rectangle (ie. it uses QListViewItem::height() rather than QListViewItem::totalHeight()). If you want the rectangle including children, you can use something like this code:.PP.nf.br    QRect r( listView->itemRect( item ) );.br    r.setHeight( (QCOORD)(QMIN( item->totalHeight(),.br                                listView->viewport->height() - r.y() ) ) ).fi.PPNote the way it avoids too-high rectangles. totalHeight() can be much larger than the window system's coordinate system allows..PPitemRect() is comparatively slow. It's best to call it only for items that are probably on-screen..SH "void QListView::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QSize QListView::minimumSizeHint () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QListView::paintEmptyArea ( QPainter * p, const QRect & rect ) \fC[virtual protected]\fR"Paints \fIrect\fR so that it looks like empty background using painter p. \fIrect\fR is is widget coordinates, ready to be fed to \fIp.\fR.PPThe default function fills \fIrect\fR with colorGroup().base()..SH "void QListView::removeItem ( QListViewItem * i ) \fC[virtual]\fR"\fBThis function is obsolete.\fR It is provided to keep old programs working. We strongly advise against using it in new code..PPRemoves \fIi\fR from the list view; \fIi\fR must be a top-level item. The warnings regarding QListViewItem::removeItem( i ) apply to this function too..PPSee also: QListViewItem::removeItem(), (important) and insertItem()..SH "void QListView::repaintItem ( const QListViewItem * item ) const"Repaints \fIitem\fR on the screen, if \fIitem\fR is currently visible. Takes care to avoid multiple repaints..SH "void QListView::resizeEvent ( QResizeEvent * e ) \fC[virtual protected]\fR"Ensures that the header is correctly sized and positioned..PPReimplemented from QWidget..SH "void QListView::returnPressed ( QListViewItem * ) \fC[signal]\fR"This signal is emitted when enter or return is pressed. The argument is currentItem()..SH "void QListView::rightButtonClicked ( QListViewItem *, const QPoint &, int ) \fC[signal]\fR"This signal is emitted when the right button is clicked (ie. when it's released). The arguments are the relevant QListViewItem (may be 0), the point in global coordinates and the relevant column..SH "void QListView::rightButtonPressed ( QListViewItem *, const QPoint &, int ) \fC[signal]\fR"This signal is emitted when the right button is pressed. Then arguments are the relevant QListViewItem (may be 0), the point in global coordinates and the relevant column..SH "bool QListView::rootIsDecorated () const"Returns TRUE if root items can be opened and closed by the user, FALSE if not..SH "QListViewItem * QListView::selectedItem () const"Returns a pointer to 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 in multi-selection mode this function returns 0..PPSee also: setSelected() and setMultiSelection()..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 both in single-selection and multi-selection mode, but is most meaningful in multi-selection mode..PPNote that you may not delete any QListViewItem objects in slots connected to this signal..PPSee also: setSelected() and QListViewItem::setSelected()..SH "void QListView::selectionChanged ( QListViewItem * ) \fC[signal]\fR"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, or 0 if the change was to unselect the selected item..PPThere is another signal which is more useful in multi-selection mode..PPNote that you may not delete any QListViewItem objects in slots connected to this signal..PPSee also: setSelected(), QListViewItem::setSelected() and currentChanged()..SH "void QListView::setAllColumnsShowFocus ( bool enable ) \fC[virtual]\fR"Sets this list view to assume that the items show focus and selection state using all of their columns if \fIenable\fR is TRUE, or that they show it just using column 0 if \fIenable\fR is FALSE..PPThe default is FALSE..PPSetting this to TRUE if it isn't necessary can cause noticeable flicker..PPSee also: allColumnsShowFocus()..SH "void QListView::setColumnAlignment ( int column, int align ) \fC[virtual]\fR"Configures the logical column \fIcolumn\fR to have alignment \fIalign.\fR The alignment is ultimately passed to QListViewItem::paintCell() for each item in the view..PPThe display is automatically scheduled to be updated..SH "void QListView::setColumnText ( int column, const QIconSet & iconset, const QString & label ) \fC[virtual]\fR"Sets the heading text of column \fIcolumn\fR to \fIiconset\fR and \fIlabel.\fR The leftmost colum is number 0..SH "void QListView::setColumnText ( int column, const QString & label ) \fC[virtual]\fR"Sets the heading text of column \fIcolumn\fR to \fIlabel.\fR The leftmost colum is number 0..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. The leftmost colum is number 0..SH "void QListView::setColumnWidthMode ( int c, WidthMode mode ) \fC[virtual]\fR"Sets column \fCto\fR behave according to \fImode,\fR which is one of:.TP\fCManual\fR - the column width does not change automatically.TP\fCMaximum\fR - the column is automatically sized according to the widths of all items in the column..PPSee also: QListViewItem::width()..PPBugs and limitations:.TPdoesn't shrink back yet when items shrink or close.SH "void QListView::setCurrentItem ( QListViewItem * i ) \fC[virtual]\fR"Sets \fIi\fR 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..PPSee also: currentItem()..SH "void QListView::setFont ( const QFont & f ) \fC[virtual]\fR"Reimplemented to let the list view items update themselves. \fIf\fR is the new font..SH "void QListView::setItemMargin ( int m ) \fC[virtual]\fR"Sets the advisory item margin which list items may use to \fIm.\fR.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()..SH "void QListView::setMultiSelection ( bool enable ) \fC[virtual]\fR"Sets the list view to multi-selection mode if \fIenable\fR is TRUE, and to single-selection mode if \fIenable\fR is FALSE..PPSee also: isMultiSelection()..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..PPDoes nothing if \fIitem\fR is not expandable..PPSee also: QListViewItem::setOpen() and QListViewItem::setExpandable()..SH "void QListView::setPalette ( const QPalette & p ) \fC[virtual]\fR"Reimplemented to let the list view items update themselves. \fIp\fR is the new palette..SH "void QListView::setRootIsDecorated ( bool enable ) \fC[virtual]\fR"Sets this list view to show open/close signs on root items if \fIenable\fR is TRUE, and to not show such signs if \fIenable\fR is FALSE..PPOpen/close signs is a little + or - in windows style, an arrow in Motif style..SH "void QListView::setSelected ( QListViewItem * item, bool selected ) \fC[virtual]\fR"Sets \fIitem\fR to be selected if \fIselected\fR is TRUE, and to be not selected if \fIselected\fR is FALSE..PPIf the list view is in single-selection mode and \fIselected\fR is TRUE, the currently selected item is unselected and \fIitem\fR made current. Unlike QListViewItem::setSelected(), this function updates the list view as necessary and emits the selectionChanged() signals..PPSee also: isSelected(), setMultiSelection(), isMultiSelection() and setCurrentItem()..SH "void QListView::setSorting ( int column, bool ascending = TRUE ) \fC[virtual]\fR"Set the list view to be sorted by \fIcolumn\fR and to be sorted in ascending order if \fIascending\fR is TRUE or descending order if it is FALSE..PPIf \fIcolumn\fR is -1, sorting is disabled..SH "void QListView::setTreeStepSize ( int l ) \fC[virtual]\fR"Sets the the number of pixels a child is offset from its parent, in a tree view to \fIl.\fR The default is 20..PPSee also: treeStepSize()..PPExamples:.(ldirview/main.cpp.)l.SH "void QListView::show () \fC[virtual]\fR"Reimplemented to setx the correct background mode and viewed area size..PPExamples:.(ldirview/main.cpp.)l.PPReimplemented from QWidget..SH "void QListView::showEvent ( QShowEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QSize QListView::sizeHint () const \fC[virtual]\fR"Returns a size suitable for this scroll view. This is as wide as QHeader's sizeHint() recommends and tall enough for perhaps 10 items..PPReimplemented from QWidget..SH "void QListView::styleChange ( QStyle & old ) \fC[virtual protected]\fR"Reimplemented to let the list view items update themselves. \fIs\fR is the new GUI style..PPReimplemented from QWidget..SH "void QListView::takeItem ( QListViewItem * i ) \fC[virtual]\fR"Removes \fIi\fR from the list view; \fIi\fR must be a top-level item. The warnings regarding QListViewItem::takeItem( i ) apply to this function too..PPSee also: QListViewItem::takeItem(), (important) and insertItem()..SH "int QListView::treeStepSize () const"Returns the number of pixels a child is offset from its parent. This number has meaning only for tree views. The default is 20..PPSee also: setTreeStepSize()..SH "void QListView::triggerUpdate () \fC[slot]\fR"Triggers a size, geometry and content update during the next iteration of the event loop. Cleverly makes sure 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, scrollbars and so on.Don't call this directly; call triggerUpdates() instead..SH "SEE ALSO".BR http://www.troll.no/qt/qlistview.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS.  See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -