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

📄 qtable.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
📖 第 1 页 / 共 5 页
字号:
.SH "void QTable::setCurrentCell ( int row, int col )\fC [virtual slot]\fR"Moves the focus to the cell at \fIrow\fR, \fIcol\fR..PPSee also currentRow() and currentColumn()..SH "void QTable::setDragEnabled ( bool b )\fC [virtual slot]\fR"If \fIb\fR is TRUE, the table starts a drag (see dragObject()) when the user presses and moves the mouse on a selected cell..SH "void QTable::setEditMode ( EditMode mode, int row, int col )\fC [protected]\fR"Sets the current edit mode to \fImode\fR, the current edit row to \fIrow\fR and the current edit column to \fIcol\fR..PPSee also EditMode..SH "void QTable::setFocusStyle ( FocusStyle fs )\fC [virtual]\fR"Sets how the current (focus) cell is drawn to \fIfs\fR. See the "focusStyle" property for details..SH "void QTable::setItem ( int row, int col, QTableItem * item )\fC [virtual]\fR"Inserts the table item \fIitem\fR into the table at row \fIrow\fR, column \fIcol\fR, and repaints the cell. If a table item already exists in this cell it is deleted and replaced with \fIitem\fR. The table takes ownership of the table item..PPIf you don't use QTableItems you may need to reimplement this function: see the notes on large tables..PPSee also item() and takeItem()..PPExample: table/small-table-demo/main.cpp..SH "void QTable::setLeftMargin ( int m )\fC [virtual slot]\fR"Sets the left margin to be \fIm\fR pixels wide..PPThe verticalHeader(), which displays row labels, occupies this margin..PPSee also leftMargin(), setTopMargin() and verticalHeader()..SH "void QTable::setNumCols ( int r )\fC [virtual slot]\fR"Sets the number of columns in the table to \fIr\fR. See the "numCols" property for details..SH "void QTable::setNumRows ( int r )\fC [virtual slot]\fR"Sets the number of rows in the table to \fIr\fR. See the "numRows" property for details..SH "void QTable::setPixmap ( int row, int col, const QPixmap & pix )\fC [virtual]\fR"Sets the pixmap in the cell at \fIrow\fR, \fIcol\fR to \fIpix\fR..PPIf the cell does not contain a table item a QTableItem is created with an EditType of \fCOnTyping\fR, otherwise the existing table item's pixmap (if any) is replaced with \fIpix\fR..PPNote that QComboTableItems and QCheckTableItems don't show pixmaps..PPSee also pixmap(), setText(), setItem() and QTableItem::setPixmap()..SH "void QTable::setReadOnly ( bool b )\fC [virtual slot]\fR"Sets whether the table is read-only to \fIb\fR. See the "readOnly" property for details..SH "void QTable::setRowHeight ( int row, int h )\fC [virtual slot]\fR"Resizes row \fIrow\fR to be \fIh\fR pixels high..PPSee also rowHeight() and setColumnWidth()..SH "void QTable::setRowMovingEnabled ( bool b )\fC [virtual slot]\fR"Sets whether rows can be moved by the user to \fIb\fR. See the "rowMovingEnabled" property for details..SH "void QTable::setRowReadOnly ( int row, bool ro )\fC [virtual slot]\fR"If \fIro\fR is TRUE, row \fIrow\fR is set to be read-only; otherwise the row is set to be editable..PPWhether a cell in this row is editable or read-only depends on the cell's EditType, and this setting: see QTableItem::EditType..PPSee also isRowReadOnly(), setColumnReadOnly() and readOnly..SH "void QTable::setRowStretchable ( int row, bool stretch )\fC [virtual slot]\fR"If \fIstretch\fR is TRUE, row \fIrow\fR is set to be stretchable; otherwise row \fIrow\fR is set to be unstretchable..PPIf the table widget's height decreases or increases stretchable rows will grow shorter or taller to fit the space available as completely as possible. The user cannot manually resize stretchable rows..PPSee also isRowStretchable() and setColumnStretchable()..SH "void QTable::setSelectionMode ( SelectionMode mode )\fC [virtual]\fR"Sets the current selection mode to \fImode\fR. See the "selectionMode" property for details..SH "void QTable::setShowGrid ( bool b )\fC [virtual slot]\fR"Sets whether the table's grid is displayed to \fIb\fR. See the "showGrid" property for details..SH "void QTable::setSorting ( bool b )\fC [virtual slot]\fR"Sets whether a click on the header of a column sorts that column to \fIb\fR. See the "sorting" property for details..SH "void QTable::setText ( int row, int col, const QString & text )\fC [virtual]\fR"Sets the text in the cell at \fIrow\fR, \fIcol\fR to \fItext\fR..PPIf the cell does not contain a table item a QTableItem is created with an EditType of \fCOnTyping\fR, otherwise the existing table item's text (if any) is replaced with \fItext\fR..PPSee also text(), setPixmap(), setItem() and QTableItem::setText()..SH "void QTable::setTopMargin ( int m )\fC [virtual slot]\fR"Sets the top margin to be \fIm\fR pixels high..PPThe horizontalHeader(), which displays column labels, occupies this margin..PPSee also topMargin() and setLeftMargin()..SH "void QTable::showColumn ( int col )\fC [virtual slot]\fR"Show column \fIcol\fR..PPSee also hideColumn() and showRow()..SH "bool QTable::showGrid () const"Returns TRUE if the table's grid is displayed; otherwise returns FALSE. See the "showGrid" property for details..SH "void QTable::showRow ( int row )\fC [virtual slot]\fR"Show row \fIrow\fR..PPSee also hideRow() and showColumn()..SH "void QTable::sortColumn ( int col, bool ascending = TRUE, bool wholeRows = FALSE )\fC [virtual]\fR"Sorts column \fIcol\fR. If \fIascending\fR is TRUE the sort is in ascending order, otherwise the sort is in descending order..PPIf \fIwholeRows\fR is TRUE, entire rows are sorted using swapRows(); otherwise only cells in the column are sorted using swapCells()..PPNote that if you are not using QTableItems you will need to reimplement swapRows() and swapCells(). (See the notes on large tables.).PPSee also swapRows()..PPReimplemented in QDataTable..SH "bool QTable::sorting () const"Returns TRUE if a click on the header of a column sorts that column; otherwise returns FALSE. See the "sorting" property for details..SH "void QTable::startDrag ()\fC [virtual protected]\fR"Starts a drag..PPUsually you don't need to call or reimplement this function yourself..PPSee also dragObject()..SH "void QTable::swapCells ( int row1, int col1, int row2, int col2 )\fC [virtual slot]\fR"Swaps the contents of the cell at \fIrow1\fR, \fIcol1\fR with the contents of the cell at \fIrow2\fR, \fIcol2\fR..PPThis function is also called when the table is sorted..PPIf you don't use QTableItems and want your users to be able to swap cells, you will need to reimplement this function. (See the notes on large tables.).PPSee also swapColumns() and swapRows()..SH "void QTable::swapColumns ( int col1, int col2, bool swapHeader = FALSE )\fC [virtual slot]\fR"Exchanges \fIcol1\fR with \fIcol2\fR..PPThis function is used to swap the positions of two columns. It is called when the user changes the order of columns (see setColumnMovingEnabled(), and when columns are sorted..PPIf you don't use QTableItems and want your users to be able to swap columns you will need to reimplement this function. (See the notes on large tables.).PPIf \fIswapHeader\fR is TRUE, also the header contents of the columns is swapped..PPSee also swapCells()..SH "void QTable::swapRows ( int row1, int row2, bool swapHeader = FALSE )\fC [virtual slot]\fR"Swaps data of \fIrow1\fR and \fIrow2\fR..PPThis function is used to swap the positions of two rows. It is called when the user changes the order of rows (see setRowMovingEnabled()), and when rows are sorted..PPIf you don't use QTableItems and want your users to be able to swap rows, e.g. for sorting, you will need to reimplement this function. (See the notes on large tables.).PPIf \fIswapHeader\fR is TRUE, also the header contents of the rows is swapped..PPSee also swapColumns() and swapCells()..SH "void QTable::takeItem ( QTableItem * i )\fC [virtual]\fR"Takes the table item \fIi\fR out of the table. This function does \fInot\fR delete the table item. You must either delete the table item yourself or put it into a table (using setItem()) which will then take ownership of it..PPUse this function if you want to move an item from one cell in a table to another, or to move an item from one table to another, reinserting the item with setItem()..PPIf you want to exchange two cells use swapCells()..SH "QString QTable::text ( int row, int col ) const\fC [virtual]\fR"Returns the text in cell at \fIrow\fR, \fIcol\fR, or a null string if the relevant item does not exist or has no text..PPSee also setText() and setPixmap()..PPReimplemented in QDataTable..SH "void QTable::updateCell ( int row, int col )"Repaints the cell at \fIrow\fR, \fIcol\fR..SH "void QTable::valueChanged ( int row, int col )\fC [signal]\fR"This signal is emitted when the user changed the value in the cell at \fIrow\fR, \fIcol\fR..SH "QHeader * QTable::verticalHeader () const"Returns the table's left QHeader..PPThis header contains the row labels..PPSee also horizontalHeader(), setLeftMargin() and QHeader..SS "Property Documentation".SH "bool columnMovingEnabled"This property holds whether columns can be moved by the user..PPThe default is FALSE..PPSee also rowMovingEnabled..PPSet this property's value with setColumnMovingEnabled() and get this property's value with columnMovingEnabled()..SH "FocusStyle focusStyle"This property holds how the current (focus) cell is drawn..PPThe default style is SpreadSheet..PPSee also QTable::FocusStyle..PPSet this property's value with setFocusStyle() and get this property's value with focusStyle()..SH "int numCols"This property holds the number of columns in the table..PPSet this property's value with setNumCols() and get this property's value with numCols()..PPSee also numRows..SH "int numRows"This property holds the number of rows in the table..PPSet this property's value with setNumRows() and get this property's value with numRows()..PPSee also numCols..SH "bool readOnly"This property holds whether the table is read-only..PPWhether a cell in the table is editable or read-only depends on the cell's EditType, and this setting: see QTableItem::EditType..PPSee also QWidget::enabled, setColumnReadOnly() and setRowReadOnly()..PPSet this property's value with setReadOnly() and get this property's value with isReadOnly()..SH "bool rowMovingEnabled"This property holds whether rows can be moved by the user..PPThe default is FALSE..PPSee also columnMovingEnabled..PPSet this property's value with setRowMovingEnabled() and get this property's value with rowMovingEnabled()..SH "SelectionMode selectionMode"This property holds the current selection mode..PPThe default mode is Multi which allows the user to select multiple ranges of cells..PPSee also SelectionMode and selectionMode..PPSet this property's value with setSelectionMode() and get this property's value with selectionMode()..SH "bool showGrid"This property holds whether the table's grid is displayed..PPThe grid is shown by default..PPSet this property's value with setShowGrid() and get this property's value with showGrid()..SH "bool sorting"This property holds whether a click on the header of a column sorts that column..PPSet this property's value with setSorting() and get this property's value with sorting()..PPSee also sortColumn()..SH "SEE ALSO".BR http://doc.trolltech.com/qtable.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 (qtable.3qt) and the Qtversion (3.0.0).

⌨️ 快捷键说明

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