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

📄 qlistview.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 4 页
字号:
Returns TRUE if items should show keyboard focus using all columns; otherwise returns FALSE. See the "allColumnsShowFocus" property for details..SH "int QListView::childCount () const"Returns the number of parentless (top level) QListViewItem objects in this QListView. See the "childCount" property for details..SH "void QListView::clear ()\fC [virtual slot]\fR"Removes and deletes all the items in this list view and triggers an update..PPSee also triggerUpdate()..PPExamples:.)l addressbook/centralwidget.cpp, checklists/checklists.cpp, and listviews/listviews.cpp..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 multiSelection..PPExample: addressbook/centralwidget.cpp..SH "void QListView::clicked ( QListViewItem * item )\fC [signal]\fR"This signal is emitted whenever the user clicks (mouse pressed \fIand\fR mouse released) in the list view. \fIitem\fR is the pointer to the clicked list view item, or 0 if the user didn't click on an item..PP\fBWarning:\fR Do not delete any QListViewItem objects in slots connected to this signal..PPExample: addressbook/centralwidget.cpp..SH "void QListView::clicked ( QListViewItem * item, const QPoint & pnt, int c )\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 user clicks (mouse pressed \fIand\fR mouse released) in the list view. \fIitem\fR is the pointer to the clicked list view item, or 0 if the user didn't click on an item. \fIpnt\fR is the position where the user has clicked. If \fIitem\fR is not 0, \fIc\fR is the list view column into which the user pressed; if \fIitem\fR is 0 \fIc\fR's value is undefined..PP\fBWarning:\fR Do not delete any QListViewItem objects in slots connected to this signal..SH "void QListView::collapsed ( QListViewItem * item )\fC [signal]\fR"This signal is emitted when the \fIitem\fR has been collapsed, i.e. when the children of \fIitem\fR are hidden..PPSee also setOpen() and expanded()..SH "int QListView::columnAlignment ( int column ) const"Returns the alignment of column \fIcolumn\fR. The default is AlignAuto..PPSee also Qt::AlignmentFlags..SH "QString QListView::columnText ( int c ) const"Returns the text of column \fIc\fR..PPSee also setColumnText()..SH "int QListView::columnWidth ( int c ) const"Returns the width of column \fIc\fR..PPSee also setColumnWidth()..SH "WidthMode QListView::columnWidthMode ( int c ) const"Returns the WidthMode for column \fIc\fR..PPSee also setColumnWidthMode()..SH "int QListView::columns () const"Returns the number of columns in this list view. See the "columns" property for details..SH "void QListView::contentsMouseDoubleClickEvent ( QMouseEvent * e )\fC [virtual protected]\fR"Processes the mouse double-click event \fIe\fR on behalf of the viewed widget..PPReimplemented from QScrollView..SH "void QListView::contentsMouseMoveEvent ( QMouseEvent * e )\fC [virtual protected]\fR"Processes the mouse move event \fIe\fR on behalf of the viewed widget..PPExample: dirview/dirview.cpp..PPReimplemented from QScrollView..SH "void QListView::contentsMousePressEvent ( QMouseEvent * e )\fC [virtual protected]\fR"Processes the mouse move event \fIe\fR on behalf of the viewed widget..PPExample: dirview/dirview.cpp..PPReimplemented from QScrollView..SH "void QListView::contentsMouseReleaseEvent ( QMouseEvent * e )\fC [virtual protected]\fR"Processes the mouse move event \fIe\fR on behalf of the viewed widget..PPExample: dirview/dirview.cpp..PPReimplemented from QScrollView..SH "void QListView::contextMenuRequested ( QListViewItem * item, const QPoint & pos, int col )\fC [signal]\fR"This signal is emitted when the user invokes a context menu with the right mouse button or with special system keys, with \fIitem\fR being the item under the mouse cursor or the current item if no item is under the mouse cursor..PP\fIpos\fR is the position for the context menu in the global coordinate system..PP\fIcol\fR is the column on which the user pressed, or -1 if the signal was triggered by a key event..PPExample: listviews/listviews.cpp..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, for example, if all items in the list view are deleted..PP\fBWarning:\fR Do not delete any QListViewItem objects in slots connected to this signal..PPSee also setCurrentItem() and currentItem()..PPExample: listviews/listviews.cpp..SH "QListViewItem * QListView::currentItem () const"Returns a pointer to the currently highlighted item, or 0 if there isn't one..PPSee also setCurrentItem()..PPExamples:.)l addressbook/centralwidget.cpp and listviews/listviews.cpp..SH "RenameAction QListView::defaultRenameAction () const"Returns TRUE if the list view accepts the rename operation by default; otherwise returns FALSE. See the "defaultRenameAction" property for details..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 * item )\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. \fIitem\fR is the list view item on which the user did the double-click..SH "QDragObject * QListView::dragObject ()\fC [virtual protected]\fR"If the user presses the mouse on an item and starts moving the mouse, and the item allow dragging (see QListViewItem::setDragEnabled()), this function is called to get a drag object and a drag is started unless dragObject() returns 0..PPBy default this function returns 0. You should reimplement it and create a QDragObject depending on the selected items..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 QListViewItem::paintBranches() as necessary for all list view items that require repainting in the \fIcw\fR pixels wide and \fIch\fR pixels high bounding rectangle starting at position \fIcx\fR, \fIcy\fR with offset \fIox\fR, \fIoy\fR. Uses the painter \fIp\fR..PPReimplemented from QScrollView..SH "void QListView::dropped ( QDropEvent * e )\fC [signal]\fR"This signal is emitted, when a drop event occurred onto the viewport (not onto an item)..PP\fIe\fR provides all information about the drop..SH "void QListView::ensureItemVisible ( const QListViewItem * i )"Ensures that item \fIi\fR 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..PPSee also itemRect() and QScrollView::ensureVisible()..SH "bool QListView::eventFilter ( QObject * o, QEvent * e )\fC [virtual]\fR"Redirects the event \fIe\fR relating to object \fIo\fR, for the viewport to mousePressEvent(), keyPressEvent() and friends..PPReimplemented from QScrollView..SH "void QListView::expanded ( QListViewItem * item )\fC [signal]\fR"This signal is emitted when \fIitem\fR has been expanded, i.e. when the children of \fIitem\fR are shown..PPSee also setOpen() and collapsed()..SH "QListViewItem * QListView::findItem ( const QString & text, int column, ComparisonFlags compare = ExactMatch | CaseSensitive ) const"Finds the first list view item in column \fIcolumn\fR, that matches \fItext\fR and returns the item, or returns 0 of no such item could be found. Pass OR-ed together Qt::StringComparisonMode values in the \fIcompare\fR flag, to control how the matching is performed. The default comparison mode is case-sensitive, exact match..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(), QListViewItem::itemBelow(), and QListViewItem::itemAbove()..PPExamples:.)l addressbook/centralwidget.cpp and listviews/listviews.cpp..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..PPYou may safely call QHeader::setClickEnabled(), QHeader::setResizeEnabled(), QHeader::setMovingEnabled() and all the const QHeader functions..PPExamples:.)l listviews/listviews.cpp and qdir/qdir.cpp..SH "void QListView::insertItem ( QListViewItem * i )\fC [virtual]\fR"Inserts item \fIi\fR into the list view as a top-level item. You do not need to call this unless you've called takeItem(\fIi\fR) or QListViewItem::takeItem(\fIi\fR) and need to reinsert \fIi\fR elsewhere..PPSee also QListViewItem::takeItem() and takeItem()..SH "void QListView::invertSelection ()\fC [virtual slot]\fR"Inverts the selection. Only works in Multi and Extended selection modes..SH "bool QListView::isMultiSelection () const"Returns TRUE if the list view is in multi-selection or extended-selection mode; otherwise returns FALSE. See the "multiSelection" property for details..SH "bool QListView::isOpen ( const QListViewItem * item ) const"Identical to \fIitem\fR->isOpen(). Provided for completeness..PPSee also setOpen()..SH "bool QListView::isRenaming () const"Returns TRUE if an item is being renamed; otherwise returns FALSE..SH "bool QListView::isSelected ( const QListViewItem * i ) const"Returns TRUE if the list view item \fIi\fR is selected; otherwise returns FALSE..PPSee also QListViewItem::isSelected()..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 list view's own, much larger, coordinate system..PPitemAt() returns 0 if there is no such item..PPNote that you also get the pointer to the item if \fIviewPos\fR points to the root decoration (see setRootIsDecorated()) of the item. To check whether or not \fIviewPos\fR is on the root decoration of the item, you can do something like this:.PP.nf.br    QListViewItem *i = itemAt( p );.br    if ( i ) {.br        if ( p.x() > header()->cellPos( header()->mapToActual( 0 ) ) +.br                treeStepSize() * ( i->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() ||.br                p.x() < header()->cellPos( header()->mapToActual( 0 ) ) ) {.br            ; // p is not on root decoration.br        else.br            ; // p is on the root decoration.br    }.br.fi.PPThis 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)..PPSee also itemPos() and itemRect()..SH "int QListView::itemMargin () const"Returns the advisory item margin that list items may use. See the "itemMargin" property for details..SH "int QListView::itemPos ( const QListViewItem * item )"Returns the y-coordinate of \fIitem\fR in the list view's coordinate system. This function is normally much slower than itemAt() but it works for all items, whereas 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 that item \fIi\fR occupies in viewport()'s coordinates, or an invalid rectangle if \fIi\fR is 0 or is not currently visible..PPThe rectangle returned does not include any children of the rectangle (i.e. it uses QListViewItem::height(), rather than QListViewItem::totalHeight()). If you want the rectangle to include children you can use something like this:.PP.nf.br    QRect r( listView->itemRect( item ) );.br    r.setHeight( (QCOORD)(QMIN( item->totalHeight(),.br                                listView->viewport->height() - r.y() ) ) ).br.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::itemRenamed ( QListViewItem * item, int col, const QString & text )\fC [signal]\fR"This signal is emitted when \fIitem\fR has been renamed to \fItext\fR, e.g. by in in-place renaming, in column \fIcol\fR..SH "void QListView::itemRenamed ( QListViewItem * item, int col )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThis signal is emitted when \fIitem\fR has been renamed, e.g. by in-place renaming, in column \fIcol\fR..SH "QListViewItem * QListView::lastItem () const"Returns the last item in the list view tree..PPReturns 0 if there are no items in the QListView..PPThis function is slow because it traverses the entire tree to find the last item..SH "void QListView::mouseButtonClicked ( int button, QListViewItem * item, const QPoint & pos, int c )\fC [signal]\fR"This signal is emitted whenever the user clicks (mouse pressed \fIand\fR mouse released) in the list view at position \fIpos\fR. \fIbutton\fR is the mouse button that the user pressed, \fIitem\fR is the pointer to the clicked list view item or 0 if the user didn't click on an item. If \fIitem\fR is not 0, \fIc\fR is the list view column into which the user pressed; if \fIitem\fR is 0 \fIc\fR's value is undefined..PP\fBWarning:\fR Do not delete any QListViewItem objects in slots connected to this signal..SH "void QListView::mouseButtonPressed ( int button, QListViewItem * item, const QPoint & pos, int c )\fC [signal]\fR"This signal is emitted whenever the user pressed the mouse button in the list view at position \fIpos\fR. \fIbutton\fR is the mouse button which the user pressed, \fIitem\fR is the pointer to the pressed list view item or 0 if the user didn't press on an item. If \fIitem\fR is not 0, \fIc\fR is the list view column into which the user pressed; if \fIitem\fR is 0 \fIc\fR's value is undefined..PP\fBWarning:\fR Do not delete any QListViewItem objects in slots connected to this signal..SH "void QListView::onItem ( QListViewItem * i )\fC [signal]\fR"This signal is emitted when the user moves the mouse cursor onto the item \fIi\fR, similar to the QWidget::enterEvent() function..SH "void QListView::onViewport ()\fC [signal]\fR"This signal is emitted when the user moves the mouse cursor from an item to an empty part of the list view..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 \fIp\fR. \fIrect\fR is in widget coordinates, ready to be fed to \fIp\fR..PPThe default function fills \fIrect\fR with the viewport()->backgroundBrush()..SH "void QListView::pressed ( QListViewItem * item )\fC [signal]\fR"This signal is emitted whenever the user presses the mouse button in a list view. \fIitem\fR 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..PP\fBWarning:\fR Do not delete any QListViewItem objects in slots connected to this signal..SH "void QListView::pressed ( QListViewItem * item, const QPoint & pnt, int c )\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 user presses the mouse button in a list view. \fIitem\fR 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. \fIpnt\fR is the position of the mouse cursor, and \fIc\fR is the column where the mouse cursor was when the user pressed the mouse button..PP\fBWarning:\fR Do not delete any QListViewItem objects in slots connected to this signal.

⌨️ 快捷键说明

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