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

📄 qlistbox.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 4 页
字号:
See also mouseButtonPressed(), rightButtonPressed(), and clicked()..SH "void QListBox::removeItem ( int index )"Removes and deletes the item at position \fIindex\fR. If \fIindex\fR is equal to currentItem(), a new item gets highlighted and the highlighted() signal is emitted..PPSee also insertItem() and clear()..SH "void QListBox::returnPressed ( QListBoxItem * )\fC [signal]\fR"This signal is emitted when Enter or Return is pressed. The argument is currentItem()..SH "void QListBox::rightButtonClicked ( QListBoxItem *, const QPoint & )\fC [signal]\fR"This signal is emitted when the right button is clicked (i.e. when it's released at the same point where it was pressed). The arguments are the relevant QListBoxItem (may be 0) and the point in global coordinates..SH "void QListBox::rightButtonPressed ( QListBoxItem *, const QPoint & )\fC [signal]\fR"This signal is emitted when the right button is pressed. The arguments are the relevant QListBoxItem (may be 0) and the point in global coordinates..SH "LayoutMode QListBox::rowMode () const"Returns the row layout mode for this list box. See the "rowMode" property for details..SH "bool QListBox::scrollBar () const"Returns FALSE if vScrollBarMode() is AlwaysOff; otherwise returns TRUE..SH "void QListBox::selectAll ( bool select )\fC [virtual slot]\fR"In Multi and Extended modes, this function sets all items to be selected if \fIselect\fR is TRUE, and to be unselected if \fIselect\fR is FALSE..PPIn Single and NoSelection modes, this function only changes the selection status of currentItem()..SH "void QListBox::selected ( int index )\fC [signal]\fR"This signal is emitted when the user double-clicks on an item or presses Enter when an item is highlighted. \fIindex\fR is the index of the selected item..PPSee also highlighted() and selectionChanged()..SH "void QListBox::selected ( const QString & )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThis signal is emitted when the user double-clicks on an item or presses Enter while an item is highlighted, and the selected item is (or has) a string. The argument is the text of the selected item..PPSee also highlighted() and selectionChanged()..SH "void QListBox::selected ( QListBoxItem * )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThis signal is emitted when the user double-clicks on an item or presses Enter when an item is highlighted. The argument is a pointer to the new selected item..PPSee also highlighted() and selectionChanged()..SH "QListBoxItem * QListBox::selectedItem () const"Returns the selected item if the list box is in single-selection mode and an item is selected..PPIf no items are selected or the list box is in another selection mode this function returns 0..PPSee also setSelected() and multiSelection..SH "void QListBox::selectionChanged ()\fC [signal]\fR"This signal is emitted when the selection set of a list box changes. This signal is emitted in each selection mode. If the user selects five items by drag-selecting, QListBox tries to emit just one selectionChanged() signal so the signal can be connected to computationally expensive slots..PPSee also selected() and currentItem..SH "void QListBox::selectionChanged ( QListBoxItem * item )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThis signal is emitted when the selection in a Single selection list box changes. \fIitem\fR is the newly selected list box item..PPSee also selected() and currentItem..SH "SelectionMode QListBox::selectionMode () const"Returns the selection mode of the list box. See the "selectionMode" property for details..SH "void QListBox::setAutoBottomScrollBar ( bool enable )"If \fIenable\fR is TRUE sets setHScrollBarMode() to AlwaysOn; otherwise sets setHScrollBarMode() to AlwaysOff..SH "void QListBox::setAutoScrollBar ( bool enable )"If \fIenable\fR is TRUE sets setVScrollBarMode() to AlwaysOn; otherwise sets setVScrollBarMode() to AlwaysOff..SH "void QListBox::setBottomItem ( int index )\fC [virtual]\fR"Scrolls the list box so the item at position \fIindex\fR in the list is displayed in the bottom row of the list box..PPSee also topItem..SH "void QListBox::setBottomScrollBar ( bool enable )"If \fIenable\fR is TRUE sets setHScrollBarMode() to AlwaysOn; otherwise sets setHScrollBarMode() to AlwaysOff..SH "void QListBox::setColumnMode ( LayoutMode )\fC [virtual]\fR"Sets the column layout mode for this list box. See the "columnMode" property for details..SH "void QListBox::setColumnMode ( int columns )\fC [virtual]\fR"Sets the column layout mode for this list box to \fIcolumns\fR. See the "columnMode" property for details..SH "void QListBox::setCurrentItem ( int index )\fC [virtual]\fR"Sets the current highlighted item to \fIindex\fR. See the "currentItem" property for details..SH "void QListBox::setCurrentItem ( QListBoxItem * i )\fC [virtual]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPSets the current item to the QListBoxItem \fIi\fR..SH "void QListBox::setMultiSelection ( bool multi )"Sets whether or not the list box is in Multi selection mode to \fImulti\fR. See the "multiSelection" property for details..SH "void QListBox::setRowMode ( LayoutMode )\fC [virtual]\fR"Sets the row layout mode for this list box. See the "rowMode" property for details..SH "void QListBox::setRowMode ( int rows )\fC [virtual]\fR"Sets the row layout mode for this list box to \fIrows\fR. See the "rowMode" property for details..SH "void QListBox::setScrollBar ( bool enable )"If \fIenable\fR is TRUE sets setVScrollBarMode() to AlwaysOn; otherwise sets setVScrollBarMode() to AlwaysOff..SH "void QListBox::setSelected ( QListBoxItem * item, bool select )\fC [virtual]\fR"Selects \fIitem\fR if \fIselect\fR is TRUE or unselects it if \fIselect\fR is FALSE, and repaints the item appropriately..PPIf the list box is a Single selection list box and \fIselect\fR is TRUE, setSelected() calls setCurrentItem()..PPIf the list box is a Single selection list box, \fIselect\fR is FALSE, setSelected() calls clearSelection()..PPSee also multiSelection, currentItem, clearSelection(), and currentItem..SH "void QListBox::setSelected ( int index, bool select )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPIf \fIselect\fR is TRUE the item at position \fIindex\fR is selected; otherwise the item is deselected..SH "void QListBox::setSelectionMode ( SelectionMode )\fC [virtual]\fR"Sets the selection mode of the list box. See the "selectionMode" property for details..SH "void QListBox::setTopItem ( int index )\fC [virtual]\fR"Sets the index of an item at the top of the screen to \fIindex\fR. See the "topItem" property for details..SH "void QListBox::setVariableHeight ( bool )\fC [virtual]\fR"Sets whether this list box has variable-height rows. See the "variableHeight" property for details..SH "void QListBox::setVariableWidth ( bool )\fC [virtual]\fR"Sets whether this list box has variable-width columns. See the "variableWidth" property for details..SH "void QListBox::sort ( bool ascending = TRUE )"If \fIascending\fR is TRUE sorts the items in ascending order; otherwise sorts in descending order..PPTo compare the items, the text (QListBoxItem::text()) of the items is used..PPExample: listbox/listbox.cpp..SH "void QListBox::takeItem ( const QListBoxItem * item )"Removes \fIitem\fR from the list box and causes an update of the screen display. The item is not deleted. You should normally not need to call this function because QListBoxItem::~QListBoxItem() calls it. The normal way to delete an item is with \fCdelete\fR..PPSee also QListBox::insertItem()..SH "QString QListBox::text ( int index ) const"Returns the text at position \fIindex\fR, or QString::null if there is no text at that position..PPSee also pixmap()..SH "void QListBox::toggleCurrentItem ()\fC [protected]\fR"Toggles the selection status of currentItem() and repaints if the list box is a Multi selection list box..PPSee also multiSelection..SH "int QListBox::topItem () const"Returns the index of an item at the top of the screen. See the "topItem" property for details..SH "int QListBox::totalHeight () const\fC [protected]\fR"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPReturns contentsHeight()..SH "int QListBox::totalWidth () const\fC [protected]\fR"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPReturns contentsWidth()..SH "void QListBox::triggerUpdate ( bool doLayout )"Ensures that a single paint event will occur at the end of the current event loop iteration. If \fIdoLayout\fR is TRUE, the layout is also redone..SH "void QListBox::updateItem ( int index )\fC [protected]\fR"Repaints the item at position \fIindex\fR in the list..SH "void QListBox::updateItem ( QListBoxItem * i )\fC [protected]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPRepaints the QListBoxItem \fIi\fR..SH "bool QListBox::variableHeight () const"Returns TRUE if this list box has variable-height rows; otherwise returns FALSE. See the "variableHeight" property for details..SH "bool QListBox::variableWidth () const"Returns TRUE if this list box has variable-width columns; otherwise returns FALSE. See the "variableWidth" property for details..SS "Property Documentation".SH "LayoutMode columnMode"This property holds the column layout mode for this list box..PPsetColumnMode() sets the layout mode and adjusts the number of displayed columns. The row layout mode automatically becomes Variable, unless the column mode is Variable..PPSee also rowMode, rowMode, and numColumns..PPSet this property's value with setColumnMode() and get this property's value with columnMode()..SH "uint count"This property holds the number of items in the list box..PPGet this property's value with count()..SH "int currentItem"This property holds the current highlighted item..PPWhen setting this property, the highlighting is moved and the list box scrolled as necessary..PPIf no item has been highlighted, currentItem() returns -1..PPSet this property's value with setCurrentItem() and get this property's value with currentItem()..SH "QString currentText"This property holds the text of the current item..PPThis is equivalent to text(currentItem())..PPGet this property's value with currentText()..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 or not the list box is in Multi selection mode..PPConsider using the QListBox::selectionMode property instead of this property..PPWhen setting this property, Multi selection mode is used if set to TRUE and to Single selection mode if set to FALSE..PPWhen getting this property, TRUE is returned if the list box is in Multi selection mode or Extended selection mode, and FALSE if it is in Single selection mode or NoSelection mode..PPSee also selectionMode..PPSet this property's value with setMultiSelection() and get this property's value with isMultiSelection()..SH "int numColumns"This property holds the number of columns in the list box..PPThis is normally 1, but can be different if QListBox::columnMode or QListBox::rowMode has been set..PPSee also columnMode, rowMode, and numRows..PPGet this property's value with numColumns()..SH "int numItemsVisible"This property holds the number of visible items..PPBoth partially and entirely visible items are counted..PPGet this property's value with numItemsVisible()..SH "int numRows"This property holds the number of rows in the list box..PPThis is equal to the number of items in the default single-column layout, but can be different..PPSee also columnMode, rowMode, and numColumns..PPGet this property's value with numRows()..SH "LayoutMode rowMode"This property holds the row layout mode for this list box..PPThis property is normally Variable..PPsetRowMode() sets the layout mode and adjusts the number of displayed rows. The column layout mode automatically becomes Variable, unless the row mode is Variable..PPSee also columnMode..PPSet this property's value with setRowMode() and get this property's value with rowMode()..SH "SelectionMode selectionMode"This property holds the selection mode of the list box..PPSets the list box's selection mode, which may be one of Single (the default), Extended, Multi or NoSelection..PPSee also SelectionMode..PPSet this property's value with setSelectionMode() and get this property's value with selectionMode()..SH "int topItem"This property holds the index of an item at the top of the screen..PPWhen getting this property and the listbox has multiple columns, an arbitrary item is selected and returned..PPWhen setting this property, the list box is scrolled so the item at position \fIindex\fR in the list is displayed in the top row of the list box..PPSet this property's value with setTopItem() and get this property's value with topItem()..SH "bool variableHeight"This property holds whether this list box has variable-height rows..PPWhen the list box has variable-height rows (the default), each row is as high as the highest item in that row. When it has same-sized rows, all rows are as high as the highest item in the list box..PPSee also variableWidth..PPSet this property's value with setVariableHeight() and get this property's value with variableHeight()..SH "bool variableWidth"This property holds whether this list box has variable-width columns..PPWhen the list box has variable-width columns, each column is as wide as the widest item in that column. When it has same-sized columns (the default), all columns are as wide as the widest item in the list box..PPSee also variableHeight..PPSet this property's value with setVariableWidth() and get this property's value with variableWidth()..SH "SEE ALSO".BR http://doc.trolltech.com/qlistbox.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 (qlistbox.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

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