📄 qlistbox.3qt
字号:
Returns TRUE if the listbox is in multi-selection mode or extended selection mode, and FALSE if it is in single-selection mode..PPSee also: selectionMode() and setSelectionMode()..SH "bool QListBox::isSelected ( const QListBoxItem * i ) const"Returns TRUE if item \fIi\fR is selected. Returns FALSE if it is not selected or if there is an error..SH "bool QListBox::isSelected ( int i ) const"Returns TRUE if item \fIi\fR is selected. Returns FALSE if it is not selected or if there is an error..SH "QListBoxItem * QListBox::item ( int index ) const"Returns a pointer to the item at position \fIindex,\fR or 0 if \fIindex\fR is out of bounds..PPSee also: index()..SH "QListBoxItem * QListBox::itemAt ( QPoint p ) const"Returns a pointer to the item at \fIp,\fR which is in on-screen coordinates, or a null pointer if there is no item at \fIp.\fR.SH "int QListBox::itemHeight ( int index = 0 ) const"Returns the height in pixels of the item with index \fIindex. index\fR defaults to 0..PPIf \fIindex\fR is too large, this function returns 0..SH "QRect QListBox::itemRect ( QListBoxItem * item ) const"Returns the rectangle on the screen \fIitem\fR occupies in viewport()'s coordinates, or an invalid rectangle if \fIi\fR is a null pointer or is not currently visible..SH "bool QListBox::itemVisible ( const QListBoxItem * item )"Returns TRUE if \fIitem\fR is at least partly visible, or else FALSE..SH "bool QListBox::itemVisible ( int index )"Returns TRUE if the item at position \fIindex\fR is at least partly visible..SH "void QListBox::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"Handles key press events..PP\fCUp\fR and \fCdown\fR arrow keys make the highlighted item move and if necessary scroll the list box..PP\fCEnter\fR makes the list box emit the selected() signal..PPSee also: selected() and setCurrentItem()..PPReimplemented from QWidget..SH "QSize QListBox::minimumSizeHint () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QListBox::mouseDoubleClickEvent ( QMouseEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QListBox::mouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QListBox::mousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QListBox::mouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "int QListBox::numColumns () const"Returns the number of columns in the list box. This is normally 1, but can be different if setColumnMode() or setRowMode() has been called..PPSee also: setColumnMode(), setRowMode() and numRows()..SH "int QListBox::numItemsVisible () const"Returns the number of visible items. Both partially and entirely visible items are counted..SH "int QListBox::numRows () const"Returns the number of rows in the list box. This is equal to the number of items in the default single-column layout, but can be different..PPSee also: setRowMode() and numColumns()..SH "void QListBox::paintCell ( QPainter * p, int row, int col ) \fC[virtual protected]\fR"Provided for compatibility with the old QListBox. We recommend using QListBoxItem::paint()..SH "const QPixmap * QListBox::pixmap ( int index ) const"Returns a pointer to the pixmap at position \fIindex,\fR or 0 if there is no pixmap there..PPSee also: text()..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 selected and the highlighted() signal is emitted..PPSee also: insertItem() and clear()..SH "void QListBox::resizeEvent ( QResizeEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QListBox::selected ( const QString & ) \fC[signal]\fR"This signal is emitted when the user double-clicks on an item or presses return 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 ( int index ) \fC[signal]\fR"This signal is emitted when the user double-clicks on an item or presses return when an item is highlighted. The argument is the index of the selected item..PPSee also: highlighted() and selectionChanged()..SH "void QListBox::selectionChanged () \fC[signal]\fR"This signal is emitted when the selection set of a multiple-choice listbox changes. 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 "QListBox::SelectionMode QListBox::selectionMode() const"Returns the selection mode of the list box. The initial mode is \fCSingle.\fR.PPSee also: setSelectionMode()..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: setTopItem()..SH "void QListBox::setColumnMode ( LayoutMode mode ) \fC[virtual]\fR"Sets the column layout mode to \fImode,\fR and the number of displayed columns accordingly..PPThe row layout mode implicitly becomes \fCVariable.\fR.PPIf \fImode\fR is \fCVariable,\fR this function returns without doing anything..SH "void QListBox::setColumnMode ( int columns ) \fC[virtual]\fR"Sets the column layout mode for this list box to \fCFixedNumber,\fR and sets the number of displayed columns accordingly..PP\\setRowMode() columnMode() numColumns()..SH "void QListBox::setCurrentItem ( int index ) \fC[virtual]\fR"Sets the highlighted item to the item at position \fIindex\fR in the list. The highlighting is moved and the list box scrolled as necessary..PPIf autoUpdate() is enabled, the display is updated accordingly..PPSee also: currentItem()..PPExamples:.(ltabdialog/tabdialog.cpp.)l.SH "void QListBox::setFont ( const QFont & font ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..SH "void QListBox::setMultiSelection ( bool enable )"Sets the list box to multi-selection mode if \fIenable\fR is TRUE, and to single-selection mode if \fIenable\fR is FALSE. We recommend using setSelectionMode() instead; that function also offers a third mode of selection..PPSee also: setSelectionMode() and selectionMode()..SH "void QListBox::setRowMode ( LayoutMode mode ) \fC[virtual]\fR"Sets the row layout mode to \fImode,\fR and the number of displayed rows accordingly..PPThe column layout mode implicitly becomes \fCVariable.\fR.PPIf \fImode\fR is \fCVariable,\fR this function returns without doing anything..SH "void QListBox::setRowMode ( int rows ) \fC[virtual]\fR"Sets the row layout mode for this list box to \fCFixedNumber\fR and sets the number of displayed rows accordingly..PPSee also: setColumnMode(), rowMode() and numRows()..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 listbox is a single-selection listbox and and \fIselect\fR is TRUE, setCurrentItem will be called..PPIf the listbox is a single-selection listbox and and \fIselect\fR is FALSE, clearSelection() will be called if \fIindex\fR is the currently selected item..PPSee also: setMultiSelection(), setCurrentItem(), clearSelection() and currentItem()..SH "void QListBox::setSelected ( int index, bool select )"Selects the item at position \fIindex\fR if \fIselect\fR is TRUE, or unselects it if \fIselect\fR is FALSE, and repaints the item appropriately..PPIf the listbox is a single-selection listbox and and \fIselect\fR is TRUE, setCurrentItem will be called..PPIf the listbox is a single-selection listbox and and \fIselect\fR is FALSE, clearSelection() will be called if \fIindex\fR is the currently selected item..PPSee also: setMultiSelection(), setCurrentItem(), clearSelection() and currentItem()..SH "void QListBox::setSelectionMode ( SelectionMode mode ) \fC[virtual]\fR"Sets the list box to selection mode \fImode,\fR which may be one of \fCSingle\fR (the default), \fIExtended\fR and \fCMulti.\fR.PPSee also: selectionMode()..SH "void QListBox::setTopItem ( int index ) \fC[virtual]\fR"Scrolls the list box so the item at position \fIindex\fR in the list is displayed in the top row of the list box..PPSee also: topItem() and ensureCurrentVisible()..SH "void QListBox::setVariableHeight ( bool enable ) \fC[virtual]\fR"Sets this list box to have variable-height rows if \fIenable\fR is TRUE, and equal-height rows if \fIenable\fR is FALSE..PPWhen the list box has variable-height rows, 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..PPThe default is TRUE..PPSee also: setVariableWidth() and variableHeight()..SH "void QListBox::setVariableWidth ( bool enable ) \fC[virtual]\fR"Sets this list box to have variable-width columns if \fIenable\fR is TRUE, and equal-width columns if \fIenable\fR is FALSE..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, all columns are as wide as the widest item in the list box..PPThe default is FALSE..PPSee also: setVariableHeight() and variableWidth()..SH "void QListBox::showEvent ( QShowEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QSize QListBox::sizeHint () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QListBox::takeItem ( const QListBoxItem * item )"Removes \fIitem\fR from the listbox and causes an update of the screen display. The item is not deleted. You should normally not need to call this function, as QListBoxItem::~QListBoxItem() calls it. The normal way to delete an item is \fCdelete.\fR.PPSee also: QListBox::insertItem()..SH "QString QListBox::text ( int index ) const"Returns the text at position \fIindex,\fR or a null string 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 listbox is a multi-selection listbox..PPDoes nothing if the listbox is a single-selection listbox..PPSee also: setMultiSelection()..SH "int QListBox::topItem () const"Returns the index of an item at the top of the screen. If there are more than one of them, an arbitrary item is selected and returned..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 ( QListBoxItem * i ) \fC[protected]\fR"Repaints \fIi.\fR.SH "void QListBox::updateItem ( int index ) \fC[protected]\fR"Repaints the item at position \fIindex\fR in the list..SH "bool QListBox::variableHeight () const"Returns TRUE if this list box has variable-height rows, and FALSE if all the rows have the same height..PPSee also: setVariableHeight() and setVariableWidth()..SH "bool QListBox::variableWidth () const"Returns TRUE if this list box has variable-width columns, and FALSE if all the columns have the same width..PPSee also: setVariableHeight() and setVariableWidth()..SH "void QListBox::viewportMouseDoubleClickEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "void QListBox::viewportMouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "void QListBox::viewportMousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "void QListBox::viewportMouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "void QListBox::viewportPaintEvent ( QPaintEvent * e ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QScrollView..SH "SEE ALSO".BR http://www.troll.no/qt/qlistbox.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 + -