diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-08-09 22:25:47 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-08-09 22:25:47 -0500 |
commit | eaa7ee2e0bbca40ba3173c4304f81957e8964291 (patch) | |
tree | 4f793aa48a5080aedc94ce6e519c3b86708f2b88 /tqtinterface/qt4/src/table/tqtable.cpp | |
parent | 79a9d7a46a20d4a0923bc06fc471fdc2176ef865 (diff) | |
download | experimental-eaa7ee2e0bbca40ba3173c4304f81957e8964291.tar.gz experimental-eaa7ee2e0bbca40ba3173c4304f81957e8964291.zip |
rename the following methods:
tqfind find
tqreplace replace
tqcontains contains
Diffstat (limited to 'tqtinterface/qt4/src/table/tqtable.cpp')
-rw-r--r-- | tqtinterface/qt4/src/table/tqtable.cpp | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/tqtinterface/qt4/src/table/tqtable.cpp b/tqtinterface/qt4/src/table/tqtable.cpp index 1e2ccb7..cb1d068 100644 --- a/tqtinterface/qt4/src/table/tqtable.cpp +++ b/tqtinterface/qt4/src/table/tqtable.cpp @@ -214,7 +214,7 @@ static bool isRowSelection( TQTable::SelectionMode selMode ) function expands the selection rectangle to include additional cells. - There are various access functions to tqfind out about the area: + There are various access functions to find out about the area: anchorRow() and anchorCol() return the anchor's position; leftCol(), rightCol(), topRow() and bottomRow() return the rectangle's four edges. All four are part of the selection. @@ -423,7 +423,7 @@ int TQTableSelection::numCols() const to create very large tables you may prefer an alternative approach to using TQTableItems: see the notes on large tables. - A TQTableItem tqcontains a cell's data, by default, a string and a + A TQTableItem contains a cell's data, by default, a string and a pixmap. The table item also holds the cell's display size and how the data should be aligned. The table item specifies the cell's \l EditType and the editor used for in-place editing (by default a @@ -441,7 +441,7 @@ int TQTableSelection::numCols() const customize how your table items will sort. Table items are inserted into a table using TQTable::setItem(). If - you insert an item into a cell that already tqcontains a table item + you insert an item into a cell that already contains a table item the original item will be deleted. Example: @@ -488,7 +488,7 @@ int TQTableSelection::numCols() const } \endcode - By default, table items may be tqreplaced by new TQTableItems + By default, table items may be replaced by new TQTableItems during the lifetime of a TQTable. Therefore, if you create your own subclass of TQTableItem, and you want to ensure that this does not happen, you must call setReplaceable(FALSE) @@ -903,11 +903,11 @@ TQTableItem::EditType TQTableItem::editType() const } /*! - If \a b is TRUE it is acceptable to tqreplace the contents of the + If \a b is TRUE it is acceptable to replace the contents of the cell with the contents of another TQTableItem. If \a b is FALSE the - contents of the cell may not be tqreplaced by the contents of + contents of the cell may not be replaced by the contents of another table item. Table items that span more than one cell may - not have their contents tqreplaced by another table item. + not have their contents replaced by another table item. (This differs from \l EditType because EditType is concerned with whether the \e user is able to change the contents of a cell.) @@ -922,9 +922,9 @@ void TQTableItem::setReplaceable( bool b ) /*! This function returns whether the contents of the cell may be - tqreplaced with the contents of another table item. Regardless of + replaced with the contents of another table item. Regardless of this setting, table items that span more than one cell may not - have their contents tqreplaced by another table item. + have their contents replaced by another table item. (This differs from \l EditType because EditType is concerned with whether the \e user is able to change the contents of a cell.) @@ -975,7 +975,7 @@ TQSize TQTableItem::tqsizeHint() const } TQString t = text(); - if ( !wordwrap && t.tqfind( '\n' ) == -1 ) + if ( !wordwrap && t.find( '\n' ) == -1 ) return TQSize( s.width() + table()->fontMetrics().width( text() ) + 10, TQMAX( s.height(), table()->fontMetrics().height() ) ).expandedTo( strutSize ); @@ -1215,7 +1215,7 @@ int TQComboTableItem::fakeRef = 0; TRUE the user may type in new list items; if \a editable is FALSE the user may only select from the list of items provided. - By default TQComboTableItems cannot be tqreplaced by other table + By default TQComboTableItems cannot be replaced by other table items since isReplaceable() returns FALSE by default. \sa TQTable::clearCell() EditType @@ -1350,7 +1350,7 @@ void TQComboTableItem::setCurrentItem( int i ) void TQComboTableItem::setCurrentItem( const TQString &s ) { - int i = entries.tqfindIndex( s ); + int i = entries.findIndex( s ); if ( i != -1 ) setCurrentItem( i ); } @@ -2210,7 +2210,7 @@ void TQTable::setReadOnly( bool b ) void TQTable::setRowReadOnly( int row, bool ro ) { if ( ro ) - roRows.tqreplace( row, new int( 0 ) ); + roRows.replace( row, new int( 0 ) ); else roRows.remove( row ); @@ -2240,7 +2240,7 @@ void TQTable::setRowReadOnly( int row, bool ro ) void TQTable::setColumnReadOnly( int col, bool ro ) { if ( ro ) - roCols.tqreplace( col, new int( 0 ) ); + roCols.replace( col, new int( 0 ) ); else roCols.remove( col ); @@ -2285,7 +2285,7 @@ bool TQTable::isReadOnly() const bool TQTable::isRowReadOnly( int row ) const { - return (roRows.tqfind( row ) != 0); + return (roRows.find( row ) != 0); } /*! @@ -2301,7 +2301,7 @@ bool TQTable::isRowReadOnly( int row ) const bool TQTable::isColumnReadOnly( int col ) const { - return (roCols.tqfind( col ) != 0); + return (roCols.find( col ) != 0); } void TQTable::setSelectionMode( SelectionMode mode ) @@ -2396,7 +2396,7 @@ void TQTable::updateHeaderStates() /*! Returns the table's top TQHeader. - This header tqcontains the column labels. + This header contains the column labels. To modify a column label use TQHeader::setLabel(), e.g. \quotefile table/statistics/statistics.cpp @@ -2414,7 +2414,7 @@ TQHeader *TQTable::horizontalHeader() const /*! Returns the table's vertical TQHeader. - This header tqcontains the row labels. + This header contains the row labels. \sa horizontalHeader() setLeftMargin() TQHeader */ @@ -3088,7 +3088,7 @@ TQTableItem *TQTable::item( int row, int col ) const /*! Inserts the table item \a item into the table at row \a row, column \a col, and repaints the cell. If a table item already - exists in this cell it is deleted and tqreplaced with \a item. The + exists in this cell it is deleted and replaced with \a item. The table takes ownership of the table item. If you don't use \l{TQTableItem}s you may need to reimplement this @@ -3145,7 +3145,7 @@ void TQTable::clearCell( int row, int col ) If the cell does not contain a table item a TQTableItem is created with an \link TQTableItem::EditType EditType\endlink of \c OnTyping, - otherwise the existing table item's text (if any) is tqreplaced with + otherwise the existing table item's text (if any) is replaced with \a text. \sa text() setPixmap() setItem() TQTableItem::setText() @@ -3170,7 +3170,7 @@ void TQTable::setText( int row, int col, const TQString &text ) If the cell does not contain a table item a TQTableItem is created with an \link TQTableItem::EditType EditType\endlink of \c OnTyping, - otherwise the existing table item's pixmap (if any) is tqreplaced + otherwise the existing table item's pixmap (if any) is replaced with \a pix. Note that \l{TQComboTableItem}s and \l{TQCheckTableItem}s don't show @@ -3209,7 +3209,7 @@ TQString TQTable::text( int row, int col ) const /*! Returns the pixmap set for the cell at \a row, \a col, or a - null-pixmap if the cell tqcontains no pixmap. + null-pixmap if the cell contains no pixmap. \sa setPixmap() */ @@ -3557,7 +3557,7 @@ int TQTable::currentSelection() const { if ( !currentSel ) return -1; - return ( (TQTable*)this )->selections.tqfindRef( currentSel ); + return ( (TQTable*)this )->selections.findRef( currentSel ); } /*! Selects the range starting at \a start_row and \a start_col and @@ -3626,7 +3626,7 @@ void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) { shouldClearSelection = FALSE; if ( isEditing() ) { - if ( !cellGeometry( editRow, editCol ).tqcontains( e->pos() ) ) { + if ( !cellGeometry( editRow, editCol ).contains( e->pos() ) ) { endEdit( editRow, editCol, TRUE, edMode != Editing ); } else { e->ignore(); @@ -4010,7 +4010,7 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) int cc = TQMIN( numCols() - 1, currentColumn() + 1 ); while ( cc < numCols() ) { TQTableItem *i = item( currentRow(), cc ); - if ( !d->hiddenCols.tqfind( cc ) && !isColumnReadOnly( cc ) && (!i || i->isEnabled()) ) + if ( !d->hiddenCols.find( cc ) && !isColumnReadOnly( cc ) && (!i || i->isEnabled()) ) break; ++cc; } @@ -4021,7 +4021,7 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) int cc = TQMAX( 0, currentColumn() - 1 ); while ( cc >= 0 ) { TQTableItem *i = item( currentRow(), cc ); - if ( !d->hiddenCols.tqfind( cc ) && !isColumnReadOnly( cc ) && (!i || i->isEnabled()) ) + if ( !d->hiddenCols.find( cc ) && !isColumnReadOnly( cc ) && (!i || i->isEnabled()) ) break; --cc; } @@ -4047,7 +4047,7 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) } } else { TQObjectList *l = viewport()->queryList( "TQWidget" ); - if ( l && l->tqfind( o ) != -1 ) { + if ( l && l->find( o ) != -1 ) { delete l; TQKeyEvent *ke = (TQKeyEvent*)e; if ( ( ke->state() & ControlButton ) == ControlButton || @@ -4191,7 +4191,7 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) int cc = TQMIN( numCols() - 1, currentColumn() + 1 ); while ( cc < numCols() ) { TQTableItem *i = item( currentRow(), cc ); - if ( !d->hiddenCols.tqfind( cc ) && !isColumnReadOnly( cc ) && (!i || i->isEnabled()) ) + if ( !d->hiddenCols.find( cc ) && !isColumnReadOnly( cc ) && (!i || i->isEnabled()) ) break; ++cc; } @@ -4202,7 +4202,7 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) int cc = TQMAX( 0, currentColumn() - 1 ); while ( cc >= 0 ) { TQTableItem *i = item( currentRow(), cc ); - if ( !d->hiddenCols.tqfind( cc ) && !isColumnReadOnly( cc ) && (!i || i->isEnabled()) ) + if ( !d->hiddenCols.find( cc ) && !isColumnReadOnly( cc ) && (!i || i->isEnabled()) ) break; --cc; } @@ -4922,7 +4922,7 @@ void TQTable::setNumRows( int r ) if (r < numRows()) { // Removed rows are no longer hidden, and should thus be removed from "hiddenRows" for (int rr = numRows()-1; rr >= r; --rr) { - if (d->hiddenRows.tqfind(rr)) + if (d->hiddenRows.find(rr)) d->hiddenRows.remove(rr); } } @@ -4971,7 +4971,7 @@ void TQTable::setNumCols( int c ) if (c < numCols()) { // Removed columns are no longer hidden, and should thus be removed from "hiddenCols" for (int cc = numCols()-1; cc >= c; --cc) { - if (d->hiddenCols.tqfind(cc)) + if (d->hiddenCols.find(cc)) d->hiddenCols.remove(cc); } } @@ -5026,7 +5026,7 @@ void TQTable::setColumnLabels( const TQStringList &labels ) If \a initFromCell is TRUE, the editor is used to edit the current contents of the cell (so the editor widget should be initialized with this content). If \a initFromCell is FALSE, the content of - the cell is tqreplaced with the new content which the user entered + the cell is replaced with the new content which the user entered into the widget created by this function. The default functionality is as follows: if \a initFromCell is @@ -5093,8 +5093,8 @@ TQWidget *TQTable::createEditor( int row, int col, bool initFromCell ) const \a row, \a col. Editing is achieved by creating an editor (createEditor() is called) and setting the cell's editor with setCellWidget() to the newly created editor. (After editing is - complete endEdit() will be called to tqreplace the cell's content - with the editor's content.) If \a tqreplace is TRUE the editor will + complete endEdit() will be called to replace the cell's content + with the editor's content.) If \a replace is TRUE the editor will start empty; otherwise it will be initialized with the cell's content (if any), i.e. the user will be modifying the original cell content. @@ -5102,7 +5102,7 @@ TQWidget *TQTable::createEditor( int row, int col, bool initFromCell ) const \sa endEdit() */ -TQWidget *TQTable::beginEdit( int row, int col, bool tqreplace ) +TQWidget *TQTable::beginEdit( int row, int col, bool replace ) { if ( isReadOnly() || isRowReadOnly( row ) || isColumnReadOnly( col ) ) return 0; @@ -5115,7 +5115,7 @@ TQWidget *TQTable::beginEdit( int row, int col, bool tqreplace ) if ( cellWidget( row, col ) ) return 0; ensureCellVisible( row, col ); - TQWidget *e = createEditor( row, col, !tqreplace ); + TQWidget *e = createEditor( row, col, !replace ); if ( !e ) return 0; setCellWidget( row, col, e ); @@ -5133,13 +5133,13 @@ TQWidget *TQTable::beginEdit( int row, int col, bool tqreplace ) returns and the cell's contents are left unchanged. If \a accept is TRUE the content of the editor must be transferred - to the relevant cell. If \a tqreplace is TRUE the current content of - this cell should be tqreplaced by the content of the editor (this + to the relevant cell. If \a replace is TRUE the current content of + this cell should be replaced by the content of the editor (this means removing the current TQTableItem of the cell and creating a new one for the cell). Otherwise (if possible) the content of the editor should just be set to the existing TQTableItem of this cell. - setCellContentFromEditor() is called to tqreplace the contents of + setCellContentFromEditor() is called to replace the contents of the cell with the contents of the cell's editor. Finally clearCellWidget() is called to remove the editor widget. @@ -5147,7 +5147,7 @@ TQWidget *TQTable::beginEdit( int row, int col, bool tqreplace ) \sa setCellContentFromEditor(), beginEdit() */ -void TQTable::endEdit( int row, int col, bool accept, bool tqreplace ) +void TQTable::endEdit( int row, int col, bool accept, bool replace ) { TQWidget *editor = cellWidget( row, col ); if ( !editor ) @@ -5168,7 +5168,7 @@ void TQTable::endEdit( int row, int col, bool accept, bool tqreplace ) if ( i ) oldContent = i->text(); - if ( !i || tqreplace ) { + if ( !i || replace ) { setCellContentFromEditor( row, col ); i = item( row, col ); } else { @@ -5188,7 +5188,7 @@ void TQTable::endEdit( int row, int col, bool accept, bool tqreplace ) } /*! - This function is called to tqreplace the contents of the cell at \a + This function is called to replace the contents of the cell at \a row, \a col with the contents of the cell's editor. If there already exists a TQTableItem for the cell, @@ -5491,17 +5491,17 @@ TQRect TQTable::rangeGeometry( int topRow, int leftCol, void TQTable::activateNextCell() { int firstRow = 0; - while ( d->hiddenRows.tqfind( firstRow ) ) + while ( d->hiddenRows.find( firstRow ) ) firstRow++; int firstCol = 0; - while ( d->hiddenCols.tqfind( firstCol ) ) + while ( d->hiddenCols.find( firstCol ) ) firstCol++; int nextRow = curRow; int nextCol = curCol; - while ( d->hiddenRows.tqfind( ++nextRow ) ); + while ( d->hiddenRows.find( ++nextRow ) ); if ( nextRow >= numRows() ) { nextRow = firstRow; - while ( d->hiddenCols.tqfind( ++nextCol ) ); + while ( d->hiddenCols.find( ++nextCol ) ); if ( nextCol >= numCols() ) nextCol = firstCol; } @@ -5657,9 +5657,9 @@ void TQTable::sortColumn( int col, bool ascending, bool wholeRows ) void TQTable::hideRow( int row ) { - if ( d->hiddenRows.tqfind( row ) ) + if ( d->hiddenRows.find( row ) ) return; - d->hiddenRows.tqreplace( row, new int( leftHeader->sectionSize( row ) ) ); + d->hiddenRows.replace( row, new int( leftHeader->sectionSize( row ) ) ); leftHeader->resizeSection( row, 0 ); leftHeader->setResizeEnabled( FALSE, row ); if ( isRowStretchable(row) ) @@ -5683,9 +5683,9 @@ void TQTable::hideRow( int row ) void TQTable::hideColumn( int col ) { - if ( !numCols() || d->hiddenCols.tqfind( col ) ) + if ( !numCols() || d->hiddenCols.find( col ) ) return; - d->hiddenCols.tqreplace( col, new int( topHeader->sectionSize( col ) ) ); + d->hiddenCols.replace( col, new int( topHeader->sectionSize( col ) ) ); topHeader->resizeSection( col, 0 ); topHeader->setResizeEnabled( FALSE, col ); if ( isColumnStretchable(col) ) @@ -5709,7 +5709,7 @@ void TQTable::hideColumn( int col ) void TQTable::showRow( int row ) { - int *h = d->hiddenRows.tqfind( row ); + int *h = d->hiddenRows.find( row ); if ( h ) { int rh = *h; d->hiddenRows.remove( row ); @@ -5730,7 +5730,7 @@ void TQTable::showRow( int row ) void TQTable::showColumn( int col ) { - int *w = d->hiddenCols.tqfind( col ); + int *w = d->hiddenCols.find( col ); if ( w ) { int cw = *w; d->hiddenCols.remove( col ); @@ -5751,7 +5751,7 @@ void TQTable::showColumn( int col ) */ bool TQTable::isRowHidden( int row ) const { - return d->hiddenRows.tqfind( row ); + return d->hiddenRows.find( row ); } /*! @@ -5762,7 +5762,7 @@ bool TQTable::isRowHidden( int row ) const */ bool TQTable::isColumnHidden( int col ) const { - return d->hiddenCols.tqfind( col ); + return d->hiddenCols.find( col ); } /*! @@ -5773,9 +5773,9 @@ bool TQTable::isColumnHidden( int col ) const void TQTable::setColumnWidth( int col, int w ) { - int *ow = d->hiddenCols.tqfind( col ); + int *ow = d->hiddenCols.find( col ); if ( ow ) { - d->hiddenCols.tqreplace( col, new int( w ) ); + d->hiddenCols.replace( col, new int( w ) ); } else { topHeader->resizeSection( col, w ); columnWidthChanged( col ); @@ -5790,9 +5790,9 @@ void TQTable::setColumnWidth( int col, int w ) void TQTable::setRowHeight( int row, int h ) { - int *oh = d->hiddenRows.tqfind( row ); + int *oh = d->hiddenRows.find( row ); if ( oh ) { - d->hiddenRows.tqreplace( row, new int( h ) ); + d->hiddenRows.replace( row, new int( h ) ); } else { leftHeader->resizeSection( row, h ); rowHeightChanged( row ); @@ -5801,7 +5801,7 @@ void TQTable::setRowHeight( int row, int h ) /*! Resizes column \a col so that the column width is wide enough to - display the widest item the column tqcontains. + display the widest item the column contains. \sa adjustRow() */ @@ -5838,7 +5838,7 @@ void TQTable::adjustColumn( int col ) /*! Resizes row \a row so that the row height is tall enough to - display the tallest item the row tqcontains. + display the tallest item the row contains. \sa adjustColumn() */ @@ -5882,7 +5882,7 @@ void TQTable::setColumnStretchable( int col, bool stretch ) { topHeader->setSectionStretchable( col, stretch ); - if ( stretch && d->hiddenCols.tqfind(col) ) + if ( stretch && d->hiddenCols.find(col) ) topHeader->numStretches--; } @@ -5902,7 +5902,7 @@ void TQTable::setRowStretchable( int row, bool stretch ) { leftHeader->setSectionStretchable( row, stretch ); - if ( stretch && d->hiddenRows.tqfind(row) ) + if ( stretch && d->hiddenRows.find(row) ) leftHeader->numStretches--; } @@ -6091,7 +6091,7 @@ void TQTable::clearCellWidget( int row, int col ) This signal is emitted when a drop event occurred on the table. - \a e tqcontains information about the drop. + \a e contains information about the drop. */ /*! @@ -6244,7 +6244,7 @@ void TQTable::removeRow( int row ) if ( row < 0 || row >= numRows() ) return; if ( row < numRows() - 1 ) { - if (d->hiddenRows.tqfind(row)) + if (d->hiddenRows.find(row)) d->hiddenRows.remove(row); for ( int i = row; i < numRows() - 1; ++i ) @@ -6294,7 +6294,7 @@ void TQTable::removeColumn( int col ) if ( col < 0 || col >= numCols() ) return; if ( col < numCols() - 1 ) { - if (d->hiddenCols.tqfind(col)) + if (d->hiddenCols.find(col)) d->hiddenCols.remove(col); for ( int i = col; i < numCols() - 1; ++i ) @@ -6335,7 +6335,7 @@ void TQTable::removeColumns( const TQMemArray<int> &cols ) /*! Starts editing the cell at \a row, \a col. - If \a tqreplace is TRUE the content of this cell will be tqreplaced by + If \a replace is TRUE the content of this cell will be replaced by the content of the editor when editing is finished, i.e. the user will be entering new data; otherwise the current content of the cell (if any) will be modified in the editor. @@ -6343,12 +6343,12 @@ void TQTable::removeColumns( const TQMemArray<int> &cols ) \sa beginEdit() */ -void TQTable::editCell( int row, int col, bool tqreplace ) +void TQTable::editCell( int row, int col, bool replace ) { if ( row < 0 || col < 0 || row > numRows() - 1 || col > numCols() - 1 ) return; - if ( beginEdit( row, col, tqreplace ) ) { + if ( beginEdit( row, col, replace ) ) { edMode = Editing; editRow = row; editCol = col; |