diff options
Diffstat (limited to 'src/sql/tqdatatable.cpp')
| -rw-r--r-- | src/sql/tqdatatable.cpp | 222 |
1 files changed, 111 insertions, 111 deletions
diff --git a/src/sql/tqdatatable.cpp b/src/sql/tqdatatable.cpp index ac4c11267..cef756b00 100644 --- a/src/sql/tqdatatable.cpp +++ b/src/sql/tqdatatable.cpp @@ -61,9 +61,9 @@ class TQDataTablePrivate { public: TQDataTablePrivate() - : nullTxtChanged( FALSE ), - haveAllRows( FALSE ), - continuousEdit( FALSE ), + : nullTxtChanged( false ), + haveAllRows( false ), + continuousEdit( false ), editorFactory( 0 ), propertyMap( 0 ), editRow( -1 ), @@ -71,9 +71,9 @@ public: insertRowLast( -1 ), insertPreRows( -1 ), editBuffer( 0 ), - cancelMode( FALSE ), - cancelInsert( FALSE ), - cancelUpdate( FALSE ) + cancelMode( false ), + cancelInsert( false ), + cancelUpdate( false ) {} ~TQDataTablePrivate() { if ( propertyMap ) delete propertyMap; } @@ -171,7 +171,7 @@ void qt_debug_buffer( const TQString& msg, TQSqlRecord* cursor ) appropriate popup menu item) and canceled by pressing Esc. If there is a problem updating or adding data, errors are handled automatically (see handleError() to change this behavior). Note - that if autoEdit() is FALSE navigating to another record will + that if autoEdit() is false navigating to another record will cancel the insert or update. The user can be asked to confirm all edits with setConfirmEdits(). @@ -220,7 +220,7 @@ void qt_debug_buffer( const TQString& msg, TQSqlRecord* cursor ) expected if you are using a TQSqlSelectCursor because it uses user-defined SQL queries to obtain data. - The text used to represent NULL, TRUE and FALSE values can be + The text used to represent NULL, true and false values can be changed with setNullText(), setTrueText() and setFalseText() respectively. You can change the appearance of cells by reimplementing paintField(). @@ -249,7 +249,7 @@ TQDataTable::TQDataTable ( TQWidget * parent, const char * name ) Constructs a data table which is a child of \a parent, called name \a name using the cursor \a cursor. - If \a autoPopulate is TRUE (the default is FALSE), columns are + If \a autoPopulate is true (the default is false), columns are automatically created based upon the fields in the \a cursor record. Note that \a autoPopulate only governs the creation of columns; to load the cursor's data into the table use refresh(). @@ -273,7 +273,7 @@ TQDataTable::TQDataTable ( TQSqlCursor* cursor, bool autoPopulate, TQWidget * pa void TQDataTable::init() { d = new TQDataTablePrivate(); - setAutoEdit( TRUE ); + setAutoEdit( true ); setSelectionMode( SingleRow ); setFocusStyle( FollowStyle ); d->trueTxt = tr( "True" ); @@ -315,7 +315,7 @@ void TQDataTable::addColumn( const TQString& fieldName, d->fldLabel += label; d->fldIcon += iconset; d->fldWidth += width; - d->fldHidden += FALSE; + d->fldHidden += false; } /*! @@ -339,7 +339,7 @@ void TQDataTable::setColumn( uint col, const TQString& fieldName, d->fldLabel[col] = label; d->fldIcon[col] = iconset; d->fldWidth[col] = width; - d->fldHidden[col] = FALSE; + d->fldHidden[col] = false; } /*! @@ -525,7 +525,7 @@ void TQDataTable::setConfirmDelete( bool confirm ) \property TQDataTable::confirmEdits \brief whether the data table confirms edit operations - If the confirmEdits property is TRUE, the data table confirms all + If the confirmEdits property is true, the data table confirms all edit operations (inserts, updates and deletes). Finer control of edit confirmation can be achieved using \l confirmCancels, \l confirmInsert, \l confirmUpdate and \l confirmDelete. @@ -542,7 +542,7 @@ bool TQDataTable::confirmEdits() const \property TQDataTable::confirmInsert \brief whether the data table confirms insert operations - If the confirmInsert property is TRUE, all insertions must be + If the confirmInsert property is true, all insertions must be confirmed by the user through a message box (this behaviour can be changed by overriding the confirmEdit() function), otherwise all insert operations occur immediately. @@ -559,7 +559,7 @@ bool TQDataTable::confirmInsert() const \property TQDataTable::confirmUpdate \brief whether the data table confirms update operations - If the confirmUpdate property is TRUE, all updates must be + If the confirmUpdate property is true, all updates must be confirmed by the user through a message box (this behaviour can be changed by overriding the confirmEdit() function), otherwise all update operations occur immediately. @@ -576,7 +576,7 @@ bool TQDataTable::confirmUpdate() const \property TQDataTable::confirmDelete \brief whether the data table confirms delete operations - If the confirmDelete property is TRUE, all deletions must be + If the confirmDelete property is true, all deletions must be confirmed by the user through a message box (this behaviour can be changed by overriding the confirmEdit() function), otherwise all delete operations occur immediately. @@ -593,10 +593,10 @@ bool TQDataTable::confirmDelete() const \property TQDataTable::confirmCancels \brief whether the data table confirms cancel operations - If the confirmCancel property is TRUE, all cancels must be + If the confirmCancel property is true, all cancels must be confirmed by the user through a message box (this behavior can be changed by overriding the confirmCancel() function), otherwise all - cancels occur immediately. The default is FALSE. + cancels occur immediately. The default is false. \sa confirmEdits() confirmCancel() */ @@ -620,7 +620,7 @@ bool TQDataTable::confirmCancels() const installEditorFactory(). The editor is primed with the value of the field in \a col using a property map. The property map used is the default property map, unless a new property map was installed with - installPropertMap(). If \a initFromCell is TRUE then the editor is + installPropertMap(). If \a initFromCell is true then the editor is primed with the value in the TQDataTable cell. */ @@ -648,7 +648,7 @@ TQWidget * TQDataTable::createEditor( int , int col, bool initFromCell ) const bool TQDataTable::eventFilter( TQObject *o, TQEvent *e ) { if ( d->cancelMode ) - return TRUE; + return true; int r = currentRow(); int c = currentColumn(); @@ -658,65 +658,65 @@ bool TQDataTable::eventFilter( TQObject *o, TQEvent *e ) c = d->editCol; } - d->cancelInsert = FALSE; - d->cancelUpdate = FALSE; + d->cancelInsert = false; + d->cancelUpdate = false; switch ( e->type() ) { case TQEvent::KeyPress: { int conf = TQSql::Yes; TQKeyEvent *ke = (TQKeyEvent*)e; if ( ( ke->key() == Key_Tab || ke->key() == TQt::Key_BackTab ) && ke->state() & TQt::ControlButton ) - return FALSE; + return false; if ( ke->key() == Key_Escape && d->dat.mode() == TQSql::Insert ){ if ( confirmCancels() && !d->cancelMode ) { - d->cancelMode = TRUE; + d->cancelMode = true; conf = confirmCancel( TQSql::Insert ); - d->cancelMode = FALSE; + d->cancelMode = false; } if ( conf == TQSql::Yes ) { - d->cancelInsert = TRUE; + d->cancelInsert = true; } else { TQWidget *editorWidget = cellWidget( r, c ); if ( editorWidget ) { editorWidget->setActiveWindow(); editorWidget->setFocus(); } - return TRUE; + return true; } } if ( ke->key() == Key_Escape && d->dat.mode() == TQSql::Update ) { if ( confirmCancels() && !d->cancelMode ) { - d->cancelMode = TRUE; + d->cancelMode = true; conf = confirmCancel( TQSql::Update ); - d->cancelMode = FALSE; + d->cancelMode = false; } if ( conf == TQSql::Yes ){ - d->cancelUpdate = TRUE; + d->cancelUpdate = true; } else { TQWidget *editorWidget = cellWidget( r, c ); if ( editorWidget ) { editorWidget->setActiveWindow(); editorWidget->setFocus(); } - return TRUE; + return true; } } if ( ke->key() == Key_Insert && d->dat.mode() == TQSql::None ) { beginInsert(); - return TRUE; + return true; } if ( ke->key() == Key_Delete && d->dat.mode() == TQSql::None ) { deleteCurrent(); - return TRUE; + return true; } if ( d->dat.mode() != TQSql::None ) { if ( (ke->key() == Key_Tab) && (c < numCols() - 1) && (!isColumnReadOnly( c+1 ) || d->dat.mode() == TQSql::Insert) ) - d->continuousEdit = TRUE; + d->continuousEdit = true; else if ( (ke->key() == Key_BackTab) && (c > 0) && (!isColumnReadOnly( c-1 ) || d->dat.mode() == TQSql::Insert) ) - d->continuousEdit = TRUE; + d->continuousEdit = true; else - d->continuousEdit = FALSE; + d->continuousEdit = false; } TQSqlCursor * sql = sqlCursor(); if ( sql && sql->driver() && @@ -737,7 +737,7 @@ bool TQDataTable::eventFilter( TQObject *o, TQEvent *e ) #ifndef TQT_NO_CURSOR TQApplication::restoreOverrideCursor(); #endif - return TRUE; + return true; } break; } @@ -747,9 +747,9 @@ bool TQDataTable::eventFilter( TQObject *o, TQEvent *e ) if ( !d->cancelMode && editorWidget && o == editorWidget && ( d->dat.mode() == TQSql::Insert) && !d->continuousEdit) { setCurrentCell( r, c ); - d->cancelInsert = TRUE; + d->cancelInsert = true; } - d->continuousEdit = FALSE; + d->continuousEdit = false; break; } case TQEvent::FocusIn: @@ -776,7 +776,7 @@ void TQDataTable::contentsContextMenuEvent( TQContextMenuEvent* e ) { TQTable::contentsContextMenuEvent( e ); if ( isEditing() && d->dat.mode() != TQSql::None ) - endEdit( d->editRow, d->editCol, autoEdit(), FALSE ); + endEdit( d->editRow, d->editCol, autoEdit(), false ); if ( !sqlCursor() ) return; if ( d->dat.mode() == TQSql::None ) { @@ -803,7 +803,7 @@ void TQDataTable::contentsContextMenuEvent( TQContextMenuEvent* e ) if ( r == id[ IdInsert ] ) beginInsert(); else if ( r == id[ IdUpdate ] ) { - if ( beginEdit( currentRow(), currentColumn(), FALSE ) ) + if ( beginEdit( currentRow(), currentColumn(), false ) ) setEditMode( Editing, currentRow(), currentColumn() ); else endUpdate(); @@ -836,7 +836,7 @@ TQWidget* TQDataTable::beginEdit ( int row, int col, bool replace ) if ( d->continuousEdit ) { // see comment in beginInsert() bool fakeReadOnly = isColumnReadOnly( col ); - setColumnReadOnly( col, FALSE ); + setColumnReadOnly( col, false ); TQWidget* w = TQTable::beginEdit( row, col, replace ); setColumnReadOnly( col, fakeReadOnly ); return w; @@ -959,9 +959,9 @@ void TQDataTable::endUpdate() bool TQDataTable::beginInsert() { if ( !sqlCursor() || isReadOnly() || !numCols() ) - return FALSE; + return false; if ( !sqlCursor()->canInsert() ) - return FALSE; + return false; int i = 0; int row = currentRow(); @@ -992,11 +992,11 @@ bool TQDataTable::beginInsert() // into a table that has read-only columns - temporarily // switch off read-only mode for such columns bool fakeReadOnly = isColumnReadOnly( 0 ); - setColumnReadOnly( 0, FALSE ); - if ( TQTable::beginEdit( row, 0, FALSE ) ) + setColumnReadOnly( 0, false ); + if ( TQTable::beginEdit( row, 0, false ) ) setEditMode( Editing, row, 0 ); setColumnReadOnly( 0, fakeReadOnly ); - return TRUE; + return true; } /*! @@ -1032,9 +1032,9 @@ TQWidget* TQDataTable::beginUpdate ( int row, int col, bool replace ) For an editable table, issues an insert on the current cursor using the values in the cursor's edit buffer. If there is no current cursor or there is no current "insert" row, nothing - happens. If confirmEdits() or confirmInsert() is TRUE, - confirmEdit() is called to confirm the insert. Returns TRUE if the - insert succeeded; otherwise returns FALSE. + happens. If confirmEdits() or confirmInsert() is true, + confirmEdit() is called to confirm the insert. Returns true if the + insert succeeded; otherwise returns false. The underlying cursor must have a valid primary index to ensure that a unique record is inserted within the database otherwise the @@ -1044,14 +1044,14 @@ TQWidget* TQDataTable::beginUpdate ( int row, int col, bool replace ) bool TQDataTable::insertCurrent() { if ( d->dat.mode() != TQSql::Insert || ! numCols() ) - return FALSE; + return false; if ( !sqlCursor()->canInsert() ) { #ifdef QT_CHECK_RANGE tqWarning("TQDataTable::insertCurrent: insert not allowed for %s", sqlCursor()->name().latin1() ); #endif endInsert(); - return FALSE; + return false; } int b = 0; int conf = TQSql::Yes; @@ -1076,7 +1076,7 @@ bool TQDataTable::insertCurrent() refresh(); TQSqlIndex idx = sqlCursor()->primaryIndex(); findBuffer( idx, d->lastAt ); - repaintContents( contentsX(), contentsY(), visibleWidth(), visibleHeight(), FALSE ); + repaintContents( contentsX(), contentsY(), visibleWidth(), visibleHeight(), false ); emit cursorChanged( TQSql::Insert ); } break; @@ -1085,7 +1085,7 @@ bool TQDataTable::insertCurrent() endInsert(); break; case TQSql::Cancel: - if ( TQTable::beginEdit( currentRow(), currentColumn(), FALSE ) ) + if ( TQTable::beginEdit( currentRow(), currentColumn(), false ) ) setEditMode( Editing, currentRow(), currentColumn() ); break; } @@ -1107,8 +1107,8 @@ void TQDataTable::updateRow( int row ) For an editable table, issues an update using the cursor's edit buffer. If there is no current cursor or there is no current selection, nothing happens. If confirmEdits() or confirmUpdate() - is TRUE, confirmEdit() is called to confirm the update. Returns - TRUE if the update succeeded; otherwise returns FALSE. + is true, confirmEdit() is called to confirm the update. Returns + true if the update succeeded; otherwise returns false. The underlying cursor must have a valid primary index to ensure that a unique record is updated within the database otherwise the @@ -1118,14 +1118,14 @@ void TQDataTable::updateRow( int row ) bool TQDataTable::updateCurrent() { if ( d->dat.mode() != TQSql::Update ) - return FALSE; + return false; if ( sqlCursor()->primaryIndex().count() == 0 ) { #ifdef QT_CHECK_RANGE tqWarning("TQDataTable::updateCurrent: no primary index for %s", sqlCursor()->name().latin1() ); #endif endUpdate(); - return FALSE; + return false; } if ( !sqlCursor()->canUpdate() ) { #ifdef QT_CHECK_RANGE @@ -1133,7 +1133,7 @@ bool TQDataTable::updateCurrent() sqlCursor()->name().latin1() ); #endif endUpdate(); - return FALSE; + return false; } int b = 0; int conf = TQSql::Yes; @@ -1154,7 +1154,7 @@ bool TQDataTable::updateCurrent() endUpdate(); refresh(); setCurrentCell( d->editRow, d->editCol ); - if ( TQTable::beginEdit( d->editRow, d->editCol, FALSE ) ) + if ( TQTable::beginEdit( d->editRow, d->editCol, false ) ) setEditMode( Editing, d->editRow, d->editCol ); } else { emit cursorChanged( TQSql::Update ); @@ -1169,7 +1169,7 @@ bool TQDataTable::updateCurrent() break; case TQSql::Cancel: setCurrentCell( d->editRow, d->editCol ); - if ( TQTable::beginEdit( d->editRow, d->editCol, FALSE ) ) + if ( TQTable::beginEdit( d->editRow, d->editCol, false ) ) setEditMode( Editing, d->editRow, d->editCol ); break; } @@ -1180,9 +1180,9 @@ bool TQDataTable::updateCurrent() For an editable table, issues a delete on the current cursor's primary index using the values of the currently selected row. If there is no current cursor or there is no current selection, - nothing happens. If confirmEdits() or confirmDelete() is TRUE, - confirmEdit() is called to confirm the delete. Returns TRUE if the - delete succeeded; otherwise FALSE. + nothing happens. If confirmEdits() or confirmDelete() is true, + confirmEdit() is called to confirm the delete. Returns true if the + delete succeeded; otherwise false. The underlying cursor must have a valid primary index to ensure that a unique record is deleted within the database otherwise the @@ -1192,16 +1192,16 @@ bool TQDataTable::updateCurrent() bool TQDataTable::deleteCurrent() { if ( !sqlCursor() || isReadOnly() ) - return FALSE; + return false; if ( sqlCursor()->primaryIndex().count() == 0 ) { #ifdef QT_CHECK_RANGE tqWarning("TQDataTable::deleteCurrent: no primary index %s", sqlCursor()->name().latin1() ); #endif - return FALSE; + return false; } if ( !sqlCursor()->canDelete() ) - return FALSE; + return false; int b = 0; int conf = TQSql::Yes; @@ -1212,7 +1212,7 @@ bool TQDataTable::deleteCurrent() // dialog that causes a repaint which the cursor to the // record it has to repaint. if ( !sqlCursor()->seek( currentRow() ) ) - return FALSE; + return false; switch ( conf ) { case TQSql::Yes:{ #ifndef TQT_NO_CURSOR @@ -1230,7 +1230,7 @@ bool TQDataTable::deleteCurrent() refresh(); emit cursorChanged( TQSql::Delete ); setCurrentCell( currentRow(), currentColumn() ); - repaintContents( contentsX(), contentsY(), visibleWidth(), visibleHeight(), FALSE ); + repaintContents( contentsX(), contentsY(), visibleWidth(), visibleHeight(), false ); verticalHeader()->repaint(); // get rid of trailing garbage } break; @@ -1271,11 +1271,11 @@ TQSql::Confirm TQDataTable::confirmCancel( TQSql::Op m ) /*! Searches the current cursor for a cell containing the string \a str starting at the current cell and working forwards (or - backwards if \a backwards is TRUE). If the string is found, the + backwards if \a backwards is true). If the string is found, the cell containing the string is set as the current cell. If \a - caseSensitive is FALSE the case of \a str will be ignored. + caseSensitive is false the case of \a str will be ignored. - The search will wrap, i.e. if the first (or if backwards is TRUE, + The search will wrap, i.e. if the first (or if backwards is true, last) cell is reached without finding \a str the search will continue until it reaches the starting cell. If \a str is not found the search will fail and the current cell will remain @@ -1290,7 +1290,7 @@ void TQDataTable::find( const TQString & str, bool caseSensitive, bool backwards TQString tmp, text; uint row = currentRow(), startRow = row, col = backwards ? currentColumn() - 1 : currentColumn() + 1; - bool wrap = TRUE, found = FALSE; + bool wrap = true, found = false; if( str.isEmpty() || str.isNull() ) return; @@ -1315,7 +1315,7 @@ void TQDataTable::find( const TQString & str, bool caseSensitive, bool backwards if( text.contains( tmp ) ){ setCurrentCell( row, i ); col = i; - found = TRUE; + found = true; } } if( !backwards ){ @@ -1330,7 +1330,7 @@ void TQDataTable::find( const TQString & str, bool caseSensitive, bool backwards if( startRow != 0 ){ startRow = 0; } else { - wrap = FALSE; + wrap = false; } r->first(); row = 0; @@ -1338,7 +1338,7 @@ void TQDataTable::find( const TQString & str, bool caseSensitive, bool backwards if( startRow != (uint) (numRows() - 1) ){ startRow = numRows() - 1; } else { - wrap = FALSE; + wrap = false; } r->last(); row = numRows() - 1; @@ -1373,14 +1373,14 @@ void TQDataTable::reset() verticalScrollBar()->setValue(0); setNumRows(0); - d->haveAllRows = FALSE; - d->continuousEdit = FALSE; + d->haveAllRows = false; + d->continuousEdit = false; d->dat.setMode( TQSql::None ); d->editRow = -1; d->editCol = -1; d->insertRowLast = -1; d->insertHeaderLabelLast = TQString::null; - d->cancelMode = FALSE; + d->cancelMode = false; d->lastAt = -1; d->fld.clear(); d->fldLabel.clear(); @@ -1405,8 +1405,8 @@ int TQDataTable::indexOf( uint i ) const } /*! - Returns TRUE if the table will automatically delete the cursor - specified by setSqlCursor(); otherwise returns FALSE. + Returns true if the table will automatically delete the cursor + specified by setSqlCursor(); otherwise returns false. */ bool TQDataTable::autoDelete() const @@ -1416,8 +1416,8 @@ bool TQDataTable::autoDelete() const /*! Sets the cursor auto-delete flag to \a enable. If \a enable is - TRUE, the table will automatically delete the cursor specified by - setSqlCursor(). If \a enable is FALSE (the default), the cursor + true, the table will automatically delete the cursor specified by + setSqlCursor(). If \a enable is false (the default), the cursor will not be deleted. */ @@ -1430,13 +1430,13 @@ void TQDataTable::setAutoDelete( bool enable ) \property TQDataTable::autoEdit \brief whether the data table automatically applies edits - The default value for this property is TRUE. When the user begins + The default value for this property is true. When the user begins an insert or update in the table there are two possible outcomes when they navigate to another record: \list 1 - \i the insert or update is is performed -- this occurs if autoEdit is TRUE - \i the insert or update is abandoned -- this occurs if autoEdit is FALSE + \i the insert or update is is performed -- this occurs if autoEdit is true + \i the insert or update is abandoned -- this occurs if autoEdit is false \endlist */ @@ -1461,7 +1461,7 @@ bool TQDataTable::autoEdit() const void TQDataTable::setNullText( const TQString& nullText ) { d->nullTxt = nullText; - d->nullTxtChanged = TRUE; + d->nullTxtChanged = true; } TQString TQDataTable::nullText() const @@ -1631,14 +1631,14 @@ void TQDataTable::loadNextPage() // check for empty result set if ( sqlCursor()->at() == TQSql::BeforeFirst && !sqlCursor()->next() ) { - d->haveAllRows = TRUE; + d->haveAllRows = true; return; } while ( endIdx > 0 && !sqlCursor()->seek( endIdx ) ) endIdx--; if ( endIdx != ( startIdx + pageSize + lookAhead ) ) - d->haveAllRows = TRUE; + d->haveAllRows = true; // small hack to prevent TQTable from moving the view when a row // is selected and the contents is resized SelectionMode m = selectionMode(); @@ -1665,7 +1665,7 @@ void TQDataTable::sliderReleased() } /*! - Sorts column \a col in ascending order if \a ascending is TRUE + Sorts column \a col in ascending order if \a ascending is true (the default); otherwise sorts in descending order. The \a wholeRows parameter is ignored; TQDataTable always sorts @@ -1677,7 +1677,7 @@ void TQDataTable::sortColumn ( int col, bool ascending, { if ( sorting() ) { if ( isEditing() && d->dat.mode() != TQSql::None ) - endEdit( d->editRow, d->editCol, autoEdit(), FALSE ); + endEdit( d->editRow, d->editCol, autoEdit(), false ); if ( !sqlCursor() ) return; TQSqlIndex lastSort = sqlCursor()->sort(); @@ -1699,7 +1699,7 @@ void TQDataTable::columnClicked ( int col ) if ( !sqlCursor() ) return; TQSqlIndex lastSort = sqlCursor()->sort(); - bool asc = TRUE; + bool asc = true; if ( lastSort.count() && lastSort.field( 0 )->name() == sqlCursor()->field( indexOf( col ) )->name() ) asc = lastSort.isDescending( 0 ); sortColumn( col, asc ); @@ -1717,7 +1717,7 @@ void TQDataTable::repaintCell( int row, int col ) TQRect cg = cellGeometry( row, col ); TQRect re( TQPoint( cg.x() - 2, cg.y() - 2 ), TQSize( cg.width() + 4, cg.height() + 4 ) ); - repaintContents( re, FALSE ); + repaintContents( re, false ); } /*! @@ -1727,7 +1727,7 @@ void TQDataTable::repaintCell( int row, int col ) the corresponding cursor field on the painter \a p. Depending on the table's current edit mode, paintField() is called for the appropriate cursor field. \a cr describes the cell coordinates in - the content coordinate system. If \a selected is TRUE the cell has + the content coordinate system. If \a selected is true the cell has been selected and would normally be rendered differently than an unselected cell. @@ -1833,9 +1833,9 @@ void TQDataTable::setSize( TQSqlCursor* sql ) /*! Sets \a cursor as the data source for the table. To force the display of the data from \a cursor, use refresh(). If \a - autoPopulate is TRUE, columns are automatically created based upon - the fields in the \a cursor record. If \a autoDelete is TRUE (the - default is FALSE), the table will take ownership of the \a cursor + autoPopulate is true, columns are automatically created based upon + the fields in the \a cursor record. If \a autoDelete is true (the + default is false), the table will take ownership of the \a cursor and delete it when appropriate. If the \a cursor is read-only, the table becomes read-only. The table adopts the cursor's driver's definition for representing NULL values as strings. @@ -1845,7 +1845,7 @@ void TQDataTable::setSize( TQSqlCursor* sql ) void TQDataTable::setSqlCursor( TQSqlCursor* cursor, bool autoPopulate, bool autoDelete ) { - setUpdatesEnabled( FALSE ); + setUpdatesEnabled( false ); d->cur.setCursor( 0 ); if ( cursor ) { d->cur.setCursor( cursor, autoDelete ); @@ -1868,7 +1868,7 @@ void TQDataTable::setSqlCursor( TQSqlCursor* cursor, bool autoPopulate, bool aut setNumRows( 0 ); setNumCols( 0 ); } - setUpdatesEnabled( TRUE ); + setUpdatesEnabled( true ); } @@ -2033,7 +2033,7 @@ TQSqlRecord* TQDataTable::currentRecord() const void TQDataTable::sortAscending( int col ) { - sortColumn( col, TRUE ); + sortColumn( col, true ); } /*! @@ -2044,7 +2044,7 @@ void TQDataTable::sortAscending( int col ) void TQDataTable::sortDescending( int col ) { - sortColumn( col, FALSE ); + sortColumn( col, false ); } /*! @@ -2065,13 +2065,13 @@ void TQDataTable::refresh( TQDataTable::Refresh mode ) bool refreshData = ( (mode & RefreshData) == RefreshData ); bool refreshCol = ( (mode & RefreshColumns) == RefreshColumns ); if ( ( (mode & RefreshAll) == RefreshAll ) ) { - refreshData = TRUE; - refreshCol = TRUE; + refreshData = true; + refreshCol = true; } if ( !refreshCol && d->fld.count() && numCols() == 0 ) - refreshCol = TRUE; - viewport()->setUpdatesEnabled( FALSE ); - d->haveAllRows = FALSE; + refreshCol = true; + viewport()->setUpdatesEnabled( false ); + d->haveAllRows = false; if ( refreshData ) { if ( !d->cur.refresh() && d->cur.cursor() ) { handleError( d->cur.cursor()->lastError() ); @@ -2113,8 +2113,8 @@ void TQDataTable::refresh( TQDataTable::Refresh mode ) } } } - viewport()->setUpdatesEnabled( TRUE ); - viewport()->repaint( FALSE ); + viewport()->setUpdatesEnabled( true ); + viewport()->repaint( false ); horizontalHeader()->repaint(); verticalHeader()->repaint(); setSize( cur ); @@ -2151,7 +2151,7 @@ bool TQDataTable::findBuffer( const TQSqlIndex& idx, int atHint ) { TQSqlCursor* cur = sqlCursor(); if ( !cur ) - return FALSE; + return false; bool found = d->cur.findBuffer( idx, atHint ); if ( found ) setCurrentCell( cur->at(), currentColumn() ); @@ -2232,7 +2232,7 @@ void TQDataTable::drawContents( TQPainter * p, int cx, int cy, int cw, int ch ) void TQDataTable::hideColumn( int col ) { - d->fldHidden[col] = TRUE; + d->fldHidden[col] = true; refresh( RefreshColumns ); } @@ -2242,7 +2242,7 @@ void TQDataTable::hideColumn( int col ) void TQDataTable::showColumn( int col ) { - d->fldHidden[col] = FALSE; + d->fldHidden[col] = false; refresh( RefreshColumns ); } |
