diff options
53 files changed, 1479 insertions, 1481 deletions
diff --git a/src/sql/drivers/cache/tqsqlcachedresult.cpp b/src/sql/drivers/cache/tqsqlcachedresult.cpp index 709e61944..b22c56b28 100644 --- a/src/sql/drivers/cache/tqsqlcachedresult.cpp +++ b/src/sql/drivers/cache/tqsqlcachedresult.cpp @@ -61,7 +61,7 @@ public: }; TQtSqlCachedResultPrivate::TQtSqlCachedResultPrivate(): - cache(0), current(0), rowCacheEnd(0), colCount(0), forwardOnly(FALSE) + cache(0), current(0), rowCacheEnd(0), colCount(0), forwardOnly(false) { } @@ -76,7 +76,7 @@ void TQtSqlCachedResultPrivate::cleanup() if (forwardOnly) delete current; current = 0; - forwardOnly = FALSE; + forwardOnly = false; colCount = 0; rowCacheEnd = 0; } @@ -108,11 +108,11 @@ TQtSqlCachedResult::RowCache *TQtSqlCachedResultPrivate::next() bool TQtSqlCachedResultPrivate::seek(int i) { if (forwardOnly || i < 0) - return FALSE; + return false; if (i >= rowCacheEnd) - return FALSE; + return false; current = (*cache)[i]; - return TRUE; + return true; } void TQtSqlCachedResultPrivate::revertLast() @@ -144,40 +144,40 @@ void TQtSqlCachedResult::init(int colCount) bool TQtSqlCachedResult::fetch(int i) { if ((!isActive()) || (i < 0)) - return FALSE; + return false; if (at() == i) - return TRUE; + return true; if (d->forwardOnly) { // speed hack - do not copy values if not needed if (at() > i || at() == TQSql::AfterLast) - return FALSE; + return false; while(at() < i - 1) { if (!gotoNext(0)) - return FALSE; + return false; setAt(at() + 1); } if (!gotoNext(d->current)) - return FALSE; + return false; setAt(at() + 1); - return TRUE; + return true; } if (d->seek(i)) { setAt(i); - return TRUE; + return true; } setAt(d->rowCacheEnd - 1); while (at() < i) { if (!cacheNext()) - return FALSE; + return false; } - return TRUE; + return true; } bool TQtSqlCachedResult::fetchNext() { if (d->seek(at() + 1)) { setAt(at() + 1); - return TRUE; + return true; } return cacheNext(); } @@ -190,11 +190,11 @@ bool TQtSqlCachedResult::fetchPrev() bool TQtSqlCachedResult::fetchFirst() { if (d->forwardOnly && at() != TQSql::BeforeFirst) { - return FALSE; + return false; } if (d->seek(0)) { setAt(0); - return TRUE; + return true; } return cacheNext(); } @@ -203,7 +203,7 @@ bool TQtSqlCachedResult::fetchLast() { if (at() == TQSql::AfterLast) { if (d->forwardOnly) - return FALSE; + return false; else return fetch(d->rowCacheEnd - 1); } @@ -213,7 +213,7 @@ bool TQtSqlCachedResult::fetchLast() i++; /* brute force */ if (d->forwardOnly && at() == TQSql::AfterLast) { setAt(i); - return TRUE; + return true; } else { return fetch(d->rowCacheEnd - 1); } @@ -230,7 +230,7 @@ TQVariant TQtSqlCachedResult::data(int i) bool TQtSqlCachedResult::isNull(int i) { if (!d->current || i >= (int)d->current->size() || i < 0) - return TRUE; + return true; return (*d->current)[i].isNull(); } @@ -238,7 +238,7 @@ bool TQtSqlCachedResult::isNull(int i) void TQtSqlCachedResult::cleanup() { setAt(TQSql::BeforeFirst); - setActive(FALSE); + setActive(false); d->cleanup(); } @@ -246,10 +246,10 @@ bool TQtSqlCachedResult::cacheNext() { if (!gotoNext(d->next())) { d->revertLast(); - return FALSE; + return false; } setAt(at() + 1); - return TRUE; + return true; } int TQtSqlCachedResult::colCount() const diff --git a/src/sql/drivers/ibase/tqsql_ibase.cpp b/src/sql/drivers/ibase/tqsql_ibase.cpp index 425d0e311..f7e29999d 100644 --- a/src/sql/drivers/ibase/tqsql_ibase.cpp +++ b/src/sql/drivers/ibase/tqsql_ibase.cpp @@ -46,13 +46,13 @@ public: static bool getIBaseError(TQString& msg, ISC_STATUS* status, long &sqlcode) { if (status[0] != 1 || status[1] <= 0) - return FALSE; + return false; sqlcode = isc_sqlcode(status); char buf[512]; isc_sql_interprete(sqlcode, buf, 512); msg = TQString::fromUtf8(buf); - return TRUE; + return true; } static void createDA(XSQLDA *&sqlda) @@ -227,10 +227,10 @@ public: TQString imsg; long sqlcode; if (!getIBaseError(imsg, status, sqlcode)) - return FALSE; + return false; q->setLastError(TQSqlError(msg, imsg, typ, (int)sqlcode)); - return TRUE; + return true; } public: @@ -252,10 +252,10 @@ public: TQString imsg; long sqlcode; if (!getIBaseError(imsg, status, sqlcode)) - return FALSE; + return false; q->setLastError(TQSqlError(msg, imsg, typ, (int)sqlcode)); - return TRUE; + return true; } bool transaction(); @@ -356,7 +356,7 @@ bool TQIBaseResultPrivate::isSelect() char qType = isc_info_sql_stmt_type; isc_dsql_sql_info(status, &stmt, 1, &qType, sizeof(acBuffer), acBuffer); if (isError("Could not get query info", TQSqlError::Statement)) - return FALSE; + return false; int iLength = isc_vax_integer(&acBuffer[1], 2); queryType = isc_vax_integer(&acBuffer[3], iLength); return (queryType == isc_info_sql_stmt_select); @@ -365,19 +365,19 @@ bool TQIBaseResultPrivate::isSelect() bool TQIBaseResultPrivate::transaction() { if (trans) - return TRUE; + return true; if (db->d->trans) { - localTransaction = FALSE; + localTransaction = false; trans = db->d->trans; - return TRUE; + return true; } - localTransaction = TRUE; + localTransaction = true; isc_start_transaction(status, &trans, 1, &ibase, 0, NULL); if (isError("Could not start transaction", TQSqlError::Statement)) - return FALSE; + return false; - return TRUE; + return true; } // does nothing if the transaction is on the @@ -385,10 +385,10 @@ bool TQIBaseResultPrivate::transaction() bool TQIBaseResultPrivate::commit() { if (!trans) - return FALSE; + return false; // don't commit driver's transaction, the driver will do it for us if (!localTransaction) - return TRUE; + return true; isc_commit_transaction(status, &trans); trans = 0; @@ -413,33 +413,33 @@ bool TQIBaseResult::prepare(const TQString& query) { //tqDebug("prepare: %s", query.ascii()); if (!driver() || !driver()->isOpen() || driver()->isOpenError()) - return FALSE; + return false; d->cleanup(); - setActive(FALSE); + setActive(false); setAt(TQSql::BeforeFirst); createDA(d->sqlda); createDA(d->inda); if (!d->transaction()) - return FALSE; + return false; isc_dsql_allocate_statement(d->status, &d->ibase, &d->stmt); if (d->isError("Could not allocate statement", TQSqlError::Statement)) - return FALSE; + return false; isc_dsql_prepare(d->status, &d->trans, &d->stmt, 0, query.utf8().data(), 3, d->sqlda); if (d->isError("Could not prepare statement", TQSqlError::Statement)) - return FALSE; + return false; isc_dsql_describe_bind(d->status, &d->stmt, 1, d->inda); if (d->isError("Could not describe input statement", TQSqlError::Statement)) - return FALSE; + return false; if (d->inda->sqld > d->inda->sqln) { enlargeDA(d->inda, d->inda->sqld); isc_dsql_describe_bind(d->status, &d->stmt, 1, d->inda); if (d->isError("Could not describe input statement", TQSqlError::Statement)) - return FALSE; + return false; } initDA(d->inda); if (d->sqlda->sqld > d->sqlda->sqln) { @@ -448,7 +448,7 @@ bool TQIBaseResult::prepare(const TQString& query) isc_dsql_describe(d->status, &d->stmt, 1, d->sqlda); if (d->isError("Could not describe statement", TQSqlError::Statement)) - return FALSE; + return false; } initDA(d->sqlda); @@ -458,21 +458,21 @@ bool TQIBaseResult::prepare(const TQString& query) d->sqlda = 0; } - return TRUE; + return true; } bool TQIBaseResult::exec() { if (!driver() || !driver()->isOpen() || driver()->isOpenError()) - return FALSE; - setActive(FALSE); + return false; + setActive(false); setAt(TQSql::BeforeFirst); if (d->inda && extension()->index.count() > 0) { TQMap<int, TQString>::ConstIterator it; if ((int)extension()->index.count() > d->inda->sqld) { tqWarning("TQIBaseResult::exec: Parameter mismatch, expected %d, got %d parameters", d->inda->sqld, extension()->index.count()); - return FALSE; + return false; } int para = 0; for (it = extension()->index.constBegin(); it != extension()->index.constEnd(); ++it, ++para) { @@ -530,7 +530,7 @@ bool TQIBaseResult::exec() memcpy(d->inda->sqlvar[para].sqldata + sizeof(short), str.data(), buflen); break; } case SQL_TEXT: { - TQCString str(val.toString().utf8().leftJustify(d->inda->sqlvar[para].sqllen, ' ', TRUE)); + TQCString str(val.toString().utf8().leftJustify(d->inda->sqlvar[para].sqllen, ' ', true)); memcpy(d->inda->sqlvar[para].sqldata, str.data(), d->inda->sqlvar[para].sqllen); break; } case SQL_BLOB: @@ -545,39 +545,39 @@ bool TQIBaseResult::exec() if (colCount()) { isc_dsql_free_statement(d->status, &d->stmt, DSQL_close); if (d->isError("Unable to close statement")) - return FALSE; + return false; cleanup(); } if (d->sqlda) init(d->sqlda->sqld); isc_dsql_execute2(d->status, &d->trans, &d->stmt, 1, d->inda, 0); if (d->isError("Unable to execute query")) - return FALSE; + return false; - setActive(TRUE); - return TRUE; + setActive(true); + return true; } bool TQIBaseResult::reset (const TQString& query) { // tqDebug("reset: %s", query.ascii()); if (!driver() || !driver()->isOpen() || driver()->isOpenError()) - return FALSE; + return false; d->cleanup(); - setActive(FALSE); + setActive(false); setAt(TQSql::BeforeFirst); createDA(d->sqlda); if (!d->transaction()) - return FALSE; + return false; isc_dsql_allocate_statement(d->status, &d->ibase, &d->stmt); if (d->isError("Could not allocate statement", TQSqlError::Statement)) - return FALSE; + return false; isc_dsql_prepare(d->status, &d->trans, &d->stmt, 0, query.utf8().data(), 3, d->sqlda); if (d->isError("Could not prepare statement", TQSqlError::Statement)) - return FALSE; + return false; if (d->sqlda->sqld > d->sqlda->sqln) { // need more field descriptors @@ -589,7 +589,7 @@ bool TQIBaseResult::reset (const TQString& query) isc_dsql_describe(d->status, &d->stmt, 1, d->sqlda); if (d->isError("Could not describe statement", TQSqlError::Statement)) - return FALSE; + return false; } initDA(d->sqlda); @@ -604,14 +604,14 @@ bool TQIBaseResult::reset (const TQString& query) isc_dsql_execute(d->status, &d->trans, &d->stmt, 1, 0); if (d->isError("Unable to execute query")) - return FALSE; + return false; // commit non-select queries (if they are local) if (!isSelect() && !d->commit()) - return FALSE; + return false; - setActive(TRUE); - return TRUE; + setActive(true); + return true; } bool TQIBaseResult::gotoNext(TQtSqlCachedResult::RowCache* row) @@ -621,12 +621,12 @@ bool TQIBaseResult::gotoNext(TQtSqlCachedResult::RowCache* row) if (stat == 100) { // no more rows setAt(TQSql::AfterLast); - return FALSE; + return false; } if (d->isError("Could not fetch next item", TQSqlError::Statement)) - return FALSE; + return false; if (!row) // not interested in actual values - return TRUE; + return true; Q_ASSERT(row); Q_ASSERT((int)row->size() == d->sqlda->sqld); @@ -691,7 +691,7 @@ bool TQIBaseResult::gotoNext(TQtSqlCachedResult::RowCache* row) } } - return TRUE; + return true; } int TQIBaseResult::size() @@ -768,8 +768,8 @@ TQIBaseDriver::TQIBaseDriver(void *connection, TQObject *parent, const char *nam { d = new TQIBaseDriverPrivate(this); d->ibase = (isc_db_handle)(long int)connection; - setOpen(TRUE); - setOpenError(FALSE); + setOpen(true); + setOpenError(false); } TQIBaseDriver::~TQIBaseDriver() @@ -786,9 +786,9 @@ bool TQIBaseDriver::hasFeature(DriverFeature f) const case PositionalPlaceholders: case Unicode: case BLOB: - return TRUE; + return true; default: - return FALSE; + return false; } } @@ -830,12 +830,12 @@ bool TQIBaseDriver::open(const TQString & db, ldb += db; isc_attach_database(d->status, 0, (char*)ldb.latin1(), &d->ibase, i, ba.data()); if (d->isError("Error opening database", TQSqlError::Connection)) { - setOpenError(TRUE); - return FALSE; + setOpenError(true); + return false; } - setOpen(TRUE); - return TRUE; + setOpen(true); + return true; } void TQIBaseDriver::close() @@ -843,20 +843,20 @@ void TQIBaseDriver::close() if (isOpen()) { isc_detach_database(d->status, &d->ibase); d->ibase = 0; - setOpen(FALSE); - setOpenError(FALSE); + setOpen(false); + setOpenError(false); } } bool TQIBaseDriver::ping() { if ( !isOpen() ) { - return FALSE; + return false; } // FIXME // Implement ping if available - return TRUE; + return true; } TQSqlQuery TQIBaseDriver::createQuery() const @@ -867,9 +867,9 @@ TQSqlQuery TQIBaseDriver::createQuery() const bool TQIBaseDriver::beginTransaction() { if (!isOpen() || isOpenError()) - return FALSE; + return false; if (d->trans) - return FALSE; + return false; isc_start_transaction(d->status, &d->trans, 1, &d->ibase, 0, NULL); return !d->isError("Could not start transaction", TQSqlError::Transaction); @@ -878,9 +878,9 @@ bool TQIBaseDriver::beginTransaction() bool TQIBaseDriver::commitTransaction() { if (!isOpen() || isOpenError()) - return FALSE; + return false; if (!d->trans) - return FALSE; + return false; isc_commit_transaction(d->status, &d->trans); d->trans = 0; @@ -890,9 +890,9 @@ bool TQIBaseDriver::commitTransaction() bool TQIBaseDriver::rollbackTransaction() { if (!isOpen() || isOpenError()) - return FALSE; + return false; if (!d->trans) - return FALSE; + return false; isc_rollback_transaction(d->status, &d->trans); d->trans = 0; @@ -926,7 +926,7 @@ TQStringList TQIBaseDriver::tables(const TQString& typeName) const typeFilter.prepend("where "); TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); if (!q.exec("select rdb$relation_name from rdb$relations " + typeFilter)) return res; while(q.next()) @@ -942,7 +942,7 @@ TQSqlRecord TQIBaseDriver::record(const TQString& tablename) const return rec; TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); q.exec("SELECT a.RDB$FIELD_NAME, b.RDB$FIELD_TYPE " "FROM RDB$RELATION_FIELDS a, RDB$FIELDS b " @@ -964,7 +964,7 @@ TQSqlRecordInfo TQIBaseDriver::recordInfo(const TQString& tablename) const return rec; TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); q.exec("SELECT a.RDB$FIELD_NAME, b.RDB$FIELD_TYPE, b.RDB$FIELD_LENGTH, b.RDB$FIELD_SCALE, " "b.RDB$FIELD_PRECISION, a.RDB$NULL_FLAG " @@ -991,7 +991,7 @@ TQSqlIndex TQIBaseDriver::primaryIndex(const TQString &table) const return index; TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); q.exec("SELECT a.RDB$INDEX_NAME, b.RDB$FIELD_NAME, d.RDB$FIELD_TYPE " "FROM RDB$RELATION_CONSTRAINTS a, RDB$INDEX_SEGMENTS b, RDB$RELATION_FIELDS c, RDB$FIELDS d " "WHERE a.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY' " @@ -1060,7 +1060,7 @@ TQString TQIBaseDriver::formatValue(const TQSqlField* field, bool trimStrings) c TQString::number(datetime.time().hour()) + ":" + TQString::number(datetime.time().minute()) + ":" + TQString::number(datetime.time().second()) + "." + - TQString::number(datetime.time().msec()).rightJustify(3, '0', TRUE) + "'"; + TQString::number(datetime.time().msec()).rightJustify(3, '0', true) + "'"; else return "NULL"; } @@ -1070,7 +1070,7 @@ TQString TQIBaseDriver::formatValue(const TQSqlField* field, bool trimStrings) c return "'" + TQString::number(time.hour()) + ":" + TQString::number(time.minute()) + ":" + TQString::number(time.second()) + "." + - TQString::number(time.msec()).rightJustify(3, '0', TRUE) + "'"; + TQString::number(time.msec()).rightJustify(3, '0', true) + "'"; else return "NULL"; } diff --git a/src/sql/drivers/mysql/tqsql_mysql.cpp b/src/sql/drivers/mysql/tqsql_mysql.cpp index 603a5b960..47e3c6ff0 100644 --- a/src/sql/drivers/mysql/tqsql_mysql.cpp +++ b/src/sql/drivers/mysql/tqsql_mysql.cpp @@ -56,7 +56,7 @@ TQPtrDict<TQSqlOpenExtension> *tqSqlOpenExtDict(); static int qMySqlConnectionCount = 0; -static bool qMySqlInitHandledByUser = FALSE; +static bool qMySqlInitHandledByUser = false; class TQMYSQLOpenExtension : public TQSqlOpenExtension { @@ -181,7 +181,7 @@ void TQMYSQLResult::cleanup() d->result = NULL; d->row = NULL; setAt( -1 ); - setActive( FALSE ); + setActive( false ); } bool TQMYSQLResult::fetch( int i ) @@ -192,26 +192,26 @@ bool TQMYSQLResult::fetch( int i ) while ( --x && fetchNext() ); return fetchNext(); } else { - return FALSE; + return false; } } if ( at() == i ) - return TRUE; + return true; mysql_data_seek( d->result, i ); d->row = mysql_fetch_row( d->result ); if ( !d->row ) - return FALSE; + return false; setAt( i ); - return TRUE; + return true; } bool TQMYSQLResult::fetchNext() { d->row = mysql_fetch_row( d->result ); if ( !d->row ) - return FALSE; + return false; setAt( at() + 1 ); - return TRUE; + return true; } bool TQMYSQLResult::fetchLast() @@ -223,7 +223,7 @@ bool TQMYSQLResult::fetchLast() } my_ulonglong numRows = mysql_num_rows( d->result ); if ( !numRows ) - return FALSE; + return false; return fetch( numRows - 1 ); } @@ -292,22 +292,22 @@ TQVariant TQMYSQLResult::data( int field ) bool TQMYSQLResult::isNull( int field ) { if ( d->row[field] == NULL ) - return TRUE; - return FALSE; + return true; + return false; } bool TQMYSQLResult::reset ( const TQString& query ) { if ( !driver() ) - return FALSE; + return false; if ( !driver()-> isOpen() || driver()->isOpenError() ) - return FALSE; + return false; cleanup(); const char *encQuery = query.ascii(); if ( mysql_real_query( d->mysql, encQuery, tqstrlen(encQuery) ) ) { setLastError( qMakeError("Unable to execute query", TQSqlError::Statement, d ) ); - return FALSE; + return false; } if ( isForwardOnly() ) { if ( isActive() || isValid() ) // have to empty the results from previous query @@ -318,7 +318,7 @@ bool TQMYSQLResult::reset ( const TQString& query ) } if ( !d->result && mysql_field_count( d->mysql ) > 0 ) { setLastError( qMakeError( "Unable to store result", TQSqlError::Statement, d ) ); - return FALSE; + return false; } int numFields = mysql_field_count( d->mysql ); setSelect( !( numFields == 0) ); @@ -332,8 +332,8 @@ bool TQMYSQLResult::reset ( const TQString& query ) d->fieldTypes[i] = qDecodeMYSQLType( field->type, field->flags ); } } - setActive( TRUE ); - return TRUE; + setActive( true ); + return true; } int TQMYSQLResult::size() @@ -403,10 +403,10 @@ TQMYSQLDriver::TQMYSQLDriver( MYSQL * con, TQObject * parent, const char * name init(); if ( con ) { d->mysql = (MYSQL *) con; - setOpen( TRUE ); - setOpenError( FALSE ); + setOpen( true ); + setOpenError( false ); if (qMySqlConnectionCount == 1) - qMySqlInitHandledByUser = TRUE; + qMySqlInitHandledByUser = true; } else { qServerInit(); } @@ -441,18 +441,18 @@ bool TQMYSQLDriver::hasFeature( DriverFeature f ) const #ifdef CLIENT_TRANSACTIONS if ( d->mysql ) { if ( ( d->mysql->server_capabilities & CLIENT_TRANSACTIONS ) == CLIENT_TRANSACTIONS ) - return TRUE; + return true; } #endif - return FALSE; + return false; case QuerySize: - return TRUE; + return true; case BLOB: - return TRUE; + return true; case Unicode: - return FALSE; + return false; default: - return FALSE; + return false; } } @@ -463,7 +463,7 @@ bool TQMYSQLDriver::open( const TQString&, int ) { tqWarning("TQMYSQLDriver::open(): This version of open() is no longer supported." ); - return FALSE; + return false; } bool TQMYSQLDriver::open( const TQString& db, @@ -513,8 +513,8 @@ bool TQMYSQLDriver::open( const TQString& db, if (!(d->mysql = mysql_init((MYSQL*) 0))) { setLastError( qMakeError( "Unable to connect", TQSqlError::Connection, d ) ); mysql_close( d->mysql ); - setOpenError( TRUE ); - return FALSE; + setOpenError( true ); + return false; } bool reconnect = 0; @@ -563,41 +563,41 @@ bool TQMYSQLDriver::open( const TQString& db, if ( !db.isEmpty() && mysql_select_db( d->mysql, db )) { setLastError( qMakeError("Unable open database '" + db + "'", TQSqlError::Connection, d ) ); mysql_close( d->mysql ); - setOpenError( TRUE ); - return FALSE; + setOpenError( true ); + return false; } } else { setLastError( qMakeError( "Unable to connect", TQSqlError::Connection, d ) ); mysql_close( d->mysql ); - setOpenError( TRUE ); - return FALSE; + setOpenError( true ); + return false; } - setOpen( TRUE ); - setOpenError( FALSE ); - return TRUE; + setOpen( true ); + setOpenError( false ); + return true; } void TQMYSQLDriver::close() { if ( isOpen() ) { mysql_close( d->mysql ); - setOpen( FALSE ); - setOpenError( FALSE ); + setOpen( false ); + setOpenError( false ); } } bool TQMYSQLDriver::ping() { if ( !isOpen() ) { - return FALSE; + return false; } if (mysql_ping( d->mysql )) { - return TRUE; + return true; } else { setLastError( qMakeError("Unable to execute ping", TQSqlError::Statement, d ) ); - return FALSE; + return false; } } @@ -617,7 +617,7 @@ TQStringList TQMYSQLDriver::tables( const TQString& typeName ) const MYSQL_RES* tableRes = mysql_list_tables( d->mysql, NULL ); MYSQL_ROW row; int i = 0; - while ( tableRes && TRUE ) { + while ( tableRes ) { mysql_data_seek( tableRes, i ); row = mysql_fetch_row( tableRes ); if ( !row ) @@ -749,55 +749,55 @@ MYSQL* TQMYSQLDriver::mysql() bool TQMYSQLDriver::beginTransaction() { #ifndef CLIENT_TRANSACTIONS - return FALSE; + return false; #endif if ( !isOpen() ) { #ifdef QT_CHECK_RANGE tqWarning( "TQMYSQLDriver::beginTransaction: Database not open" ); #endif - return FALSE; + return false; } if ( mysql_query( d->mysql, "BEGIN WORK" ) ) { setLastError( qMakeError("Unable to begin transaction", TQSqlError::Statement, d ) ); - return FALSE; + return false; } - return TRUE; + return true; } bool TQMYSQLDriver::commitTransaction() { #ifndef CLIENT_TRANSACTIONS - return FALSE; + return false; #endif if ( !isOpen() ) { #ifdef QT_CHECK_RANGE tqWarning( "TQMYSQLDriver::commitTransaction: Database not open" ); #endif - return FALSE; + return false; } if ( mysql_query( d->mysql, "COMMIT" ) ) { setLastError( qMakeError("Unable to commit transaction", TQSqlError::Statement, d ) ); - return FALSE; + return false; } - return TRUE; + return true; } bool TQMYSQLDriver::rollbackTransaction() { #ifndef CLIENT_TRANSACTIONS - return FALSE; + return false; #endif if ( !isOpen() ) { #ifdef QT_CHECK_RANGE tqWarning( "TQMYSQLDriver::rollbackTransaction: Database not open" ); #endif - return FALSE; + return false; } if ( mysql_query( d->mysql, "ROLLBACK" ) ) { setLastError( qMakeError("Unable to rollback transaction", TQSqlError::Statement, d ) ); - return FALSE; + return false; } - return TRUE; + return true; } TQString TQMYSQLDriver::formatValue( const TQSqlField* field, bool trimStrings ) const diff --git a/src/sql/drivers/odbc/tqsql_odbc.cpp b/src/sql/drivers/odbc/tqsql_odbc.cpp index 3da2dd50c..bc09fb28b 100644 --- a/src/sql/drivers/odbc/tqsql_odbc.cpp +++ b/src/sql/drivers/odbc/tqsql_odbc.cpp @@ -81,10 +81,10 @@ class TQODBCPrivate { public: TQODBCPrivate() - : hEnv(0), hDbc(0), hStmt(0), useSchema(FALSE) + : hEnv(0), hDbc(0), hStmt(0), useSchema(false) { sql_char_type = sql_varchar_type = sql_longvarchar_type = TQVariant::CString; - unicode = FALSE; + unicode = false; } SQLHANDLE hEnv; @@ -258,7 +258,7 @@ static TQVariant::Type qDecodeODBCType( SQLSMALLINT sqltype, const TQODBCPrivate return type; } -static TQString qGetStringData( SQLHANDLE hStmt, int column, int colSize, bool& isNull, bool unicode = FALSE ) +static TQString qGetStringData( SQLHANDLE hStmt, int column, int colSize, bool& isNull, bool unicode = false ) { TQString fieldVal; SQLRETURN r = SQL_ERROR; @@ -275,7 +275,7 @@ static TQString qGetStringData( SQLHANDLE hStmt, int column, int colSize, bool& } } char* buf = new char[ colSize ]; - while ( TRUE ) { + while ( true ) { r = SQLGetData( hStmt, column+1, unicode ? SQL_C_WCHAR : SQL_C_CHAR, @@ -285,7 +285,7 @@ static TQString qGetStringData( SQLHANDLE hStmt, int column, int colSize, bool& if ( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO ) { if ( lengthIndicator == SQL_NULL_DATA || lengthIndicator == SQL_NO_TOTAL ) { fieldVal = TQString::null; - isNull = TRUE; + isNull = true; break; } // if SQL_SUCCESS_WITH_INFO is returned, indicating that @@ -350,7 +350,7 @@ static TQByteArray qGetBinaryData( SQLHANDLE hStmt, int column, TQSQLLEN& length colSize = 65536; } char * buf = new char[ colSize ]; - while ( TRUE ) { + while ( true ) { r = SQLGetData( hStmt, column+1, SQL_C_BINARY, @@ -359,7 +359,7 @@ static TQByteArray qGetBinaryData( SQLHANDLE hStmt, int column, TQSQLLEN& length &lengthIndicator ); if ( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO ) { if ( lengthIndicator == SQL_NULL_DATA ) { - isNull = TRUE; + isNull = true; break; } else { int rSize; @@ -391,7 +391,7 @@ static TQByteArray qGetBinaryData( SQLHANDLE hStmt, int column, TQSQLLEN& length static int qGetIntData( SQLHANDLE hStmt, int column, bool& isNull ) { TQSQLLEN intbuf = 0; - isNull = FALSE; + isNull = false; TQSQLLEN lengthIndicator = 0; SQLRETURN r = SQLGetData( hStmt, column+1, @@ -400,7 +400,7 @@ static int qGetIntData( SQLHANDLE hStmt, int column, bool& isNull ) (TQSQLLEN)0, &lengthIndicator ); if ( ( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO ) || lengthIndicator == SQL_NULL_DATA ) { - isNull = TRUE; + isNull = true; return 0; } return (int)intbuf; @@ -410,7 +410,7 @@ static double qGetDoubleData( SQLHANDLE hStmt, int column, bool& isNull ) { SQLDOUBLE dblbuf; TQSQLLEN lengthIndicator = 0; - isNull = FALSE; + isNull = false; SQLRETURN r = SQLGetData( hStmt, column+1, SQL_C_DOUBLE, @@ -418,7 +418,7 @@ static double qGetDoubleData( SQLHANDLE hStmt, int column, bool& isNull ) (TQSQLLEN)0, &lengthIndicator ); if ( ( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO ) || lengthIndicator == SQL_NULL_DATA ) { - isNull = TRUE; + isNull = true; return 0.0; } @@ -428,7 +428,7 @@ static double qGetDoubleData( SQLHANDLE hStmt, int column, bool& isNull ) static SQLBIGINT qGetBigIntData( SQLHANDLE hStmt, int column, bool& isNull ) { SQLBIGINT lngbuf = TQ_INT64_C( 0 ); - isNull = FALSE; + isNull = false; TQSQLLEN lengthIndicator = 0; SQLRETURN r = SQLGetData( hStmt, column+1, @@ -437,7 +437,7 @@ static SQLBIGINT qGetBigIntData( SQLHANDLE hStmt, int column, bool& isNull ) (TQSQLLEN)0, &lengthIndicator ); if ( ( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO ) || lengthIndicator == SQL_NULL_DATA ) - isNull = TRUE; + isNull = true; return lngbuf; } @@ -600,11 +600,11 @@ bool TQODBCPrivate::setConnectionOptions( const TQString& connOpts ) #ifdef QT_CHECK_RANGE qSqlWarning( TQString("TQODBCDriver::open: Unable to set connection attribute '%1'").arg( opt ), this ); #endif - return FALSE; + return false; } } } - return TRUE; + return true; } void TQODBCPrivate::splitTableQualifier(const TQString & qualifier, TQString &catalog, @@ -614,7 +614,7 @@ void TQODBCPrivate::splitTableQualifier(const TQString & qualifier, TQString &ca table = qualifier; return; } - TQStringList l = TQStringList::split( ".", qualifier, TRUE ); + TQStringList l = TQStringList::split( ".", qualifier, true ); if ( l.count() > 3 ) return; // can't possibly be a valid table qualifier int i = 0, n = l.count(); @@ -667,7 +667,7 @@ TQODBCResult::~TQODBCResult() bool TQODBCResult::reset ( const TQString& query ) { - setActive( FALSE ); + setActive( false ); setAt( TQSql::BeforeFirst ); SQLRETURN r; @@ -680,7 +680,7 @@ bool TQODBCResult::reset ( const TQString& query ) #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCResult::reset: Unable to free statement handle", d ); #endif - return FALSE; + return false; } } r = SQLAllocHandle( SQL_HANDLE_STMT, @@ -690,7 +690,7 @@ bool TQODBCResult::reset ( const TQString& query ) #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCResult::reset: Unable to allocate statement handle", d ); #endif - return FALSE; + return false; } if ( isForwardOnly() ) { @@ -708,7 +708,7 @@ bool TQODBCResult::reset ( const TQString& query ) #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration", d ); #endif - return FALSE; + return false; } #ifdef UNICODE @@ -723,38 +723,38 @@ bool TQODBCResult::reset ( const TQString& query ) #endif if ( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO ) { setLastError( qMakeError( "Unable to execute statement", TQSqlError::Statement, d ) ); - return FALSE; + return false; } SQLSMALLINT count; r = SQLNumResultCols( d->hStmt, &count ); if ( count ) { - setSelect( TRUE ); + setSelect( true ); for ( int i = 0; i < count; ++i ) { d->rInf.append( qMakeFieldInfo( d, i ) ); } } else { - setSelect( FALSE ); + setSelect( false ); } - setActive( TRUE ); - return TRUE; + setActive( true ); + return true; } bool TQODBCResult::fetch(int i) { if ( isForwardOnly() && i < at() ) - return FALSE; + return false; if ( i == at() ) - return TRUE; + return true; fieldCache.clear(); nullCache.clear(); int actualIdx = i + 1; if ( actualIdx <= 0 ) { setAt( TQSql::BeforeFirst ); - return FALSE; + return false; } SQLRETURN r; if ( isForwardOnly() ) { - bool ok = TRUE; + bool ok = true; while ( ok && i > at() ) ok = fetchNext(); return ok; @@ -764,10 +764,10 @@ bool TQODBCResult::fetch(int i) actualIdx ); } if ( r != SQL_SUCCESS ){ - return FALSE; + return false; } setAt( i ); - return TRUE; + return true; } bool TQODBCResult::fetchNext() @@ -779,15 +779,15 @@ bool TQODBCResult::fetchNext() SQL_FETCH_NEXT, 0 ); if ( r != SQL_SUCCESS ) - return FALSE; + return false; setAt( at() + 1 ); - return TRUE; + return true; } bool TQODBCResult::fetchFirst() { if ( isForwardOnly() && at() != TQSql::BeforeFirst ) - return FALSE; + return false; SQLRETURN r; fieldCache.clear(); nullCache.clear(); @@ -798,15 +798,15 @@ bool TQODBCResult::fetchFirst() SQL_FETCH_FIRST, 0 ); if ( r != SQL_SUCCESS ) - return FALSE; + return false; setAt( 0 ); - return TRUE; + return true; } bool TQODBCResult::fetchPrior() { if ( isForwardOnly() ) - return FALSE; + return false; SQLRETURN r; fieldCache.clear(); nullCache.clear(); @@ -814,9 +814,9 @@ bool TQODBCResult::fetchPrior() SQL_FETCH_PRIOR, 0 ); if ( r != SQL_SUCCESS ) - return FALSE; + return false; setAt( at() - 1 ); - return TRUE; + return true; } bool TQODBCResult::fetchLast() @@ -829,20 +829,20 @@ bool TQODBCResult::fetchLast() // cannot seek to last row in forwardOnly mode, so we have to use brute force int i = at(); if ( i == TQSql::AfterLast ) - return FALSE; + return false; if ( i == TQSql::BeforeFirst ) i = 0; while ( fetchNext() ) ++i; setAt( i ); - return TRUE; + return true; } r = SQLFetchScroll( d->hStmt, SQL_FETCH_LAST, 0 ); if ( r != SQL_SUCCESS ) { - return FALSE; + return false; } SQLINTEGER currRow; r = SQLGetStmtAttr( d->hStmt, @@ -851,9 +851,9 @@ bool TQODBCResult::fetchLast() SQL_IS_INTEGER, 0 ); if ( r != SQL_SUCCESS ) - return FALSE; + return false; setAt( currRow-1 ); - return TRUE; + return true; } TQVariant TQODBCResult::data( int field ) @@ -866,7 +866,7 @@ TQVariant TQODBCResult::data( int field ) return fieldCache[ field ]; SQLRETURN r(0); TQSQLLEN lengthIndicator = 0; - bool isNull = FALSE; + bool isNull = false; int current = fieldCache.count(); for ( ; current < (field + 1); ++current ) { const TQSqlFieldInfo info = d->rInf[ current ]; @@ -889,10 +889,10 @@ TQVariant TQODBCResult::data( int field ) &lengthIndicator ); if ( ( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO ) && ( lengthIndicator != SQL_NULL_DATA ) ) { fieldCache[ current ] = TQVariant( TQDate( dbuf.year, dbuf.month, dbuf.day ) ); - nullCache[ current ] = FALSE; + nullCache[ current ] = false; } else { fieldCache[ current ] = TQVariant( TQDate() ); - nullCache[ current ] = TRUE; + nullCache[ current ] = true; } break; case TQVariant::Time: @@ -905,10 +905,10 @@ TQVariant TQODBCResult::data( int field ) &lengthIndicator ); if ( ( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO ) && ( lengthIndicator != SQL_NULL_DATA ) ) { fieldCache[ current ] = TQVariant( TQTime( tbuf.hour, tbuf.minute, tbuf.second ) ); - nullCache[ current ] = FALSE; + nullCache[ current ] = false; } else { fieldCache[ current ] = TQVariant( TQTime() ); - nullCache[ current ] = TRUE; + nullCache[ current ] = true; } break; case TQVariant::DateTime: @@ -921,38 +921,38 @@ TQVariant TQODBCResult::data( int field ) &lengthIndicator ); if ( ( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO ) && ( lengthIndicator != SQL_NULL_DATA ) ) { fieldCache[ current ] = TQVariant( TQDateTime( TQDate( dtbuf.year, dtbuf.month, dtbuf.day ), TQTime( dtbuf.hour, dtbuf.minute, dtbuf.second, dtbuf.fraction / 1000000 ) ) ); - nullCache[ current ] = FALSE; + nullCache[ current ] = false; } else { fieldCache[ current ] = TQVariant( TQDateTime() ); - nullCache[ current ] = TRUE; + nullCache[ current ] = true; } break; case TQVariant::ByteArray: { - isNull = FALSE; + isNull = false; TQByteArray val = qGetBinaryData( d->hStmt, current, lengthIndicator, isNull ); fieldCache[ current ] = TQVariant( val ); nullCache[ current ] = isNull; break; } case TQVariant::String: - isNull = FALSE; + isNull = false; fieldCache[ current ] = TQVariant( qGetStringData( d->hStmt, current, - info.length(), isNull, TRUE ) ); + info.length(), isNull, true ) ); nullCache[ current ] = isNull; break; case TQVariant::Double: if ( info.typeID() == SQL_DECIMAL || info.typeID() == SQL_NUMERIC ) // bind Double values as string to prevent loss of precision fieldCache[ current ] = TQVariant( qGetStringData( d->hStmt, current, - info.length() + 1, isNull, FALSE ) ); // length + 1 for the comma + info.length() + 1, isNull, false ) ); // length + 1 for the comma else fieldCache[ current ] = TQVariant( qGetDoubleData( d->hStmt, current, isNull ) ); nullCache[ current ] = isNull; break; case TQVariant::CString: default: - isNull = FALSE; + isNull = false; fieldCache[ current ] = TQVariant( qGetStringData( d->hStmt, current, - info.length(), isNull, FALSE ) ); + info.length(), isNull, false ) ); nullCache[ current ] = isNull; break; } @@ -991,7 +991,7 @@ int TQODBCResult::numRowsAffected() bool TQODBCResult::prepare( const TQString& query ) { - setActive( FALSE ); + setActive( false ); setAt( TQSql::BeforeFirst ); SQLRETURN r; @@ -1002,7 +1002,7 @@ bool TQODBCResult::prepare( const TQString& query ) #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCResult::prepare: Unable to close statement", d ); #endif - return FALSE; + return false; } } r = SQLAllocHandle( SQL_HANDLE_STMT, @@ -1012,7 +1012,7 @@ bool TQODBCResult::prepare( const TQString& query ) #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCResult::prepare: Unable to allocate statement handle", d ); #endif - return FALSE; + return false; } if ( isForwardOnly() ) { @@ -1030,7 +1030,7 @@ bool TQODBCResult::prepare( const TQString& query ) #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCResult::prepare: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration", d ); #endif - return FALSE; + return false; } #ifdef UNICODE @@ -1048,18 +1048,18 @@ bool TQODBCResult::prepare( const TQString& query ) #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCResult::prepare: Unable to prepare statement", d ); #endif - return FALSE; + return false; } - return TRUE; + return true; } bool TQODBCResult::exec() { SQLRETURN r; TQPtrList<TQVirtualDestructor> tmpStorage; // holds temporary ptrs. which will be deleted on fu exit - tmpStorage.setAutoDelete( TRUE ); + tmpStorage.setAutoDelete( true ); - setActive( FALSE ); + setActive( false ); setAt( TQSql::BeforeFirst ); d->rInf.clear(); @@ -1067,12 +1067,12 @@ bool TQODBCResult::exec() #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCResult::exec: No statement handle available", d ); #endif - return FALSE; + return false; } else { r = SQLFreeStmt( d->hStmt, SQL_CLOSE ); if ( r != SQL_SUCCESS ) { qSqlWarning( "TQODBCResult::exec: Unable to close statement handle", d ); - return FALSE; + return false; } } @@ -1232,7 +1232,7 @@ bool TQODBCResult::exec() tqWarning( "TQODBCResult::exec: unable to bind variable: %s", qODBCWarn( d ).local8Bit().data() ); #endif setLastError( qMakeError( "Unable to bind variable", TQSqlError::Statement, d ) ); - return FALSE; + return false; } } } @@ -1242,19 +1242,19 @@ bool TQODBCResult::exec() tqWarning( "TQODBCResult::exec: Unable to execute statement: %s", qODBCWarn( d ).local8Bit().data() ); #endif setLastError( qMakeError( "Unable to execute statement", TQSqlError::Statement, d ) ); - return FALSE; + return false; } SQLSMALLINT count; r = SQLNumResultCols( d->hStmt, &count ); if ( count ) { - setSelect( TRUE ); + setSelect( true ); for ( int i = 0; i < count; ++i ) { d->rInf.append( qMakeFieldInfo( d, i ) ); } } else { - setSelect( FALSE ); + setSelect( false ); } - setActive( TRUE ); + setActive( true ); //get out parameters if ( extension()->index.count() > 0 ) { @@ -1263,7 +1263,7 @@ bool TQODBCResult::exec() SQLINTEGER* indPtr = qAutoDeleterData( (TQAutoDeleter<SQLINTEGER>*)tmpStorage.getFirst() ); if ( !indPtr ) - return FALSE; + return false; bool isNull = (*indPtr == SQL_NULL_DATA); tmpStorage.removeFirst(); @@ -1318,7 +1318,7 @@ bool TQODBCResult::exec() } } - return TRUE; + return true; } //////////////////////////////////////// @@ -1337,8 +1337,8 @@ TQODBCDriver::TQODBCDriver( SQLHANDLE env, SQLHANDLE con, TQObject * parent, con d->hEnv = env; d->hDbc = con; if ( env && con ) { - setOpen( TRUE ); - setOpenError( FALSE ); + setOpen( true ); + setOpenError( false ); } } @@ -1363,7 +1363,7 @@ bool TQODBCDriver::hasFeature( DriverFeature f ) const switch ( f ) { case Transactions: { if ( !d->hDbc ) - return FALSE; + return false; SQLUSMALLINT txn; SQLSMALLINT t; int r = SQLGetInfo( d->hDbc, @@ -1372,22 +1372,22 @@ bool TQODBCDriver::hasFeature( DriverFeature f ) const sizeof(txn), &t); if ( r != SQL_SUCCESS || txn == SQL_TC_NONE ) - return FALSE; + return false; else - return TRUE; + return true; } case QuerySize: - return FALSE; + return false; case BLOB: - return TRUE; + return true; case Unicode: return d->unicode; case PreparedQueries: - return TRUE; + return true; case PositionalPlaceholders: - return TRUE; + return true; default: - return FALSE; + return false; } } @@ -1398,7 +1398,7 @@ bool TQODBCDriver::open( const TQString&, int ) { tqWarning("TQODBCDriver::open(): This version of open() is no longer supported." ); - return FALSE; + return false; } bool TQODBCDriver::open( const TQString & db, @@ -1418,8 +1418,8 @@ bool TQODBCDriver::open( const TQString & db, #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCDriver::open: Unable to allocate environment", d ); #endif - setOpenError( TRUE ); - return FALSE; + setOpenError( true ); + return false; } r = SQLSetEnvAttr( d->hEnv, SQL_ATTR_ODBC_VERSION, @@ -1432,12 +1432,12 @@ bool TQODBCDriver::open( const TQString & db, #ifdef QT_CHECK_RANGE qSqlWarning( "TQODBCDriver::open: Unable to allocate connection", d ); #endif - setOpenError( TRUE ); - return FALSE; + setOpenError( true ); + return false; } if ( !d->setConnectionOptions( connOpts ) ) - return FALSE; + return false; // Create the connection string TQString connTQStr; @@ -1465,36 +1465,36 @@ bool TQODBCDriver::open( const TQString & db, SQL_DRIVER_NOPROMPT ); if ( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO ) { setLastError( qMakeError( "Unable to connect", TQSqlError::Connection, d ) ); - setOpenError( TRUE ); - return FALSE; + setOpenError( true ); + return false; } if ( !d->checkDriver() ) { setLastError( qMakeError( "Unable to connect - Driver doesn't support all needed functionality", TQSqlError::Connection, d ) ); - setOpenError( TRUE ); - return FALSE; + setOpenError( true ); + return false; } d->checkUnicode(); d->checkSchemaUsage(); - setOpen( TRUE ); - setOpenError( FALSE ); - return TRUE; + setOpen( true ); + setOpenError( false ); + return true; } void TQODBCDriver::close() { cleanup(); - setOpen( FALSE ); - setOpenError( FALSE ); + setOpen( false ); + setOpenError( false ); } bool TQODBCDriver::ping() { // FIXME // Implement ping if supported - return TRUE; + return true; } void TQODBCDriver::cleanup() @@ -1537,14 +1537,14 @@ void TQODBCPrivate::checkUnicode() { #if defined(TQ_WS_WIN) if ( !qt_winunicode ) { - unicode = FALSE; + unicode = false; return; } #endif SQLRETURN r; SQLUINTEGER fFunc; - unicode = FALSE; + unicode = false; r = SQLGetInfo( hDbc, SQL_CONVERT_CHAR, (SQLPOINTER)&fFunc, @@ -1552,7 +1552,7 @@ void TQODBCPrivate::checkUnicode() NULL ); if ( ( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO ) && ( fFunc & SQL_CVT_WCHAR ) ) { sql_char_type = TQVariant::String; - unicode = TRUE; + unicode = true; } r = SQLGetInfo( hDbc, @@ -1562,7 +1562,7 @@ void TQODBCPrivate::checkUnicode() NULL ); if ( ( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO ) && ( fFunc & SQL_CVT_WVARCHAR ) ) { sql_varchar_type = TQVariant::String; - unicode = TRUE; + unicode = true; } r = SQLGetInfo( hDbc, @@ -1572,7 +1572,7 @@ void TQODBCPrivate::checkUnicode() NULL ); if ( ( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO ) && ( fFunc & SQL_CVT_WLONGVARCHAR ) ) { sql_longvarchar_type = TQVariant::String; - unicode = TRUE; + unicode = true; } } @@ -1604,7 +1604,7 @@ bool TQODBCPrivate::checkDriver() const #ifdef QT_CHECK_RANGE if ( r != SQL_SUCCESS ) { qSqlWarning( "TQODBCDriver::checkDriver: Cannot get list of supported functions", this ); - return FALSE; + return false; } #endif if ( sup == SQL_FALSE ) { @@ -1612,7 +1612,7 @@ bool TQODBCPrivate::checkDriver() const tqWarning ( "TQODBCDriver::open: Warning - Driver doesn't support all needed functionality (%d). " "Please look at the TQt SQL Module Driver documentation for more information.", reqFunc[ i ] ); #endif - return FALSE; + return false; } } @@ -1624,19 +1624,19 @@ bool TQODBCPrivate::checkDriver() const #ifdef QT_CHECK_RANGE if ( r != SQL_SUCCESS ) { qSqlWarning( "TQODBCDriver::checkDriver: Cannot get list of supported functions", this ); - return FALSE; + return false; } #endif if ( sup == SQL_FALSE ) { #ifdef QT_CHECK_RANGE tqWarning( "TQODBCDriver::checkDriver: Warning - Driver doesn't support some non-critical functions (%d)", optFunc[ i ] ); #endif - return TRUE; + return true; } } #endif //ODBC_CHECK_DRIVER - return TRUE; + return true; } void TQODBCPrivate::checkSchemaUsage() @@ -1664,7 +1664,7 @@ bool TQODBCDriver::beginTransaction() #ifdef QT_CHECK_RANGE tqWarning(" TQODBCDriver::beginTransaction: Database not open" ); #endif - return FALSE; + return false; } SQLUINTEGER ac(SQL_AUTOCOMMIT_OFF); SQLRETURN r = SQLSetConnectAttr( d->hDbc, @@ -1673,9 +1673,9 @@ bool TQODBCDriver::beginTransaction() sizeof(ac) ); if ( r != SQL_SUCCESS ) { setLastError( qMakeError( "Unable to disable autocommit", TQSqlError::Transaction, d ) ); - return FALSE; + return false; } - return TRUE; + return true; } bool TQODBCDriver::commitTransaction() @@ -1684,14 +1684,14 @@ bool TQODBCDriver::commitTransaction() #ifdef QT_CHECK_RANGE tqWarning(" TQODBCDriver::commitTransaction: Database not open" ); #endif - return FALSE; + return false; } SQLRETURN r = SQLEndTran( SQL_HANDLE_DBC, d->hDbc, SQL_COMMIT ); if ( r != SQL_SUCCESS ) { setLastError( qMakeError("Unable to commit transaction", TQSqlError::Transaction, d ) ); - return FALSE; + return false; } return endTrans(); } @@ -1702,14 +1702,14 @@ bool TQODBCDriver::rollbackTransaction() #ifdef QT_CHECK_RANGE tqWarning(" TQODBCDriver::rollbackTransaction: Database not open" ); #endif - return FALSE; + return false; } SQLRETURN r = SQLEndTran( SQL_HANDLE_DBC, d->hDbc, SQL_ROLLBACK ); if ( r != SQL_SUCCESS ) { setLastError( qMakeError( "Unable to rollback transaction", TQSqlError::Transaction, d ) ); - return FALSE; + return false; } return endTrans(); } @@ -1723,9 +1723,9 @@ bool TQODBCDriver::endTrans() sizeof(ac)); if ( r != SQL_SUCCESS ) { setLastError( qMakeError( "Unable to enable autocommit", TQSqlError::Transaction, d ) ); - return FALSE; + return false; } - return TRUE; + return true; } TQStringList TQODBCDriver::tables( const TQString& typeName ) const @@ -1801,7 +1801,7 @@ TQSqlIndex TQODBCDriver::primaryIndex( const TQString& tablename ) const TQSqlIndex index( tablename ); if ( !isOpen() ) return index; - bool usingSpecialColumns = FALSE; + bool usingSpecialColumns = false; TQSqlRecord rec = record( tablename ); SQLHANDLE hStmt; @@ -1873,7 +1873,7 @@ TQSqlIndex TQODBCDriver::primaryIndex( const TQString& tablename ) const qSqlWarning( "TQODBCDriver::primaryIndex: Unable to execute primary key list", d ); #endif } else { - usingSpecialColumns = TRUE; + usingSpecialColumns = true; } } r = SQLFetchScroll( hStmt, @@ -2018,8 +2018,8 @@ TQString TQODBCDriver::formatValue( const TQSqlField* field, // Dateformat has to be "yyyy-MM-dd hh:mm:ss", with leading zeroes if month or day < 10 r = "{ ts '" + TQString::number(dt.year()) + "-" + - TQString::number(dt.month()).rightJustify( 2, '0', TRUE ) + "-" + - TQString::number(dt.day()).rightJustify( 2, '0', TRUE ) + " " + + TQString::number(dt.month()).rightJustify( 2, '0', true ) + "-" + + TQString::number(dt.day()).rightJustify( 2, '0', true ) + " " + tm.toString() + "' }"; } else diff --git a/src/sql/drivers/psql/tqsql_psql.cpp b/src/sql/drivers/psql/tqsql_psql.cpp index df79ac2fd..625177c7b 100644 --- a/src/sql/drivers/psql/tqsql_psql.cpp +++ b/src/sql/drivers/psql/tqsql_psql.cpp @@ -70,7 +70,7 @@ TQPtrDict<TQSqlOpenExtension> *tqSqlOpenExtDict(); class TQPSQLPrivate { public: - TQPSQLPrivate():connection(0), result(0), isUtf8(FALSE) {} + TQPSQLPrivate():connection(0), result(0), isUtf8(false) {} PGconn *connection; PGresult *result; bool isUtf8; @@ -231,21 +231,21 @@ void TQPSQLResult::cleanup() d->result = 0; setAt( -1 ); currentSize = 0; - setActive( FALSE ); + setActive( false ); } bool TQPSQLResult::fetch( int i ) { if ( !isActive() ) - return FALSE; + return false; if ( i < 0 ) - return FALSE; + return false; if ( i >= currentSize ) - return FALSE; + return false; if ( at() == i ) - return TRUE; + return true; setAt( i ); - return TRUE; + return true; } bool TQPSQLResult::fetchFirst() @@ -460,10 +460,10 @@ bool TQPSQLResult::reset ( const TQString& query ) { cleanup(); if ( !driver() ) - return FALSE; + return false; if ( !driver()->isOpen() || driver()->isOpenError() ) - return FALSE; - setActive( FALSE ); + return false; + setActive( false ); setAt( TQSql::BeforeFirst ); if ( d->result ) PQclear( d->result ); @@ -475,17 +475,17 @@ bool TQPSQLResult::reset ( const TQString& query ) int status = PQresultStatus( d->result ); if ( status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK ) { if ( status == PGRES_TUPLES_OK ) { - setSelect( TRUE ); + setSelect( true ); currentSize = PQntuples( d->result ); } else { - setSelect( FALSE ); + setSelect( false ); currentSize = -1; } - setActive( TRUE ); - return TRUE; + setActive( true ); + return true; } setLastError( qMakeError( "Unable to create query", TQSqlError::Statement, d ) ); - return FALSE; + return false; } int TQPSQLResult::size() @@ -527,7 +527,7 @@ static TQPSQLDriver::Protocol getPSQLVersion( PGconn* connection ) TQString val( PQgetvalue( result, 0, 0 ) ); PQclear( result ); TQRegExp rx( "(\\d+)\\.(\\d+)" ); - rx.setMinimal ( TRUE ); // enforce non-greedy RegExp + rx.setMinimal ( true ); // enforce non-greedy RegExp if ( rx.search( val ) != -1 ) { int vMaj = rx.cap( 1 ).toInt(); int vMin = rx.cap( 2 ).toInt(); @@ -569,8 +569,8 @@ TQPSQLDriver::TQPSQLDriver( PGconn * conn, TQObject * parent, const char * name d->connection = conn; if ( conn ) { pro = getPSQLVersion( d->connection ); - setOpen( TRUE ); - setOpenError( FALSE ); + setOpen( true ); + setOpenError( false ); } } @@ -607,15 +607,15 @@ bool TQPSQLDriver::hasFeature( DriverFeature f ) const { switch ( f ) { case Transactions: - return TRUE; + return true; case QuerySize: - return TRUE; + return true; case BLOB: return pro >= TQPSQLDriver::Version71; case Unicode: return d->isUtf8; default: - return FALSE; + return false; } } @@ -626,7 +626,7 @@ bool TQPSQLDriver::open( const TQString&, int ) { tqWarning("TQPSQLDriver::open(): This version of open() is no longer supported." ); - return FALSE; + return false; } bool TQPSQLDriver::open( const TQString & db, @@ -657,17 +657,17 @@ bool TQPSQLDriver::open( const TQString & db, d->connection = PQconnectdb( connectString.local8Bit().data() ); if ( PQstatus( d->connection ) == CONNECTION_BAD ) { setLastError( qMakeError("Unable to connect", TQSqlError::Connection, d ) ); - setOpenError( TRUE ); - return FALSE; + setOpenError( true ); + return false; } pro = getPSQLVersion( d->connection ); d->isUtf8 = setEncodingUtf8( d->connection ); setDatestyle( d->connection ); - setOpen( TRUE ); - setOpenError( FALSE ); - return TRUE; + setOpen( true ); + setOpenError( false ); + return true; } void TQPSQLDriver::close() @@ -676,15 +676,15 @@ void TQPSQLDriver::close() if (d->connection) PQfinish( d->connection ); d->connection = 0; - setOpen( FALSE ); - setOpenError( FALSE ); + setOpen( false ); + setOpenError( false ); } } bool TQPSQLDriver::ping() { if ( !isOpen() ) { - return FALSE; + return false; } PGresult *res = NULL; @@ -698,10 +698,10 @@ bool TQPSQLDriver::ping() PQreset( d->connection ); if ( PQstatus( d->connection ) != CONNECTION_OK ) { setLastError( qMakeError("Unable to execute ping", TQSqlError::Statement, d ) ); - return FALSE; + return false; } } - return TRUE; + return true; } TQSqlQuery TQPSQLDriver::createQuery() const @@ -715,16 +715,16 @@ bool TQPSQLDriver::beginTransaction() #ifdef QT_CHECK_RANGE tqWarning( "TQPSQLDriver::beginTransaction: Database not open" ); #endif - return FALSE; + return false; } PGresult* res = PQexec( d->connection, "BEGIN" ); if ( !res || PQresultStatus( res ) != PGRES_COMMAND_OK ) { PQclear( res ); setLastError( qMakeError( "Could not begin transaction", TQSqlError::Transaction, d ) ); - return FALSE; + return false; } PQclear( res ); - return TRUE; + return true; } bool TQPSQLDriver::commitTransaction() @@ -733,16 +733,16 @@ bool TQPSQLDriver::commitTransaction() #ifdef QT_CHECK_RANGE tqWarning( "TQPSQLDriver::commitTransaction: Database not open" ); #endif - return FALSE; + return false; } PGresult* res = PQexec( d->connection, "COMMIT" ); if ( !res || PQresultStatus( res ) != PGRES_COMMAND_OK ) { PQclear( res ); setLastError( qMakeError( "Could not commit transaction", TQSqlError::Transaction, d ) ); - return FALSE; + return false; } PQclear( res ); - return TRUE; + return true; } bool TQPSQLDriver::rollbackTransaction() @@ -751,16 +751,16 @@ bool TQPSQLDriver::rollbackTransaction() #ifdef QT_CHECK_RANGE tqWarning( "TQPSQLDriver::rollbackTransaction: Database not open" ); #endif - return FALSE; + return false; } PGresult* res = PQexec( d->connection, "ROLLBACK" ); if ( !res || PQresultStatus( res ) != PGRES_COMMAND_OK ) { setLastError( qMakeError( "Could not rollback transaction", TQSqlError::Transaction, d ) ); PQclear( res ); - return FALSE; + return false; } PQclear( res ); - return TRUE; + return true; } TQStringList TQPSQLDriver::tables( const TQString& typeName ) const @@ -770,7 +770,7 @@ TQStringList TQPSQLDriver::tables( const TQString& typeName ) const return tl; int type = typeName.toInt(); TQSqlQuery t = createQuery(); - t.setForwardOnly( TRUE ); + t.setForwardOnly( true ); if ( typeName.isEmpty() || ((type & (int)TQSql::Tables) == (int)TQSql::Tables) ) { @@ -1127,7 +1127,7 @@ TQString TQPSQLDriver::formatValue( const TQSqlField* field, r += uc; } else { r += "\\\\"; - r += TQString::number( (unsigned char) ba[ i ], 8 ).rightJustify( 3, '0', TRUE ); + r += TQString::number( (unsigned char) ba[ i ], 8 ).rightJustify( 3, '0', true ); } } r += "'"; diff --git a/src/sql/drivers/sqlite/tqsql_sqlite.cpp b/src/sql/drivers/sqlite/tqsql_sqlite.cpp index de7fde7e2..a0e78db91 100644 --- a/src/sql/drivers/sqlite/tqsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/tqsql_sqlite.cpp @@ -82,7 +82,7 @@ public: static const uint initial_cache_size = 128; TQSQLiteResultPrivate::TQSQLiteResultPrivate(TQSQLiteResult* res) : q(res), access(0), currentTail(0), - currentMachine(0), skippedStatus(FALSE), skipRow(0), utf8(FALSE) + currentMachine(0), skippedStatus(false), skipRow(0), utf8(false) { } @@ -92,11 +92,11 @@ void TQSQLiteResultPrivate::cleanup() rInf.clear(); currentTail = 0; currentMachine = 0; - skippedStatus = FALSE; + skippedStatus = false; delete skipRow; skipRow = 0; q->setAt(TQSql::BeforeFirst); - q->setActive(FALSE); + q->setActive(false); q->cleanup(); } @@ -155,7 +155,7 @@ bool TQSQLiteResultPrivate::fetchNext(TQtSqlCachedResult::RowCache* row) } if (!currentMachine) - return FALSE; + return false; // keep trying while busy, wish I could implement this better. while ((res = sqlite_step(currentMachine, &colNum, &fvals, &cnames)) == SQLITE_BUSY) { @@ -174,27 +174,27 @@ bool TQSQLiteResultPrivate::fetchNext(TQtSqlCachedResult::RowCache* row) // must be first call. init(cnames, colNum, &row); if (!fvals) - return FALSE; + return false; if (!row) - return TRUE; + return true; for (i = 0; i < colNum; ++i) (*row)[i] = utf8 ? TQString::fromUtf8(fvals[i]) : TQString(fvals[i]); - return TRUE; + return true; case SQLITE_DONE: if (rInf.isEmpty()) // must be first call. init(cnames, colNum); q->setAt(TQSql::AfterLast); - return FALSE; + return false; case SQLITE_ERROR: case SQLITE_MISUSE: default: // something wrong, don't get col info, but still return false finalize(); // finalize to get the error message. q->setAt(TQSql::AfterLast); - return FALSE; + return false; } - return FALSE; + return false; } TQSQLiteResult::TQSQLiteResult(const TQSQLiteDriver* db) @@ -218,14 +218,14 @@ bool TQSQLiteResult::reset (const TQString& query) { // this is where we build a query. if (!driver()) - return FALSE; + return false; if (!driver()-> isOpen() || driver()->isOpenError()) - return FALSE; + return false; d->cleanup(); // Um, ok. callback based so.... pass private static function for this. - setSelect(FALSE); + setSelect(false); char *err = 0; int res = sqlite_compile(d->access, d->utf8 ? (const char*)query.utf8().data() : query.ascii(), @@ -238,8 +238,8 @@ bool TQSQLiteResult::reset (const TQString& query) } //if (*d->currentTail != '\000' then there is more sql to eval if (!d->currentMachine) { - setActive(FALSE); - return FALSE; + setActive(false); + return false; } // we have to fetch one row to find out about // the structure of the result set @@ -247,8 +247,8 @@ bool TQSQLiteResult::reset (const TQString& query) setSelect(!d->rInf.isEmpty()); if (isSelect()) init(d->rInf.count()); - setActive(TRUE); - return TRUE; + setActive(true); + return true; } bool TQSQLiteResult::gotoNext(TQtSqlCachedResult::RowCache* row) @@ -279,8 +279,8 @@ TQSQLiteDriver::TQSQLiteDriver(sqlite *connection, TQObject *parent, const char { d = new TQSQLiteDriverPrivate(); d->access = connection; - setOpen(TRUE); - setOpenError(FALSE); + setOpen(true); + setOpenError(false); } @@ -293,14 +293,14 @@ bool TQSQLiteDriver::hasFeature(DriverFeature f) const { switch (f) { case Transactions: - return TRUE; + return true; #if (TQT_VERSION-0 >= 0x030000) case Unicode: return d->utf8; #endif // case BLOB: default: - return FALSE; + return false; } } @@ -314,7 +314,7 @@ bool TQSQLiteDriver::open(const TQString & db, const TQString &, const TQString close(); if (db.isEmpty()) - return FALSE; + return false; char* err = 0; d->access = sqlite_open(TQFile::encodeName(db), 0, &err); @@ -325,12 +325,12 @@ bool TQSQLiteDriver::open(const TQString & db, const TQString &, const TQString } if (d->access) { - setOpen(TRUE); - setOpenError(FALSE); - return TRUE; + setOpen(true); + setOpenError(false); + return true; } - setOpenError(TRUE); - return FALSE; + setOpenError(true); + return false; } void TQSQLiteDriver::close() @@ -338,20 +338,20 @@ void TQSQLiteDriver::close() if (isOpen()) { sqlite_close(d->access); d->access = 0; - setOpen(FALSE); - setOpenError(FALSE); + setOpen(false); + setOpenError(false); } } bool TQSQLiteDriver::ping() { if ( !isOpen() ) { - return FALSE; + return false; } // FIXME // Implement ping if available - return TRUE; + return true; } TQSqlQuery TQSQLiteDriver::createQuery() const @@ -362,49 +362,49 @@ TQSqlQuery TQSQLiteDriver::createQuery() const bool TQSQLiteDriver::beginTransaction() { if (!isOpen() || isOpenError()) - return FALSE; + return false; char* err; int res = sqlite_exec(d->access, "BEGIN", 0, this, &err); if (res == SQLITE_OK) - return TRUE; + return true; setLastError(TQSqlError("Unable to begin transaction", err, TQSqlError::Transaction, res)); sqlite_freemem(err); - return FALSE; + return false; } bool TQSQLiteDriver::commitTransaction() { if (!isOpen() || isOpenError()) - return FALSE; + return false; char* err; int res = sqlite_exec(d->access, "COMMIT", 0, this, &err); if (res == SQLITE_OK) - return TRUE; + return true; setLastError(TQSqlError("Unable to commit transaction", err, TQSqlError::Transaction, res)); sqlite_freemem(err); - return FALSE; + return false; } bool TQSQLiteDriver::rollbackTransaction() { if (!isOpen() || isOpenError()) - return FALSE; + return false; char* err; int res = sqlite_exec(d->access, "ROLLBACK", 0, this, &err); if (res == SQLITE_OK) - return TRUE; + return true; setLastError(TQSqlError("Unable to rollback Transaction", err, TQSqlError::Transaction, res)); sqlite_freemem(err); - return FALSE; + return false; } TQStringList TQSQLiteDriver::tables(const TQString &typeName) const @@ -415,7 +415,7 @@ TQStringList TQSQLiteDriver::tables(const TQString &typeName) const int type = typeName.toInt(); TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); #if (TQT_VERSION-0 >= 0x030000) if ((type & (int)TQSql::Tables) && (type & (int)TQSql::Views)) q.exec("SELECT name FROM sqlite_master WHERE type='table' OR type='view'"); @@ -451,7 +451,7 @@ TQSqlIndex TQSQLiteDriver::primaryIndex(const TQString &tblname) const return TQSqlIndex(); TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); // finrst find a UNIQUE INDEX q.exec("PRAGMA index_list('" + tblname + "');"); TQString indexname; @@ -483,7 +483,7 @@ TQSqlRecordInfo TQSQLiteDriver::recordInfo(const TQString &tbl) const return TQSqlRecordInfo(); TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); q.exec("SELECT * FROM " + tbl + " LIMIT 1"); return recordInfo(q); } diff --git a/src/sql/drivers/sqlite3/tqsql_sqlite3.cpp b/src/sql/drivers/sqlite3/tqsql_sqlite3.cpp index f75feaa1b..a3ce63e35 100644 --- a/src/sql/drivers/sqlite3/tqsql_sqlite3.cpp +++ b/src/sql/drivers/sqlite3/tqsql_sqlite3.cpp @@ -331,12 +331,12 @@ void TQSQLite3Driver::close() bool TQSQLite3Driver::ping() { if ( !isOpen() ) { - return FALSE; + return false; } // FIXME // Implement ping if available - return TRUE; + return true; } TQSqlQuery TQSQLite3Driver::createQuery() const @@ -397,7 +397,7 @@ TQStringList TQSQLite3Driver::tables(const TQString &typeName) const int type = typeName.toInt(); TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); #if (TQT_VERSION-0 >= 0x030200) if ((type & (int)TQSql::Tables) && (type & (int)TQSql::Views)) q.exec("SELECT name FROM sqlite_master WHERE type='table' OR type='view'"); @@ -433,7 +433,7 @@ TQSqlIndex TQSQLite3Driver::primaryIndex(const TQString &tblname) const return TQSqlIndex(); TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); // finrst find a UNIQUE INDEX q.exec("PRAGMA index_list('" + tblname + "');"); TQString indexname; @@ -465,7 +465,7 @@ TQSqlRecordInfo TQSQLite3Driver::recordInfo(const TQString &tbl) const return TQSqlRecordInfo(); TQSqlQuery q = createQuery(); - q.setForwardOnly(TRUE); + q.setForwardOnly(true); q.exec("SELECT * FROM " + tbl + " LIMIT 1"); return recordInfo(q); } diff --git a/src/sql/tqdatabrowser.cpp b/src/sql/tqdatabrowser.cpp index a716d8832..b1921204e 100644 --- a/src/sql/tqdatabrowser.cpp +++ b/src/sql/tqdatabrowser.cpp @@ -49,7 +49,7 @@ class TQDataBrowserPrivate { public: - TQDataBrowserPrivate() : boundaryCheck( TRUE ), readOnly( FALSE ) {} + TQDataBrowserPrivate() : boundaryCheck( true ), readOnly( false ) {} TQSqlCursorManager cur; TQSqlFormManager frm; TQDataManager dat; @@ -310,7 +310,7 @@ TQString TQDataBrowser::filter() const /*! Sets the default cursor used by the data browser to \a cursor. If - \a autoDelete is TRUE (the default is FALSE), the data browser + \a autoDelete is true (the default is false), the data browser takes ownership of the \a cursor pointer, which will be deleted when the browser is destroyed, or when setSqlCursor() is called again. To activate the \a cursor use refresh(). The cursor's edit @@ -326,7 +326,7 @@ void TQDataBrowser::setSqlCursor( TQSqlCursor* cursor, bool autoDelete ) d->cur.setCursor( cursor, autoDelete ); d->frm.setRecord( cursor->editBuffer() ); if ( cursor->isReadOnly() ) - setReadOnly( TRUE ); + setReadOnly( true ); } @@ -369,7 +369,7 @@ TQSqlForm* TQDataBrowser::form() \property TQDataBrowser::readOnly \brief whether the browser is read-only - The default is FALSE, i.e. data can be edited. If the data browser + The default is false, i.e. data can be edited. If the data browser is read-only, no database edits will be allowed. */ @@ -392,7 +392,7 @@ void TQDataBrowser::setConfirmEdits( bool confirm ) \property TQDataBrowser::confirmInsert \brief whether the data browser confirms insertions - If this property is TRUE, the browser confirms insertions, + If this property is true, the browser confirms insertions, otherwise insertions happen immediately. \sa confirmCancels() confirmEdits() confirmUpdate() confirmDelete() confirmEdit() @@ -407,7 +407,7 @@ void TQDataBrowser::setConfirmInsert( bool confirm ) \property TQDataBrowser::confirmUpdate \brief whether the browser confirms updates - If this property is TRUE, the browser confirms updates, otherwise + If this property is true, the browser confirms updates, otherwise updates happen immediately. \sa confirmCancels() confirmEdits() confirmInsert() confirmDelete() confirmEdit() @@ -422,7 +422,7 @@ void TQDataBrowser::setConfirmUpdate( bool confirm ) \property TQDataBrowser::confirmDelete \brief whether the browser confirms deletions - If this property is TRUE, the browser confirms deletions, + If this property is true, the browser confirms deletions, otherwise deletions happen immediately. \sa confirmCancels() confirmEdits() confirmUpdate() confirmInsert() confirmEdit() @@ -437,7 +437,7 @@ void TQDataBrowser::setConfirmDelete( bool confirm ) \property TQDataBrowser::confirmEdits \brief whether the browser confirms edits - If this property is TRUE, the browser confirms all edit operations + If this property is true, the browser confirms all edit operations (insertions, updates and deletions), otherwise all edit operations happen immediately. Confirmation is achieved by presenting the user with a message box -- this behavior can be changed by @@ -470,10 +470,10 @@ bool TQDataBrowser::confirmDelete() const \property TQDataBrowser::confirmCancels \brief whether the browser confirms cancel operations - If this property is TRUE, all cancels must be confirmed by the + If this 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. + occur immediately. The default is false. \sa confirmEdits() confirmCancel() */ @@ -492,13 +492,13 @@ bool TQDataBrowser::confirmCancels() const \property TQDataBrowser::autoEdit \brief whether the browser 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 insertion or an update on a form there are two possible outcomes when they navigate to another record: \list - \i the insert or update is is performed -- this occurs if autoEdit is TRUE - \i the insert or update is discarded -- 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 discarded -- this occurs if autoEdit is false \endlist */ @@ -657,7 +657,7 @@ void TQDataBrowser::insert() TQSqlCursor* cur = d->cur.cursor(); if ( !buf || !cur ) return; - bool doIns = TRUE; + bool doIns = true; TQSql::Confirm conf = TQSql::Yes; switch ( d->dat.mode() ) { case TQSql::Insert: @@ -671,7 +671,7 @@ void TQDataBrowser::insert() case TQSql::No: break; case TQSql::Cancel: - doIns = FALSE; + doIns = false; break; } } @@ -687,7 +687,7 @@ void TQDataBrowser::insert() case TQSql::No: break; case TQSql::Cancel: - doIns = FALSE; + doIns = false; break; } } @@ -733,7 +733,7 @@ void TQDataBrowser::update() break; case TQSql::No: d->dat.setMode( TQSql::Update ); - cur->editBuffer( TRUE ); + cur->editBuffer( true ); readFields(); break; case TQSql::Cancel: @@ -782,7 +782,7 @@ void TQDataBrowser::del() if ( confirmCancels() ) conf = confirmCancel( TQSql::Insert ); if ( conf == TQSql::Yes ) { - cur->editBuffer( TRUE ); /* restore from cursor */ + cur->editBuffer( true ); /* restore from cursor */ readFields(); d->dat.setMode( TQSql::Update ); } else @@ -809,7 +809,7 @@ void TQDataBrowser::del() Moves the default cursor to the record specified by the index \a i and refreshes the default form to display this record. If there is no default form or no default cursor, nothing happens. If \a - relative is TRUE (the default is FALSE), the cursor is moved + relative is true (the default is false), the cursor is moved relative to its current position. If the data browser successfully navigated to the desired record, the default cursor is primed for update and the primeUpdate() signal is emitted. @@ -823,7 +823,7 @@ bool TQDataBrowser::seek( int i, bool relative ) int b = 0; TQSqlCursor* cur = d->cur.cursor(); if ( !cur ) - return FALSE; + return false; if ( preNav() ) b = cur->seek( i, relative ); postNav( b ); @@ -940,9 +940,9 @@ void TQDataBrowser::clearValues() performs an insert on the default cursor. If there is no default form or no default cursor, nothing happens. If an error occurred during the insert into the database, handleError() is called and - FALSE is returned. If the insert was successfull, the cursor is + false is returned. If the insert was successfull, the cursor is refreshed and relocated to the newly inserted record, the - cursorChanged() signal is emitted, and TRUE is returned. + cursorChanged() signal is emitted, and true is returned. \sa cursorChanged() sqlCursor() form() handleError() */ @@ -950,11 +950,11 @@ void TQDataBrowser::clearValues() bool TQDataBrowser::insertCurrent() { if ( isReadOnly() ) - return FALSE; + return false; TQSqlRecord* buf = d->frm.record(); TQSqlCursor* cur = d->cur.cursor(); if ( !buf || !cur ) - return FALSE; + return false; writeFields(); emit beforeInsert( buf ); int ar = cur->insert(); @@ -967,9 +967,9 @@ bool TQDataBrowser::insertCurrent() d->cur.findBuffer( cur->primaryIndex() ); updateBoundary(); cursorChanged( TQSqlCursor::Insert ); - return TRUE; + return true; } - return FALSE; + return false; } @@ -978,9 +978,9 @@ bool TQDataBrowser::insertCurrent() performs an update on the default cursor. If there is no default form or no default cursor, nothing happens. If an error occurred during the update on the database, handleError() is called and - FALSE is returned. If the update was successfull, the cursor is + false is returned. If the update was successfull, the cursor is refreshed and relocated to the updated record, the cursorChanged() - signal is emitted, and TRUE is returned. + signal is emitted, and true is returned. \sa cursor() form() handleError() */ @@ -988,11 +988,11 @@ bool TQDataBrowser::insertCurrent() bool TQDataBrowser::updateCurrent() { if ( isReadOnly() ) - return FALSE; + return false; TQSqlRecord* buf = d->frm.record(); TQSqlCursor* cur = d->cur.cursor(); if ( !buf || !cur ) - return FALSE; + return false; writeFields(); emit beforeUpdate( buf ); int ar = cur->update(); @@ -1004,12 +1004,12 @@ bool TQDataBrowser::updateCurrent() refresh(); d->cur.findBuffer( cur->primaryIndex() ); updateBoundary(); - cur->editBuffer( TRUE ); + cur->editBuffer( true ); cursorChanged( TQSqlCursor::Update ); readFields(); - return TRUE; + return true; } - return FALSE; + return false; } @@ -1018,10 +1018,10 @@ bool TQDataBrowser::updateCurrent() default form and updates the default form. If there is no default form or no default cursor, nothing happens. If the deletion was successful, the cursor is repositioned to the nearest record and - TRUE is returned. The nearest record is the next record if there + true is returned. The nearest record is the next record if there is one otherwise the previous record if there is one. If an error occurred during the deletion from the database, handleError() is - called and FALSE is returned. + called and false is returned. \sa cursor() form() handleError() */ @@ -1029,11 +1029,11 @@ bool TQDataBrowser::updateCurrent() bool TQDataBrowser::deleteCurrent() { if ( isReadOnly() ) - return FALSE; + return false; TQSqlRecord* buf = d->frm.record(); TQSqlCursor* cur = d->cur.cursor(); if ( !buf || !cur ) - return FALSE; + return false; writeFields(); int n = cur->at(); emit beforeDelete( buf ); @@ -1045,12 +1045,12 @@ bool TQDataBrowser::deleteCurrent() if ( !cur->seek( n ) ) last(); if ( cur->isValid() ) { - cur->editBuffer( TRUE ); + cur->editBuffer( true ); readFields(); } else { clearValues(); } - return TRUE; + return true; } else { if ( !cur->isActive() ) { handleError( cur->lastError() ); @@ -1058,13 +1058,13 @@ bool TQDataBrowser::deleteCurrent() updateBoundary(); } } - return FALSE; + return false; } /*! - Returns TRUE if the form's edit buffer differs from the current - cursor buffer; otherwise returns FALSE. + Returns true if the form's edit buffer differs from the current + cursor buffer; otherwise returns false. */ bool TQDataBrowser::currentEdited() @@ -1072,15 +1072,15 @@ bool TQDataBrowser::currentEdited() TQSqlRecord* buf = d->frm.record(); TQSqlCursor* cur = d->cur.cursor(); if ( !buf || !cur ) - return FALSE; + return false; if ( !cur->isActive() || !cur->isValid() ) - return FALSE; + return false; writeFields(); for ( uint i = 0; i < cur->count(); ++i ) { if ( cur->value(i) != buf->value(i) ) - return TRUE; + return true; } - return FALSE; + return false; } /*! \internal @@ -1093,10 +1093,10 @@ bool TQDataBrowser::preNav() TQSqlRecord* buf = d->frm.record(); TQSqlCursor* cur = d->cur.cursor(); if ( !buf || !cur ) - return FALSE; + return false; if ( !isReadOnly() && autoEdit() && currentEdited() ) { - bool ok = TRUE; + bool ok = true; TQSql::Confirm conf = TQSql::Yes; switch ( d->dat.mode() ){ case TQSql::Insert: @@ -1111,7 +1111,7 @@ bool TQDataBrowser::preNav() d->dat.setMode( TQSql::Update ); break; case TQSql::Cancel: - return FALSE; + return false; } break; default: @@ -1124,12 +1124,12 @@ bool TQDataBrowser::preNav() case TQSql::No: break; case TQSql::Cancel: - return FALSE; + return false; } } return ok; } - return TRUE; + return true; } /*! \internal @@ -1169,7 +1169,7 @@ void TQDataBrowser::nav( Nav nav ) } /*! - If boundaryChecking() is TRUE, checks the boundary of the current + If boundaryChecking() is true, checks the boundary of the current default cursor and emits signals which indicate the position of the cursor. */ @@ -1181,38 +1181,38 @@ void TQDataBrowser::updateBoundary() switch ( bound ) { case Unknown: case None: - emit firstRecordAvailable( TRUE ); - emit prevRecordAvailable( TRUE ); - emit nextRecordAvailable( TRUE ); - emit lastRecordAvailable( TRUE ); + emit firstRecordAvailable( true ); + emit prevRecordAvailable( true ); + emit nextRecordAvailable( true ); + emit lastRecordAvailable( true ); break; case BeforeBeginning: - emit firstRecordAvailable( FALSE ); - emit prevRecordAvailable( FALSE ); - emit nextRecordAvailable( TRUE ); - emit lastRecordAvailable( TRUE ); + emit firstRecordAvailable( false ); + emit prevRecordAvailable( false ); + emit nextRecordAvailable( true ); + emit lastRecordAvailable( true ); break; case Beginning: - emit firstRecordAvailable( FALSE ); - emit prevRecordAvailable( FALSE ); - emit nextRecordAvailable( TRUE ); - emit lastRecordAvailable( TRUE ); + emit firstRecordAvailable( false ); + emit prevRecordAvailable( false ); + emit nextRecordAvailable( true ); + emit lastRecordAvailable( true ); break; case End: - emit firstRecordAvailable( TRUE ); - emit prevRecordAvailable( TRUE ); - emit nextRecordAvailable( FALSE ); - emit lastRecordAvailable( FALSE ); + emit firstRecordAvailable( true ); + emit prevRecordAvailable( true ); + emit nextRecordAvailable( false ); + emit lastRecordAvailable( false ); break; case AfterEnd: - emit firstRecordAvailable( TRUE ); - emit prevRecordAvailable( TRUE ); - emit nextRecordAvailable( FALSE ); - emit lastRecordAvailable( FALSE ); + emit firstRecordAvailable( true ); + emit prevRecordAvailable( true ); + emit nextRecordAvailable( false ); + emit lastRecordAvailable( false ); break; } } diff --git a/src/sql/tqdatabrowser.h b/src/sql/tqdatabrowser.h index c1d715a3a..3fd8e9756 100644 --- a/src/sql/tqdatabrowser.h +++ b/src/sql/tqdatabrowser.h @@ -92,7 +92,7 @@ public: TQStringList sort() const; void setFilter( const TQString& filter ); TQString filter() const; - virtual void setSqlCursor( TQSqlCursor* cursor, bool autoDelete = FALSE ); + virtual void setSqlCursor( TQSqlCursor* cursor, bool autoDelete = false ); TQSqlCursor* sqlCursor() const; virtual void setForm( TQSqlForm* form ); TQSqlForm* form(); @@ -113,7 +113,7 @@ public: virtual void setAutoEdit( bool autoEdit ); bool autoEdit() const; - virtual bool seek( int i, bool relative = FALSE ); + virtual bool seek( int i, bool relative = false ); signals: void firstRecordAvailable( bool available ); 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 ); } diff --git a/src/sql/tqdatatable.h b/src/sql/tqdatatable.h index 530d30ce1..c287ec042 100644 --- a/src/sql/tqdatatable.h +++ b/src/sql/tqdatatable.h @@ -86,7 +86,7 @@ class TQM_EXPORT_SQL TQDataTable : public TQTable public: TQDataTable ( TQWidget* parent=0, const char* name=0 ); - TQDataTable ( TQSqlCursor* cursor, bool autoPopulate = FALSE, TQWidget* parent=0, const char* name=0 ); + TQDataTable ( TQSqlCursor* cursor, bool autoPopulate = false, TQWidget* parent=0, const char* name=0 ); ~TQDataTable(); virtual void addColumn( const TQString& fieldName, @@ -114,7 +114,7 @@ public: TQStringList sort() const; virtual void setSqlCursor( TQSqlCursor* cursor = 0, - bool autoPopulate = FALSE, bool autoDelete = FALSE ); + bool autoPopulate = false, bool autoDelete = false ); TQSqlCursor* sqlCursor() const; virtual void setNullText( const TQString& nullText ); @@ -138,8 +138,8 @@ public: RefreshAll = 3 }; void refresh( Refresh mode ); - void sortColumn ( int col, bool ascending = TRUE, - bool wholeRows = FALSE ); + void sortColumn ( int col, bool ascending = true, + bool wholeRows = false ); TQString text ( int row, int col ) const; TQVariant value ( int row, int col ) const; TQSqlRecord* currentRecord() const; @@ -174,7 +174,7 @@ public slots: void setColumnWidth( int col, int w ); void adjustColumn( int col ); void setColumnStretchable( int col, bool stretch ); - void swapColumns( int col1, int col2, bool swapHeaders = FALSE ); + void swapColumns( int col1, int col2, bool swapHeaders = false ); protected: virtual bool insertCurrent(); diff --git a/src/sql/tqeditorfactory.cpp b/src/sql/tqeditorfactory.cpp index 098d850c7..6c1cf4a60 100644 --- a/src/sql/tqeditorfactory.cpp +++ b/src/sql/tqeditorfactory.cpp @@ -150,7 +150,7 @@ TQWidget * TQEditorFactory::createEditor( TQWidget * parent, const TQVariant & v case TQVariant::CString: case TQVariant::Double: w = new TQLineEdit( parent, "qt_editor_double" ); - ((TQLineEdit*)w)->setFrame( FALSE ); + ((TQLineEdit*)w)->setFrame( false ); break; case TQVariant::Date: w = new TQDateEdit( parent, "qt_editor_date" ); diff --git a/src/sql/tqsqlcursor.cpp b/src/sql/tqsqlcursor.cpp index 55f9c9a38..5950b79e9 100644 --- a/src/sql/tqsqlcursor.cpp +++ b/src/sql/tqsqlcursor.cpp @@ -109,7 +109,7 @@ TQString qWhereClause( TQSqlRecord* rec, const TQString& prefix, const TQString& { static TQString blank( " " ); TQString filter; - bool separator = FALSE; + bool separator = false; for ( uint j = 0; j < rec->count(); ++j ) { TQSqlField* f = rec->field( j ); if ( rec->isGenerated( j ) ) { @@ -117,7 +117,7 @@ TQString qWhereClause( TQSqlRecord* rec, const TQString& prefix, const TQString& filter += sep + blank; filter += qWhereClause( prefix, f, driver ); filter += blank; - separator = TRUE; + separator = true; } } return filter; @@ -145,13 +145,13 @@ TQString qWhereClause( TQSqlRecord* rec, const TQString& prefix, const TQString& For browsing data, a cursor must first select() data from the database. After a successful select() the cursor is active - (isActive() returns TRUE), but is initially not positioned on a - valid record (isValid() returns FALSE). To position the cursor on + (isActive() returns true), but is initially not positioned on a + valid record (isValid() returns false). To position the cursor on a valid record, use one of the navigation functions, next(), prev(), first(), last(), or seek(). Once positioned on a valid record, data can be retrieved from the browse buffer using value(). If a navigation function is not successful, it returns - FALSE, the cursor will no longer be positioned on a valid record + false, the cursor will no longer be positioned on a valid record and the values returned by value() are undefined. For example: @@ -165,7 +165,7 @@ TQString qWhereClause( TQSqlRecord* rec, const TQString& prefix, const TQString& view name in the database. Then, select() is called, which can be optionally parameterised to filter and order the records retrieved. Each record in the cursor is retrieved using next(). - When next() returns FALSE, there are no more records to process, + When next() returns false, there are no more records to process, and the loop terminates. For editing records (rows of data), a cursor contains a separate @@ -209,10 +209,10 @@ TQString qWhereClause( TQSqlRecord* rec, const TQString& prefix, const TQString& After calling insert(), update() or del(), the cursor is no longer positioned on a valid record and can no longer be navigated - (isValid() return FALSE). The reason for this is that any changes + (isValid() return false). The reason for this is that any changes made to the database will not be visible until select() is called to refresh the cursor. You can change this behavior by passing - FALSE to insert(), update() or del() which will prevent the cursor + false to insert(), update() or del() which will prevent the cursor from becoming invalid. The edits will still not be visible when navigating the cursor until select() is called. @@ -258,7 +258,7 @@ TQString qWhereClause( TQSqlRecord* rec, const TQString& prefix, const TQString& /*! Constructs a cursor on database \a db using table or view \a name. - If \a autopopulate is TRUE (the default), the \a name of the + If \a autopopulate is true (the default), the \a name of the cursor must correspond to an existing table or view name in the database so that field information can be automatically created. If the table or view does not exist, the cursor will not be @@ -381,7 +381,7 @@ TQString TQSqlCursor::filter() const } /*! - Sets the name of the cursor to \a name. If \a autopopulate is TRUE + Sets the name of the cursor to \a name. If \a autopopulate is true (the default), the \a name must correspond to a valid table or view name in the database. Also, note that all references to the cursor edit buffer become invalidated when fields are @@ -421,7 +421,7 @@ TQString TQSqlCursor::toString( const TQString& prefix, const TQString& sep ) co { TQString pflist; TQString pfix = prefix.isEmpty() ? TQString::null : prefix + "."; - bool comma = FALSE; + bool comma = false; for ( uint i = 0; i < count(); ++i ) { const TQString fname = fieldName( i ); @@ -429,7 +429,7 @@ TQString TQSqlCursor::toString( const TQString& prefix, const TQString& sep ) co if( comma ) pflist += sep + " "; pflist += pfix + fname; - comma = TRUE; + comma = true; } } return pflist; @@ -503,7 +503,7 @@ void TQSqlCursor::remove( int pos ) /*! Sets the generated flag for the field \a name to \a generated. If the field does not exist, nothing happens. Only fields that have - \a generated set to TRUE are included in the SQL that is + \a generated set to true are included in the SQL that is generated by insert(), update() or del(). \sa isGenerated() @@ -538,7 +538,7 @@ void TQSqlCursor::setGenerated( int i, bool generated ) /*! Returns the primary index associated with the cursor as defined in the database, or an empty index if there is no primary index. If - \a setFromCursor is TRUE (the default), the index fields are + \a setFromCursor is true (the default), the index fields are populated with the corresponding values in the cursor's current record. */ @@ -618,8 +618,8 @@ TQSqlIndex TQSqlCursor::index( const char* fieldName ) const /*! Selects all fields in the cursor from the database matching the filter criteria \a filter. The data is returned in the order - specified by the index \a sort. Returns TRUE if the data was - successfully selected; otherwise returns FALSE. + specified by the index \a sort. Returns true if the data was + successfully selected; otherwise returns false. The \a filter is a string containing a SQL \c WHERE clause but without the 'WHERE' keyword. The cursor is initially positioned at @@ -661,7 +661,7 @@ bool TQSqlCursor::select( const TQString & filter, const TQSqlIndex & sort ) { TQString fieldList = toString( d->nm ); if ( fieldList.isEmpty() ) - return FALSE; + return false; TQString str= "select " + fieldList; str += " from " + d->nm; if ( !filter.isEmpty() ) { @@ -798,12 +798,12 @@ void TQSqlCursor::setCalculated( const TQString& name, bool calculated ) return; d->infoBuffer[ pos ].setCalculated( calculated ); if ( calculated ) - setGenerated( pos, FALSE ); + setGenerated( pos, false ); } /*! - Returns TRUE if the field \a name exists and is calculated; - otherwise returns FALSE. + Returns true if the field \a name exists and is calculated; + otherwise returns false. \sa setCalculated() */ @@ -812,7 +812,7 @@ bool TQSqlCursor::isCalculated( const TQString& name ) const { int pos = position( name ); if ( pos < 0 ) - return FALSE; + return false; return d->infoBuffer[ pos ].isCalculated(); } @@ -835,8 +835,8 @@ void TQSqlCursor::setTrimmed( const TQString& name, bool trim ) } /*! - Returns TRUE if the field \a name exists and is trimmed; otherwise - returns FALSE. + Returns true if the field \a name exists and is trimmed; otherwise + returns false. When a trimmed field of type string or cstring is read from the database any trailing (right-most) spaces are removed. @@ -848,13 +848,13 @@ bool TQSqlCursor::isTrimmed( const TQString& name ) const { int pos = position( name ); if ( pos < 0 ) - return FALSE; + return false; return d->infoBuffer[ pos ].isTrim(); } /*! - Returns TRUE if the cursor is read-only; otherwise returns FALSE. - The default is FALSE. Read-only cursors cannot be edited using + Returns true if the cursor is read-only; otherwise returns false. + The default is false. Read-only cursors cannot be edited using insert(), update() or del(). \sa setMode() @@ -866,8 +866,8 @@ bool TQSqlCursor::isReadOnly() const } /*! - Returns TRUE if the cursor will perform inserts; otherwise returns - FALSE. + Returns true if the cursor will perform inserts; otherwise returns + false. \sa setMode() */ @@ -879,8 +879,8 @@ bool TQSqlCursor::canInsert() const /*! - Returns TRUE if the cursor will perform updates; otherwise returns - FALSE. + Returns true if the cursor will perform updates; otherwise returns + false. \sa setMode() */ @@ -891,8 +891,8 @@ bool TQSqlCursor::canUpdate() const } /*! - Returns TRUE if the cursor will perform deletes; otherwise returns - FALSE. + Returns true if the cursor will perform deletes; otherwise returns + false. \sa setMode() */ @@ -933,7 +933,7 @@ TQString TQSqlCursor::toString( const TQString& prefix, TQSqlField* field, const ".", the field name, the \a fieldSep and the field value. If the \a prefix is empty then each field will begin with the field name. The fields are then joined together separated by \a sep. Fields - where isGenerated() returns FALSE are not included. This function + where isGenerated() returns false are not included. This function is useful for generating SQL statements. */ @@ -942,7 +942,7 @@ TQString TQSqlCursor::toString( TQSqlRecord* rec, const TQString& prefix, const { static TQString blank( " " ); TQString filter; - bool separator = FALSE; + bool separator = false; for ( uint j = 0; j < count(); ++j ) { TQSqlField* f = rec->field( j ); if ( rec->isGenerated( j ) ) { @@ -950,7 +950,7 @@ TQString TQSqlCursor::toString( TQSqlRecord* rec, const TQString& prefix, const filter += sep + blank; filter += toString( prefix, f, fieldSep ); filter += blank; - separator = TRUE; + separator = true; } } return filter; @@ -965,7 +965,7 @@ TQString TQSqlCursor::toString( TQSqlRecord* rec, const TQString& prefix, const If the \a prefix is empty then each field will begin with the field name. The field values are taken from \a rec. The fields are then joined together separated by \a sep. Fields where isGenerated() - returns FALSE are ignored. This function is useful for generating + returns false are ignored. This function is useful for generating SQL statements. */ @@ -973,7 +973,7 @@ TQString TQSqlCursor::toString( const TQSqlIndex& i, TQSqlRecord* rec, const TQS const TQString& fieldSep, const TQString& sep ) const { TQString filter; - bool separator = FALSE; + bool separator = false; for( uint j = 0; j < i.count(); ++j ){ if ( rec->isGenerated( j ) ) { if( separator ) { @@ -982,7 +982,7 @@ TQString TQSqlCursor::toString( const TQSqlIndex& i, TQSqlRecord* rec, const TQS TQString fn = i.fieldName( j ); TQSqlField* f = rec->field( fn ); filter += toString( prefix, f, fieldSep ); - separator = TRUE; + separator = true; } } return filter; @@ -996,7 +996,7 @@ TQString TQSqlCursor::toString( const TQSqlIndex& i, TQSqlRecord* rec, const TQS number of rows affected by the insert. For error information, use lastError(). - If \a invalidate is TRUE (the default), the cursor will no longer + If \a invalidate is true (the default), the cursor will no longer be positioned on a valid record and can no longer be navigated. A new select() call must be made before navigating to a valid record. @@ -1020,14 +1020,14 @@ TQString TQSqlCursor::toString( const TQSqlIndex& i, TQSqlRecord* rec, const TQS int TQSqlCursor::insert( bool invalidate ) { if ( ( d->md & Insert ) != Insert || !driver() ) - return FALSE; + return false; int k = d->editBuffer.count(); if ( k == 0 ) return 0; TQString fList; TQString vList; - bool comma = FALSE; + bool comma = false; // use a prepared query if the driver supports it if ( driver()->hasFeature( TQSqlDriver::PreparedQueries ) ) { int cnt = 0; @@ -1040,9 +1040,9 @@ int TQSqlCursor::insert( bool invalidate ) vList += ","; } fList += f->name(); - vList += (oraStyle == TRUE) ? ":f" + TQString::number(cnt) : TQString("?"); + vList += oraStyle ? ":f" + TQString::number(cnt) : TQString("?"); cnt++; - comma = TRUE; + comma = true; } } if ( !comma ) { @@ -1061,7 +1061,7 @@ int TQSqlCursor::insert( bool invalidate ) } fList += f->name(); vList += driver()->formatValue( f ); - comma = TRUE; + comma = true; } } @@ -1076,8 +1076,8 @@ int TQSqlCursor::insert( bool invalidate ) } /*! - Returns the current internal edit buffer. If \a copy is TRUE (the - default is FALSE), the current cursor field values are first + Returns the current internal edit buffer. If \a copy is true (the + default is false), the current cursor field values are first copied into the edit buffer. The edit buffer is valid as long as the cursor remains valid. The cursor retains ownership of the returned pointer, so it must not be deleted or modified. @@ -1104,7 +1104,7 @@ TQSqlRecord* TQSqlCursor::editBuffer( bool copy ) returns the edit buffer. The default implementation copies the field values from the current cursor record into the edit buffer (therefore, this function is equivalent to calling editBuffer( - TRUE ) ). The cursor retains ownership of the returned pointer, so + true ) ). The cursor retains ownership of the returned pointer, so it must not be deleted or modified. \sa editBuffer() update() @@ -1113,8 +1113,8 @@ TQSqlRecord* TQSqlCursor::editBuffer( bool copy ) TQSqlRecord* TQSqlCursor::primeUpdate() { // memorize the primary keys as they were before the user changed the values in editBuffer - TQSqlRecord* buf = editBuffer( TRUE ); - TQSqlIndex idx = primaryIndex( FALSE ); + TQSqlRecord* buf = editBuffer( true ); + TQSqlIndex idx = primaryIndex( false ); if ( !idx.isEmpty() ) d->editIndex = toString( idx, buf, d->nm, "=", "and" ); else @@ -1127,7 +1127,7 @@ TQSqlRecord* TQSqlCursor::primeUpdate() returns the edit buffer. The default implementation copies the field values from the current cursor record into the edit buffer (therefore, this function is equivalent to calling editBuffer( - TRUE ) ). The cursor retains ownership of the returned pointer, so + true ) ). The cursor retains ownership of the returned pointer, so it must not be deleted or modified. \sa editBuffer() del() @@ -1135,7 +1135,7 @@ TQSqlRecord* TQSqlCursor::primeUpdate() TQSqlRecord* TQSqlCursor::primeDelete() { - return editBuffer( TRUE ); + return editBuffer( true ); } /*! @@ -1163,7 +1163,7 @@ TQSqlRecord* TQSqlCursor::primeInsert() cursor's primary index are updated. If the cursor does not contain a primary index, no update is performed and 0 is returned. - If \a invalidate is TRUE (the default), the current cursor can no + If \a invalidate is true (the default), the current cursor can no longer be navigated. A new select() call must be made before you can move to a valid record. For example: @@ -1208,7 +1208,7 @@ int TQSqlCursor::update( bool invalidate ) Only records which meet the filter criteria are updated, otherwise all records in the table are updated. - If \a invalidate is TRUE (the default), the cursor can no longer + If \a invalidate is true (the default), the cursor can no longer be navigated. A new select() call must be made before you can move to a valid record. @@ -1218,7 +1218,7 @@ int TQSqlCursor::update( bool invalidate ) int TQSqlCursor::update( const TQString & filter, bool invalidate ) { if ( ( d->md & Update ) != Update ) { - return FALSE; + return false; } int k = count(); if ( k == 0 ) { @@ -1228,7 +1228,7 @@ int TQSqlCursor::update( const TQString & filter, bool invalidate ) // use a prepared query if the driver supports it if ( driver()->hasFeature( TQSqlDriver::PreparedQueries ) ) { TQString fList; - bool comma = FALSE; + bool comma = false; int cnt = 0; bool oraStyle = driver()->hasFeature( TQSqlDriver::NamedPlaceholders ); for( int j = 0; j < k; ++j ) { @@ -1237,9 +1237,9 @@ int TQSqlCursor::update( const TQString & filter, bool invalidate ) if ( comma ) { fList += ","; } - fList += f->name() + " = " + (oraStyle == TRUE ? ":f" + TQString::number(cnt) : TQString("?")); + fList += f->name() + " = " + (oraStyle ? ":f" + TQString::number(cnt) : TQString("?")); cnt++; - comma = TRUE; + comma = true; } } if ( !comma ) { @@ -1269,7 +1269,7 @@ int TQSqlCursor::update( const TQString & filter, bool invalidate ) Only records which meet the filter criteria specified by the cursor's primary index are deleted. If the cursor does not contain a primary index, no delete is performed and 0 is returned. If \a - invalidate is TRUE (the default), the current cursor can no longer + invalidate is true (the default), the current cursor can no longer be navigated. A new select() call must be made before you can move to a valid record. For example: @@ -1291,7 +1291,7 @@ int TQSqlCursor::update( const TQString & filter, bool invalidate ) int TQSqlCursor::del( bool invalidate ) { - TQSqlIndex idx = primaryIndex( FALSE ); + TQSqlIndex idx = primaryIndex( false ); if ( idx.isEmpty() ) return del( qWhereClause( &d->editBuffer, d->nm, "and", driver() ), invalidate ); else @@ -1305,7 +1305,7 @@ int TQSqlCursor::del( bool invalidate ) Deletes the current cursor record from the database using the filter \a filter. Only records which meet the filter criteria are deleted. Returns the number of records which were deleted. If \a - invalidate is TRUE (the default), the current cursor can no longer + invalidate is true (the default), the current cursor can no longer be navigated. A new select() call must be made before you can move to a valid record. For error information, use lastError(). @@ -1384,8 +1384,8 @@ int TQSqlCursor::applyPrepared( const TQString& q, bool invalidate ) /*! \reimp - Executes the SQL query \a sql. Returns TRUE of the cursor is - active, otherwise returns FALSE. + Executes the SQL query \a sql. Returns true of the cursor is + active, otherwise returns false. */ bool TQSqlCursor::exec( const TQString & sql ) @@ -1434,10 +1434,10 @@ void TQSqlCursor::sync() d->lastAt = at(); uint i = 0; uint j = 0; - bool haveCalculatedFields = FALSE; + bool haveCalculatedFields = false; for ( ; i < count(); ++i ) { if ( !haveCalculatedFields && d->infoBuffer[i].isCalculated() ) { - haveCalculatedFields = TRUE; + haveCalculatedFields = true; } if ( TQSqlRecord::isGenerated( i ) ) { TQVariant v = TQSqlQuery::value( j ); @@ -1507,8 +1507,8 @@ void TQSqlCursor::insert( int pos, const TQSqlField& field ) } /*! - Returns TRUE if the field \a i is NULL or if there is no field at - position \a i; otherwise returns FALSE. + Returns true if the field \a i is NULL or if there is no field at + position \a i; otherwise returns false. This is the same as calling TQSqlRecord::isNull( \a i ) */ @@ -1519,8 +1519,8 @@ bool TQSqlCursor::isNull( int i ) const /*! \overload - Returns TRUE if the field called \a name is NULL or if there is no - field called \a name; otherwise returns FALSE. + Returns true if the field called \a name is NULL or if there is no + field called \a name; otherwise returns false. This is the same as calling TQSqlRecord::isNull( \a name ) */ diff --git a/src/sql/tqsqlcursor.h b/src/sql/tqsqlcursor.h index a8530ec53..35a06daef 100644 --- a/src/sql/tqsqlcursor.h +++ b/src/sql/tqsqlcursor.h @@ -62,7 +62,7 @@ class TQSqlCursorPrivate; class TQM_EXPORT_SQL TQSqlCursor : public TQSqlRecord, public TQSqlQuery { public: - TQSqlCursor( const TQString & name = TQString::null, bool autopopulate = TRUE, TQSqlDatabase* db = 0 ); + TQSqlCursor( const TQString & name = TQString::null, bool autopopulate = true, TQSqlDatabase* db = 0 ); TQSqlCursor( const TQSqlCursor & other ); TQSqlCursor& operator=( const TQSqlCursor& other ); ~TQSqlCursor(); @@ -79,7 +79,7 @@ public: TQVariant value( const TQString& name ) const; void setValue( int i, const TQVariant& val ); void setValue( const TQString& name, const TQVariant& val ); - virtual TQSqlIndex primaryIndex( bool prime = TRUE ) const; + virtual TQSqlIndex primaryIndex( bool prime = true ) const; virtual TQSqlIndex index( const TQStringList& fieldNames ) const; TQSqlIndex index( const TQString& fieldName ) const; TQSqlIndex index( const char* fieldName ) const; @@ -92,13 +92,13 @@ public: void setGenerated( const TQString& name, bool generated ); void setGenerated( int i, bool generated ); - virtual TQSqlRecord* editBuffer( bool copy = FALSE ); + virtual TQSqlRecord* editBuffer( bool copy = false ); virtual TQSqlRecord* primeInsert(); virtual TQSqlRecord* primeUpdate(); virtual TQSqlRecord* primeDelete(); - virtual int insert( bool invalidate = TRUE ); - virtual int update( bool invalidate = TRUE ); - virtual int del( bool invalidate = TRUE ); + virtual int insert( bool invalidate = true ); + virtual int update( bool invalidate = true ); + virtual int del( bool invalidate = true ); virtual void setMode( int flags ); int mode() const; @@ -121,7 +121,7 @@ public: TQSqlIndex sort() const; virtual void setFilter( const TQString& filter ); TQString filter() const; - virtual void setName( const TQString& name, bool autopopulate = TRUE ); + virtual void setName( const TQString& name, bool autopopulate = true ); TQString name() const; TQString toString( const TQString& prefix = TQString::null, const TQString& sep = "," ) const; @@ -133,8 +133,8 @@ protected: bool exec( const TQString & sql ); virtual TQVariant calculateField( const TQString& name ); - virtual int update( const TQString & filter, bool invalidate = TRUE ); - virtual int del( const TQString & filter, bool invalidate = TRUE ); + virtual int update( const TQString & filter, bool invalidate = true ); + virtual int del( const TQString & filter, bool invalidate = true ); virtual TQString toString( const TQString& prefix, TQSqlField* field, const TQString& fieldSep ) const; virtual TQString toString( TQSqlRecord* rec, const TQString& prefix, const TQString& fieldSep, diff --git a/src/sql/tqsqldatabase.cpp b/src/sql/tqsqldatabase.cpp index f818a8f62..4734c2d09 100644 --- a/src/sql/tqsqldatabase.cpp +++ b/src/sql/tqsqldatabase.cpp @@ -120,11 +120,11 @@ public: ~TQNullResult(){} protected: TQVariant data( int ) { return TQVariant(); } - bool reset ( const TQString& sqlquery ) { TQString s(sqlquery); return FALSE; } - bool fetch( int i ) { i = i; return FALSE; } - bool fetchFirst() { return FALSE; } - bool fetchLast() { return FALSE; } - bool isNull( int ) {return FALSE; } + bool reset ( const TQString& sqlquery ) { TQString s(sqlquery); return false; } + bool fetch( int i ) { i = i; return false; } + bool fetchFirst() { return false; } + bool fetchLast() { return false; } + bool isNull( int ) {return false; } TQSqlRecord record() {return TQSqlRecord();} int size() {return 0;} int numRowsAffected() {return 0;} @@ -135,16 +135,16 @@ class TQNullDriver : public TQSqlDriver public: TQNullDriver(): TQSqlDriver(){} ~TQNullDriver(){} - bool hasFeature( DriverFeature /* f */ ) const { return FALSE; } ; + bool hasFeature( DriverFeature /* f */ ) const { return false; } ; bool open( const TQString & , const TQString & , const TQString & , const TQString &, int ) { - return FALSE; + return false; } void close() {} - bool ping() { return TRUE; } + bool ping() { return true; } TQSqlQuery createQuery() const { return TQSqlQuery( new TQNullResult(this) ); } }; @@ -208,7 +208,7 @@ TQDriverDict* TQSqlDatabaseManager::driverDict() TQSqlDatabaseManager* sqlConnection = instance(); if ( !sqlConnection->drDict ) { sqlConnection->drDict = new TQDriverDict(); - sqlConnection->drDict->setAutoDelete( TRUE ); + sqlConnection->drDict->setAutoDelete( true ); } return sqlConnection->drDict; } @@ -233,7 +233,7 @@ TQSqlDatabaseManager* TQSqlDatabaseManager::instance() /*! Returns the database connection called \a name. If \a open is - TRUE, the database connection is opened. If \a name does not exist + true, the database connection is opened. If \a name does not exist in the list of managed databases, 0 is returned. */ @@ -256,8 +256,8 @@ TQSqlDatabase* TQSqlDatabaseManager::database( const TQString& name, bool open ) } /*! - Returns TRUE if the list of database connections contains \a name; - otherwise returns FALSE. + Returns true if the list of database connections contains \a name; + otherwise returns false. */ bool TQSqlDatabaseManager::contains( const TQString& name ) @@ -265,8 +265,8 @@ bool TQSqlDatabaseManager::contains( const TQString& name ) TQSqlDatabaseManager* sqlConnection = instance(); TQSqlDatabase* db = sqlConnection->dbDict.find( name ); if ( db ) - return TRUE; - return FALSE; + return true; + return false; } @@ -308,9 +308,9 @@ TQSqlDatabase* TQSqlDatabaseManager::addDatabase( TQSqlDatabase* db, const TQStr void TQSqlDatabaseManager::removeDatabase( const TQString& name ) { TQSqlDatabaseManager* sqlConnection = instance(); - sqlConnection->dbDict.setAutoDelete( TRUE ); + sqlConnection->dbDict.setAutoDelete( true ); sqlConnection->dbDict.remove( name ); - sqlConnection->dbDict.setAutoDelete( FALSE ); + sqlConnection->dbDict.setAutoDelete( false ); } @@ -417,7 +417,7 @@ TQSqlDatabase* TQSqlDatabase::addDatabase( const TQString& type, const TQString& /*! Returns the database connection called \a connectionName. The database connection must have been previously added with - addDatabase(). If \a open is TRUE (the default) and the database + addDatabase(). If \a open is true (the default) and the database connection is not already open it is opened now. If no \a connectionName is specified the default connection is used. If \a connectionName does not exist in the list of databases, 0 is @@ -565,8 +565,8 @@ void TQSqlDatabase::registerSqlDriver( const TQString& name, const TQSqlDriverCr } /*! - Returns TRUE if the list of database connections contains \a - connectionName; otherwise returns FALSE. + Returns true if the list of database connections contains \a + connectionName; otherwise returns false. */ bool TQSqlDatabase::contains( const TQString& connectionName ) @@ -752,7 +752,7 @@ TQSqlQuery TQSqlDatabase::exec( const TQString & query ) const /*! Opens the database connection using the current connection values. - Returns TRUE on success; otherwise returns FALSE. Error + Returns true on success; otherwise returns false. Error information can be retrieved using the lastError() function. \sa lastError() @@ -768,7 +768,7 @@ bool TQSqlDatabase::open() \overload Opens the database connection using the given \a user name and \a - password. Returns TRUE on success; otherwise returns FALSE. Error + password. Returns true on success; otherwise returns false. Error information can be retrieved using the lastError() function. This function does not store the password it is given. Instead, @@ -806,8 +806,8 @@ bool TQSqlDatabase::ping() } /*! - Returns TRUE if the database connection is currently open; - otherwise returns FALSE. + Returns true if the database connection is currently open; + otherwise returns false. */ bool TQSqlDatabase::isOpen() const @@ -816,8 +816,8 @@ bool TQSqlDatabase::isOpen() const } /*! - Returns TRUE if there was an error opening the database - connection; otherwise returns FALSE. Error information can be + Returns true if there was an error opening the database + connection; otherwise returns false. Error information can be retrieved using the lastError() function. */ @@ -828,8 +828,8 @@ bool TQSqlDatabase::isOpenError() const /*! Begins a transaction on the database if the driver supports - transactions. Returns TRUE if the operation succeeded; otherwise - returns FALSE. + transactions. Returns true if the operation succeeded; otherwise + returns false. \sa TQSqlDriver::hasFeature() commit() rollback() */ @@ -837,14 +837,14 @@ bool TQSqlDatabase::isOpenError() const bool TQSqlDatabase::transaction() { if ( !d->driver->hasFeature( TQSqlDriver::Transactions ) ) - return FALSE; + return false; return d->driver->beginTransaction(); } /*! Commits a transaction to the database if the driver supports - transactions. Returns TRUE if the operation succeeded; otherwise - returns FALSE. + transactions. Returns true if the operation succeeded; otherwise + returns false. \sa TQSqlDriver::hasFeature() rollback() */ @@ -852,14 +852,14 @@ bool TQSqlDatabase::transaction() bool TQSqlDatabase::commit() { if ( !d->driver->hasFeature( TQSqlDriver::Transactions ) ) - return FALSE; + return false; return d->driver->commitTransaction(); } /*! Rolls a transaction back on the database if the driver supports - transactions. Returns TRUE if the operation succeeded; otherwise - returns FALSE. + transactions. Returns true if the operation succeeded; otherwise + returns false. \sa TQSqlDriver::hasFeature() commit() transaction() */ @@ -867,7 +867,7 @@ bool TQSqlDatabase::commit() bool TQSqlDatabase::rollback() { if ( !d->driver->hasFeature( TQSqlDriver::Transactions ) ) - return FALSE; + return false; return d->driver->rollbackTransaction(); } @@ -1229,8 +1229,8 @@ TQString TQSqlDatabase::connectOptions() const } /*! - Returns TRUE if a driver called \a name is available; otherwise - returns FALSE. + Returns true if a driver called \a name is available; otherwise + returns false. \sa drivers() */ @@ -1241,9 +1241,9 @@ bool TQSqlDatabase::isDriverAvailable( const TQString& name ) TQStringList::ConstIterator it = l.begin(); for ( ;it != l.end(); ++it ) { if ( *it == name ) - return TRUE; + return true; } - return FALSE; + return false; } /*! \overload diff --git a/src/sql/tqsqldatabase.h b/src/sql/tqsqldatabase.h index 84e0b1baa..1629b8ad4 100644 --- a/src/sql/tqsqldatabase.h +++ b/src/sql/tqsqldatabase.h @@ -134,7 +134,7 @@ public: static TQSqlDatabase* addDatabase( const TQString& type, const TQString& connectionName = defaultConnection ); static TQSqlDatabase* addDatabase( TQSqlDriver* driver, const TQString& connectionName = defaultConnection ); - static TQSqlDatabase* database( const TQString& connectionName = defaultConnection, bool open = TRUE ); + static TQSqlDatabase* database( const TQString& connectionName = defaultConnection, bool open = true ); static void removeDatabase( const TQString& connectionName ); static void removeDatabase( TQSqlDatabase* db ); static bool contains( const TQString& connectionName = defaultConnection ); diff --git a/src/sql/tqsqldriver.cpp b/src/sql/tqsqldriver.cpp index d688b9a46..d608805cd 100644 --- a/src/sql/tqsqldriver.cpp +++ b/src/sql/tqsqldriver.cpp @@ -93,7 +93,7 @@ TQSqlDriver::~TQSqlDriver() order to open a database connection on database \a db, using user name \a user, password \a password, host \a host and port \a port. - The function \e must return TRUE on success and FALSE on failure. + The function \e must return true on success and false on failure. \sa setOpen() @@ -103,8 +103,8 @@ TQSqlDriver::~TQSqlDriver() \fn bool TQSqlDriver::close() Derived classes must reimplement this abstract virtual function in - order to close the database connection. Return TRUE on success, - FALSE on failure. + order to close the database connection. Return true on success, + false on failure. \sa setOpen() @@ -126,8 +126,8 @@ TQSqlDriver::~TQSqlDriver() //} /*! - Returns TRUE if the database connection is open; otherwise returns - FALSE. + Returns true if the database connection is open; otherwise returns + false. */ bool TQSqlDriver::isOpen() const @@ -142,8 +142,8 @@ bool TQSqlDriver::isOpen() const } /*! - Returns TRUE if the there was an error opening the database - connection; otherwise returns FALSE. + Returns true if the there was an error opening the database + connection; otherwise returns false. */ bool TQSqlDriver::isOpenError() const @@ -178,8 +178,8 @@ bool TQSqlDriver::isOpenError() const /*! \fn bool TQSqlDriver::hasFeature( DriverFeature f ) const - Returns TRUE if the driver supports feature \a f; otherwise - returns FALSE. + Returns true if the driver supports feature \a f; otherwise + returns false. Note that some databases need to be open() before this can be determined. @@ -206,8 +206,8 @@ void TQSqlDriver::setOpen( bool o ) /*! Protected function which sets the open error state of the database to \a e. Derived classes can use this function to report the - status of open(). Note that if \a e is TRUE the open state of the - database is set to closed (i.e. isOpen() returns FALSE). + status of open(). Note that if \a e is true the open state of the + database is set to closed (i.e. isOpen() returns false). \sa open(), setOpenError() */ @@ -224,41 +224,41 @@ void TQSqlDriver::setOpenError( bool e ) /*! Protected function which derived classes can reimplement to begin - a transaction. If successful, return TRUE, otherwise return FALSE. - The default implementation returns FALSE. + a transaction. If successful, return true, otherwise return false. + The default implementation returns false. \sa commitTransaction(), rollbackTransaction() */ bool TQSqlDriver::beginTransaction() { - return FALSE; + return false; } /*! Protected function which derived classes can reimplement to commit - a transaction. If successful, return TRUE, otherwise return FALSE. - The default implementation returns FALSE. + a transaction. If successful, return true, otherwise return false. + The default implementation returns false. \sa beginTransaction(), rollbackTransaction() */ bool TQSqlDriver::commitTransaction() { - return FALSE; + return false; } /*! Protected function which derived classes can reimplement to - rollback a transaction. If successful, return TRUE, otherwise - return FALSE. The default implementation returns FALSE. + rollback a transaction. If successful, return true, otherwise + return false. The default implementation returns false. \sa beginTransaction(), commitTransaction() */ bool TQSqlDriver::rollbackTransaction() { - return FALSE; + return false; } /*! @@ -387,7 +387,7 @@ TQString TQSqlDriver::nullText() const in single quotation marks, which is appropriate for many SQL databases. Any embedded single-quote characters are escaped (replaced with two single-quote characters). If \a trimStrings is - TRUE (the default is FALSE), all trailing whitespace is trimmed + true (the default is false), all trailing whitespace is trimmed from the field. \i If \a field is date/time data, the value is formatted in ISO @@ -487,7 +487,7 @@ TQString TQSqlDriver::formatValue( const TQSqlField* field, bool trimStrings ) c user, password \a password, host \a host, port \a port and connection options \a connOpts. - Returns TRUE on success and FALSE on failure. + Returns true on success and false on failure. \sa setOpen() */ diff --git a/src/sql/tqsqldriver.h b/src/sql/tqsqldriver.h index 34309ff37..2d041d9ca 100644 --- a/src/sql/tqsqldriver.h +++ b/src/sql/tqsqldriver.h @@ -88,7 +88,7 @@ public: virtual TQSqlRecordInfo recordInfo( const TQString& tablename ) const; virtual TQSqlRecordInfo recordInfo( const TQSqlQuery& query ) const; virtual TQString nullText() const; - virtual TQString formatValue( const TQSqlField* field, bool trimStrings = FALSE ) const; + virtual TQString formatValue( const TQSqlField* field, bool trimStrings = false ) const; TQSqlError lastError() const; virtual bool hasFeature( DriverFeature f ) const = 0; diff --git a/src/sql/tqsqleditorfactory.cpp b/src/sql/tqsqleditorfactory.cpp index 3598a7cac..0f8d202c6 100644 --- a/src/sql/tqsqleditorfactory.cpp +++ b/src/sql/tqsqleditorfactory.cpp @@ -178,7 +178,7 @@ TQWidget * TQSqlEditorFactory::createEditor( TQWidget * parent, case TQVariant::CString: case TQVariant::Double: w = new TQLineEdit( parent, "qt_editor_double" ); - ((TQLineEdit*)w)->setFrame( FALSE ); + ((TQLineEdit*)w)->setFrame( false ); break; case TQVariant::Date: w = new TQDateEdit( parent, "qt_editor_date" ); diff --git a/src/sql/tqsqlextension_p.cpp b/src/sql/tqsqlextension_p.cpp index 6ad4251c3..4c1dd252b 100644 --- a/src/sql/tqsqlextension_p.cpp +++ b/src/sql/tqsqlextension_p.cpp @@ -52,12 +52,12 @@ TQSqlExtension::~TQSqlExtension() bool TQSqlExtension::prepare( const TQString& /*query*/ ) { - return FALSE; + return false; } bool TQSqlExtension::exec() { - return FALSE; + return false; } void TQSqlExtension::bindValue( const TQString& placeholder, const TQVariant& val, TQSql::ParameterType tp ) diff --git a/src/sql/tqsqlfield.cpp b/src/sql/tqsqlfield.cpp index 7a99de333..b87f0d570 100644 --- a/src/sql/tqsqlfield.cpp +++ b/src/sql/tqsqlfield.cpp @@ -99,7 +99,7 @@ */ TQSqlField::TQSqlField( const TQString& fieldName, TQVariant::Type type ) - : nm(fieldName), ro(FALSE), nul(FALSE) + : nm(fieldName), ro(false), nul(false) { d = new TQSqlFieldPrivate(); d->type = type; @@ -132,8 +132,8 @@ TQSqlField& TQSqlField::operator=( const TQSqlField& other ) } /*! - Returns TRUE if the field is equal to \a other; otherwise returns - FALSE. Fields are considered equal when the following field + Returns true if the field is equal to \a other; otherwise returns + false. Fields are considered equal when the following field properties are the same: \list @@ -171,7 +171,7 @@ TQSqlField::~TQSqlField() /*! Sets the value of the field to \a value. If the field is read-only - (isReadOnly() returns TRUE), nothing happens. If the data type of + (isReadOnly() returns true), nothing happens. If the data type of \a value differs from the field's current data type, an attempt is made to cast it to the proper type. This preserves the data type of the field in the case of assignment, e.g. a TQString to an @@ -199,14 +199,14 @@ void TQSqlField::setValue( const TQVariant& value ) val = value; if ( value.isNull() ) - nul = TRUE; + nul = true; else nul = val.type() == TQVariant::Invalid; } /*! Clears the value of the field. If the field is read-only, nothing - happens. If \a nullify is TRUE (the default), the field is set to + happens. If \a nullify is true (the default), the field is set to NULL. */ @@ -218,7 +218,7 @@ void TQSqlField::clear( bool nullify ) v.cast( type() ); val = v; if ( nullify ) - nul = TRUE; + nul = true; } /*! @@ -243,7 +243,7 @@ void TQSqlField::setName( const TQString& name ) void TQSqlField::setNull() { - clear( TRUE ); + clear( true ); } /*! @@ -277,15 +277,15 @@ void TQSqlField::setReadOnly( bool readOnly ) /*! \fn bool TQSqlField::isReadOnly() const - Returns TRUE if the field's value is read only; otherwise returns - FALSE. + Returns true if the field's value is read only; otherwise returns + false. */ /*! \fn bool TQSqlField::isNull() const - Returns TRUE if the field is currently NULL; otherwise returns - FALSE. + Returns true if the field is currently NULL; otherwise returns + false. */ @@ -339,12 +339,12 @@ struct TQSqlFieldInfoPrivate no default value or it cannot be determined. \row \i \a typeID \i the internal typeID of the database system (only useful for low-level programming). 0 if unknown. - \row \i \a generated \i TRUE indicates that this field should be + \row \i \a generated \i true indicates that this field should be included in auto-generated SQL statments, e.g. in TQSqlCursor. - \row \i \a trim \i TRUE indicates that widgets should remove + \row \i \a trim \i true indicates that widgets should remove trailing whitespace from character fields. This does not affect the field value but only its representation inside widgets. - \row \i \a calculated \i TRUE indicates that the value of this + \row \i \a calculated \i true indicates that the value of this field is calculated. The value of calculated fields can by modified by subclassing TQSqlCursor and overriding TQSqlCursor::calculateField(). @@ -384,7 +384,7 @@ TQSqlFieldInfo::TQSqlFieldInfo( const TQSqlFieldInfo & other ) /*! Creates a TQSqlFieldInfo object with the type and the name of the - TQSqlField \a other. If \a generated is TRUE this field will be + TQSqlField \a other. If \a generated is true this field will be included in auto-generated SQL statments, e.g. in TQSqlCursor. */ TQSqlFieldInfo::TQSqlFieldInfo( const TQSqlField & other, bool generated ) @@ -397,8 +397,8 @@ TQSqlFieldInfo::TQSqlFieldInfo( const TQSqlField & other, bool generated ) d->prec = -1; d->typeID = 0; d->generated = generated; - d->trim = FALSE; - d->calculated = FALSE; + d->trim = false; + d->calculated = false; } /*! @@ -420,8 +420,8 @@ TQSqlFieldInfo& TQSqlFieldInfo::operator=( const TQSqlFieldInfo& other ) } /*! - Returns TRUE if this fieldinfo is equal to \a f; otherwise returns - FALSE. + Returns true if this fieldinfo is equal to \a f; otherwise returns + false. Two field infos are considered equal if all their attributes match. @@ -506,8 +506,8 @@ int TQSqlFieldInfo::typeID() const { return d->typeID; } /*! - Returns TRUE if the field should be included in auto-generated - SQL statments, e.g. in TQSqlCursor; otherwise returns FALSE. + Returns true if the field should be included in auto-generated + SQL statments, e.g. in TQSqlCursor; otherwise returns false. \sa setGenerated() */ @@ -515,8 +515,8 @@ bool TQSqlFieldInfo::isGenerated() const { return d->generated; } /*! - Returns TRUE if trailing whitespace should be removed from - character fields; otherwise returns FALSE. + Returns true if trailing whitespace should be removed from + character fields; otherwise returns false. \sa setTrim() */ @@ -524,7 +524,7 @@ bool TQSqlFieldInfo::isTrim() const { return d->trim; } /*! - Returns TRUE if the field is calculated; otherwise returns FALSE. + Returns true if the field is calculated; otherwise returns false. \sa setCalculated() */ @@ -532,7 +532,7 @@ bool TQSqlFieldInfo::isCalculated() const { return d->calculated; } /*! - If \a trim is TRUE widgets should remove trailing whitespace from + If \a trim is true widgets should remove trailing whitespace from character fields. This does not affect the field value but only its representation inside widgets. @@ -542,7 +542,7 @@ void TQSqlFieldInfo::setTrim( bool trim ) { d->trim = trim; } /*! - \a gen set to FALSE indicates that this field should not appear + \a gen set to false indicates that this field should not appear in auto-generated SQL statements (for example in TQSqlCursor). \sa isGenerated() @@ -551,7 +551,7 @@ void TQSqlFieldInfo::setGenerated( bool gen ) { d->generated = gen; } /*! - \a calc set to TRUE indicates that this field is a calculated + \a calc set to true indicates that this field is a calculated field. The value of calculated fields can by modified by subclassing TQSqlCursor and overriding TQSqlCursor::calculateField(). diff --git a/src/sql/tqsqlfield.h b/src/sql/tqsqlfield.h index 580fcd7df..898e9f498 100644 --- a/src/sql/tqsqlfield.h +++ b/src/sql/tqsqlfield.h @@ -77,7 +77,7 @@ public: bool isNull() const; virtual void setReadOnly( bool readOnly ); bool isReadOnly() const; - void clear( bool nullify = TRUE ); + void clear( bool nullify = true ); TQVariant::Type type() const; private: @@ -120,11 +120,11 @@ public: int prec = -1, const TQVariant& defValue = TQVariant(), int sqlType = 0, - bool generated = TRUE, - bool trim = FALSE, - bool calculated = FALSE ); + bool generated = true, + bool trim = false, + bool calculated = false ); TQSqlFieldInfo( const TQSqlFieldInfo & other ); - TQSqlFieldInfo( const TQSqlField & other, bool generated = TRUE ); + TQSqlFieldInfo( const TQSqlField & other, bool generated = true ); virtual ~TQSqlFieldInfo(); TQSqlFieldInfo& operator=( const TQSqlFieldInfo& other ); bool operator==( const TQSqlFieldInfo& f ) const; diff --git a/src/sql/tqsqlform.cpp b/src/sql/tqsqlform.cpp index c3da08e30..741df3a7a 100644 --- a/src/sql/tqsqlform.cpp +++ b/src/sql/tqsqlform.cpp @@ -52,7 +52,7 @@ class TQSqlFormPrivate { public: - TQSqlFormPrivate() : propertyMap( 0 ), buf( 0 ), dirty( FALSE ) {} + TQSqlFormPrivate() : propertyMap( 0 ), buf( 0 ), dirty( false ) {} ~TQSqlFormPrivate() { if ( propertyMap ) delete propertyMap; } TQStringList fld; TQDict<TQWidget> wgt; @@ -172,7 +172,7 @@ void TQSqlForm::installPropertyMap( TQSqlPropertyMap * pmap ) void TQSqlForm::setRecord( TQSqlRecord* buf ) { - d->dirty = TRUE; + d->dirty = true; d->buf = buf; } @@ -186,7 +186,7 @@ void TQSqlForm::setRecord( TQSqlRecord* buf ) void TQSqlForm::insert( TQWidget * widget, const TQString& field ) { - d->dirty = TRUE; + d->dirty = true; d->wgt.insert( field, widget ); d->fld += field; } @@ -199,7 +199,7 @@ void TQSqlForm::insert( TQWidget * widget, const TQString& field ) void TQSqlForm::remove( const TQString& field ) { - d->dirty = TRUE; + d->dirty = true; if ( d->fld.find( field ) != d->fld.end() ) d->fld.remove( d->fld.find( field ) ); d->wgt.remove( field ); @@ -229,8 +229,8 @@ void TQSqlForm::remove( TQWidget * widget ) /*! Clears the values in all the widgets, and the fields they are - mapped to, in the form. If \a nullify is TRUE (the default is - FALSE), each field is also set to NULL. + mapped to, in the form. If \a nullify is true (the default is + false), each field is also set to NULL. */ void TQSqlForm::clearValues( bool nullify ) { @@ -248,7 +248,7 @@ void TQSqlForm::clearValues( bool nullify ) */ void TQSqlForm::clear() { - d->dirty = TRUE; + d->dirty = true; d->fld.clear(); clearMap(); } @@ -387,7 +387,7 @@ void TQSqlForm::sync() insert( d->wgt[ d->fld[ i ] ], d->buf->field( d->fld[ i ] ) ); } } - d->dirty = FALSE; + d->dirty = false; } /*! \internal diff --git a/src/sql/tqsqlform.h b/src/sql/tqsqlform.h index cdd00b7cd..35fc0228f 100644 --- a/src/sql/tqsqlform.h +++ b/src/sql/tqsqlform.h @@ -87,7 +87,7 @@ public slots: virtual void writeFields(); virtual void clear(); - virtual void clearValues( bool nullify = FALSE ); + virtual void clearValues( bool nullify = false ); protected: virtual void insert( TQWidget * widget, TQSqlField * field ); diff --git a/src/sql/tqsqlindex.cpp b/src/sql/tqsqlindex.cpp index 0a8a8f5b5..750126a43 100644 --- a/src/sql/tqsqlindex.cpp +++ b/src/sql/tqsqlindex.cpp @@ -126,7 +126,7 @@ void TQSqlIndex::setName( const TQString& name ) void TQSqlIndex::append( const TQSqlField& field ) { - append( field, FALSE ); + append( field, false ); } /*! @@ -134,7 +134,7 @@ void TQSqlIndex::append( const TQSqlField& field ) Appends the field \a field to the list of indexed fields. The field is appended with an ascending sort order, unless \a desc is - TRUE. + true. */ void TQSqlIndex::append( const TQSqlField& field, bool desc ) @@ -145,19 +145,19 @@ void TQSqlIndex::append( const TQSqlField& field, bool desc ) /*! - Returns TRUE if field \a i in the index is sorted in descending - order; otherwise returns FALSE. + Returns true if field \a i in the index is sorted in descending + order; otherwise returns false. */ bool TQSqlIndex::isDescending( int i ) const { if ( sorts.at( i ) != sorts.end() ) return sorts[i]; - return FALSE; + return false; } /*! - If \a desc is TRUE, field \a i is sorted in descending order. + If \a desc is true, field \a i is sorted in descending order. Otherwise, field \a i is sorted in ascending order (the default). If the field does not exist, nothing happens. */ @@ -180,19 +180,19 @@ void TQSqlIndex::setDescending( int i, bool desc ) "\a{prefix}.<fieldname>" If \a sep is specified, each field is separated by \a sep. If \a - verbose is TRUE (the default), each field contains a suffix + verbose is true (the default), each field contains a suffix indicating an ASCending or DESCending sort order. */ TQString TQSqlIndex::toString( const TQString& prefix, const TQString& sep, bool verbose ) const { TQString s; - bool comma = FALSE; + bool comma = false; for ( uint i = 0; i < count(); ++i ) { if( comma ) s += sep + " "; s += createField( i, prefix, verbose ); - comma = TRUE; + comma = true; } return s; } @@ -207,7 +207,7 @@ TQString TQSqlIndex::toString( const TQString& prefix, const TQString& sep, bool "\a{prefix}.<fieldname>" - If \a verbose is TRUE (the default), each field contains a suffix + If \a verbose is true (the default), each field contains a suffix indicating an ASCending or DESCending sort order. Note that if you want to iterate over the list, you should iterate @@ -233,7 +233,7 @@ TQStringList TQSqlIndex::toStringList( const TQString& prefix, bool verbose ) co /*! \internal Creates a string representing the field number \a i using prefix \a - prefix. If \a verbose is TRUE, ASC or DESC is included in the field + prefix. If \a verbose is true, ASC or DESC is included in the field description if the field is sorted in ASCending or DESCending order. */ @@ -263,11 +263,11 @@ TQSqlIndex TQSqlIndex::fromStringList( const TQStringList& l, const TQSqlCursor* TQSqlIndex newSort; for ( uint i = 0; i < l.count(); ++i ) { TQString f = l[ i ]; - bool desc = FALSE; + bool desc = false; if ( f.mid( f.length()-3 ) == "ASC" ) f = f.mid( 0, f.length()-3 ); if ( f.mid( f.length()-4 ) == "DESC" ) { - desc = TRUE; + desc = true; f = f.mid( 0, f.length()-4 ); } int dot = f.findRev( '.' ); diff --git a/src/sql/tqsqlindex.h b/src/sql/tqsqlindex.h index 066c693c1..cd3e7c5f3 100644 --- a/src/sql/tqsqlindex.h +++ b/src/sql/tqsqlindex.h @@ -80,9 +80,9 @@ public: TQString toString( const TQString& prefix = TQString::null, const TQString& sep = ",", - bool verbose = TRUE ) const; + bool verbose = true ) const; TQStringList toStringList( const TQString& prefix = TQString::null, - bool verbose = TRUE ) const; + bool verbose = true ) const; static TQSqlIndex fromStringList( const TQStringList& l, const TQSqlCursor* cursor ); diff --git a/src/sql/tqsqlmanager_p.cpp b/src/sql/tqsqlmanager_p.cpp index 64345bde2..75f37d239 100644 --- a/src/sql/tqsqlmanager_p.cpp +++ b/src/sql/tqsqlmanager_p.cpp @@ -57,7 +57,7 @@ class TQSqlCursorManagerPrivate { public: TQSqlCursorManagerPrivate() - : cur( 0 ), autoDelete( FALSE ) + : cur( 0 ), autoDelete( false ) {} TQString ftr; @@ -166,7 +166,7 @@ TQString TQSqlCursorManager::filter() const /*! \internal - Sets auto-delete to \a enable. If TRUE, the default cursor will + Sets auto-delete to \a enable. If true, the default cursor will be deleted when necessary. \sa autoDelete() @@ -180,7 +180,7 @@ void TQSqlCursorManager::setAutoDelete( bool enable ) /*! \internal - Returns TRUE if auto-deletion is enabled, otherwise FALSE. + Returns true if auto-deletion is enabled, otherwise false. \sa setAutoDelete() @@ -194,7 +194,7 @@ bool TQSqlCursorManager::autoDelete() const /*! \internal Sets the default cursor used by the manager to \a cursor. If \a - autoDelete is TRUE (the default is FALSE), the manager takes + autoDelete is true (the default is false), the manager takes ownership of the \a cursor pointer, which will be deleted when the manager is destroyed, or when setCursor() is called again. To activate the \a cursor use refresh(). @@ -229,7 +229,7 @@ TQSqlCursor* TQSqlCursorManager::cursor() const /*! \internal Refreshes the manager using the default cursor. The manager's - filter and sort are applied. Returns TRUE on success, FALSE if an + filter and sort are applied. Returns true on success, false if an error occurred or there is no current cursor. \sa setFilter() setSort() @@ -240,7 +240,7 @@ bool TQSqlCursorManager::refresh() { TQSqlCursor* cur = cursor(); if ( !cur ) - return FALSE; + return false; TQString currentFilter = d->ftr; TQStringList currentSort = d->srt; TQSqlIndex newSort = TQSqlIndex::fromStringList( currentSort, cur ); @@ -249,20 +249,20 @@ bool TQSqlCursorManager::refresh() /* \internal - Returns TRUE if the \a buf field values that correspond to \a idx + Returns true if the \a buf field values that correspond to \a idx match the field values in \a cur that correspond to \a idx. */ static bool index_matches( const TQSqlCursor* cur, const TQSqlRecord* buf, const TQSqlIndex& idx ) { - bool indexEquals = FALSE; + bool indexEquals = false; for ( uint i = 0; i < idx.count(); ++i ) { const TQString fn( idx.field(i)->name() ); if ( cur->value( fn ) == buf->value( fn ) ) - indexEquals = TRUE; + indexEquals = true; else { - indexEquals = FALSE; + indexEquals = false; break; } } @@ -352,16 +352,16 @@ bool TQSqlCursorManager::findBuffer( const TQSqlIndex& idx, int atHint ) #endif TQSqlCursor* cur = cursor(); if ( !cur ) - return FALSE; + return false; if ( !cur->isActive() ) - return FALSE; + return false; if ( !idx.count() ) { if ( cur->at() == TQSql::BeforeFirst ) cur->next(); - return FALSE; + return false; } TQSqlRecord* buf = cur->editBuffer(); - bool indexEquals = FALSE; + bool indexEquals = false; #ifdef QT_DEBUG_DATAMANAGER tqDebug(" Checking hint..."); #endif @@ -402,7 +402,7 @@ bool TQSqlCursorManager::findBuffer( const TQSqlIndex& idx, int atHint ) if ( !cur->seek( mid ) ) break; if ( index_matches( cur, buf, idx ) ) { - indexEquals = TRUE; + indexEquals = true; break; } int c = compare_recs( buf, cur, cur->sort() ); @@ -416,7 +416,7 @@ bool TQSqlCursorManager::findBuffer( const TQSqlIndex& idx, int atHint ) if ( !cur->seek( mid ) ) break; if ( index_matches( cur, buf, idx ) ) { - indexEquals = TRUE; + indexEquals = true; break; } } while ( compare_recs( buf, cur, cur->sort() ) == 0 ); @@ -428,7 +428,7 @@ bool TQSqlCursorManager::findBuffer( const TQSqlIndex& idx, int atHint ) if ( !cur->seek( mid ) ) break; if ( index_matches( cur, buf, idx ) ) { - indexEquals = TRUE; + indexEquals = true; break; } } while ( compare_recs( buf, cur, cur->sort() ) == 0 ); @@ -453,7 +453,7 @@ bool TQSqlCursorManager::findBuffer( const TQSqlIndex& idx, int atHint ) cur->seek( startIdx ); } for ( ;; ) { - indexEquals = FALSE; + indexEquals = false; indexEquals = index_matches( cur, buf, idx ); if ( indexEquals ) break; @@ -620,8 +620,8 @@ class TQDataManagerPrivate { public: TQDataManagerPrivate() - : mode( TQSql::None ), autoEd( TRUE ), confEdits( 3 ), - confCancs( FALSE ) {} + : mode( TQSql::None ), autoEd( true ), confEdits( 3 ), + confCancs( false ) {} TQSql::Op mode; bool autoEd; TQBitArray confEdits; @@ -727,7 +727,7 @@ void TQDataManager::setAutoEdit( bool autoEdit ) /*! \internal - Returns TRUE if auto-edit mode is enabled; otherwise returns FALSE. + Returns true if auto-edit mode is enabled; otherwise returns false. */ @@ -738,8 +738,8 @@ bool TQDataManager::autoEdit() const /*! \internal - If \a confirm is TRUE, all edit operations (inserts, updates and - deletes) will be confirmed by the user. If \a confirm is FALSE (the + If \a confirm is true, all edit operations (inserts, updates and + deletes) will be confirmed by the user. If \a confirm is false (the default), all edits are posted to the database immediately. */ @@ -750,8 +750,8 @@ void TQDataManager::setConfirmEdits( bool confirm ) /*! \internal - If \a confirm is TRUE, all inserts will be confirmed by the user. - If \a confirm is FALSE (the default), all edits are posted to the + If \a confirm is true, all inserts will be confirmed by the user. + If \a confirm is false (the default), all edits are posted to the database immediately. */ @@ -763,8 +763,8 @@ void TQDataManager::setConfirmInsert( bool confirm ) /*! \internal - If \a confirm is TRUE, all updates will be confirmed by the user. - If \a confirm is FALSE (the default), all edits are posted to the + If \a confirm is true, all updates will be confirmed by the user. + If \a confirm is false (the default), all edits are posted to the database immediately. */ @@ -776,8 +776,8 @@ void TQDataManager::setConfirmUpdate( bool confirm ) /*! \internal - If \a confirm is TRUE, all deletes will be confirmed by the user. - If \a confirm is FALSE (the default), all edits are posted to the + If \a confirm is true, all deletes will be confirmed by the user. + If \a confirm is false (the default), all edits are posted to the database immediately. */ @@ -789,8 +789,8 @@ void TQDataManager::setConfirmDelete( bool confirm ) /*! \internal - Returns TRUE if the table confirms all edit operations (inserts, - updates and deletes), otherwise returns FALSE. + Returns true if the table confirms all edit operations (inserts, + updates and deletes), otherwise returns false. */ bool TQDataManager::confirmEdits() const @@ -800,8 +800,8 @@ bool TQDataManager::confirmEdits() const /*! \internal - Returns TRUE if the table confirms inserts, otherwise returns - FALSE. + Returns true if the table confirms inserts, otherwise returns + false. */ bool TQDataManager::confirmInsert() const @@ -811,8 +811,8 @@ bool TQDataManager::confirmInsert() const /*! \internal - Returns TRUE if the table confirms updates, otherwise returns - FALSE. + Returns true if the table confirms updates, otherwise returns + false. */ bool TQDataManager::confirmUpdate() const @@ -822,8 +822,8 @@ bool TQDataManager::confirmUpdate() const /*! \internal - Returns TRUE if the table confirms deletes, otherwise returns - FALSE. + Returns true if the table confirms deletes, otherwise returns + false. */ bool TQDataManager::confirmDelete() const @@ -833,8 +833,8 @@ bool TQDataManager::confirmDelete() const /*! \internal - If \a confirm is TRUE, all cancels will be confirmed by the user - through a message box. If \a confirm is FALSE (the default), all + If \a confirm is true, all cancels will be confirmed by the user + through a message box. If \a confirm is false (the default), all cancels occur immediately. */ @@ -845,7 +845,7 @@ void TQDataManager::setConfirmCancels( bool confirm ) /*! \internal - Returns TRUE if the table confirms cancels, otherwise returns FALSE. + Returns true if the table confirms cancels, otherwise returns false. */ bool TQDataManager::confirmCancels() const diff --git a/src/sql/tqsqlmanager_p.h b/src/sql/tqsqlmanager_p.h index 8b667d68e..fdad28abe 100644 --- a/src/sql/tqsqlmanager_p.h +++ b/src/sql/tqsqlmanager_p.h @@ -86,7 +86,7 @@ public: TQStringList sort() const; virtual void setFilter( const TQString& filter ); TQString filter() const; - virtual void setCursor( TQSqlCursor* cursor, bool autoDelete = FALSE ); + virtual void setCursor( TQSqlCursor* cursor, bool autoDelete = false ); TQSqlCursor* cursor() const; virtual void setAutoDelete( bool enable ); diff --git a/src/sql/tqsqlquery.cpp b/src/sql/tqsqlquery.cpp index 256694eee..394532d6e 100644 --- a/src/sql/tqsqlquery.cpp +++ b/src/sql/tqsqlquery.cpp @@ -99,11 +99,11 @@ void TQSqlResultShared::slotResultDestroyed() (e.g. \c{SET DATESTYLE=ISO} for PostgreSQL). Successfully executed SQL statements set the query's state to - active (isActive() returns TRUE); otherwise the query's state is + active (isActive() returns true); otherwise the query's state is set to inactive. In either case, when executing a new SQL statement, the query is positioned on an invalid record; an active query must be navigated to a valid record (so that isValid() - returns TRUE) before values can be retrieved. + returns true) before values can be retrieved. Navigating records is performed with the following functions: @@ -288,7 +288,7 @@ void TQSqlQuery::init( const TQString& query, TQSqlDatabase* db ) d = new TQSqlResultShared( 0 ); TQSqlDatabase* database = db; if ( !database ) - database = TQSqlDatabase::database( TQSqlDatabase::defaultConnection, FALSE ); + database = TQSqlDatabase::database( TQSqlDatabase::defaultConnection, false ); if ( database ) *this = database->driver()->createQuery(); if ( !query.isNull() ) @@ -308,8 +308,8 @@ TQSqlQuery& TQSqlQuery::operator=( const TQSqlQuery& other ) } /*! - Returns TRUE if the query is active and positioned on a valid - record and the \a field is NULL; otherwise returns FALSE. Note + Returns true if the query is active and positioned on a valid + record and the \a field is NULL; otherwise returns false. Note that for some drivers isNull() will not return accurate information until after an attempt is made to retrieve data. @@ -319,16 +319,16 @@ TQSqlQuery& TQSqlQuery::operator=( const TQSqlQuery& other ) bool TQSqlQuery::isNull( int field ) const { if ( !d->sqlResult ) - return FALSE; + return false; if ( d->sqlResult->isActive() && d->sqlResult->isValid() ) return d->sqlResult->isNull( field ); - return FALSE; + return false; } /*! - Executes the SQL in \a query. Returns TRUE and sets the query + Executes the SQL in \a query. Returns true and sets the query state to active if the query was successful; otherwise returns - FALSE and sets the query state to inactive. The \a query string + false and sets the query state to inactive. The \a query string must use syntax appropriate for the SQL database being queried, for example, standard SQL. @@ -345,17 +345,17 @@ bool TQSqlQuery::isNull( int field ) const bool TQSqlQuery::exec ( const TQString& query ) { if ( !d->sqlResult ) - return FALSE; + return false; if ( d->sqlResult->extension() && driver()->hasFeature( TQSqlDriver::PreparedQueries ) ) d->sqlResult->extension()->clear(); - d->sqlResult->setActive( FALSE ); + d->sqlResult->setActive( false ); d->sqlResult->setLastError( TQSqlError() ); d->sqlResult->setAt( TQSql::BeforeFirst ); if ( !driver() ) { #ifdef QT_CHECK_RANGE tqWarning("TQSqlQuery::exec: no driver" ); #endif - return FALSE; + return false; } if ( d->count > 1 ) *this = driver()->createQuery(); @@ -365,13 +365,13 @@ bool TQSqlQuery::exec ( const TQString& query ) #ifdef QT_CHECK_RANGE tqWarning("TQSqlQuery::exec: database not open" ); #endif - return FALSE; + return false; } if ( query.isNull() || query.length() == 0 ) { #ifdef QT_CHECK_RANGE tqWarning("TQSqlQuery::exec: empty query" ); #endif - return FALSE; + return false; } #ifdef QT_DEBUG_SQL tqDebug( "\n TQSqlQuery: " + query ); @@ -462,38 +462,38 @@ const TQSqlResult* TQSqlQuery::result() const Retrieves the record at position (offset) \a i, if available, and positions the query on the retrieved record. The first record is at position 0. Note that the query must be in an active state and - isSelect() must return TRUE before calling this function. + isSelect() must return true before calling this function. - If \a relative is FALSE (the default), the following rules apply: + If \a relative is false (the default), the following rules apply: \list \i If \a i is negative, the result is positioned before the - first record and FALSE is returned. + first record and false is returned. \i Otherwise, an attempt is made to move to the record at position \a i. If the record at position \a i could not be retrieved, the - result is positioned after the last record and FALSE is returned. If - the record is successfully retrieved, TRUE is returned. + result is positioned after the last record and false is returned. If + the record is successfully retrieved, true is returned. \endlist - If \a relative is TRUE, the following rules apply: + If \a relative is true, the following rules apply: \list \i If the result is currently positioned before the first record or on the first record, and \a i is negative, there is no - change, and FALSE is returned. + change, and false is returned. \i If the result is currently located after the last record, and - \a i is positive, there is no change, and FALSE is returned. + \a i is positive, there is no change, and false is returned. \i If the result is currently located somewhere in the middle, and the relative offset \a i moves the result below zero, the - result is positioned before the first record and FALSE is + result is positioned before the first record and false is returned. \i Otherwise, an attempt is made to move to the record \a i records ahead of the current record (or \a i records behind the current record if \a i is negative). If the record at offset \a i could not be retrieved, the result is positioned after the last record if \a i >= 0, (or before the first record if \a i is - negative), and FALSE is returned. If the record is successfully - retrieved, TRUE is returned. + negative), and false is returned. If the record is successfully + retrieved, true is returned. \endlist \sa next() prev() first() last() at() isActive() isValid() @@ -501,7 +501,7 @@ const TQSqlResult* TQSqlQuery::result() const bool TQSqlQuery::seek( int i, bool relative ) { if ( !isSelect() || !isActive() ) - return FALSE; + return false; beforeSeek(); checkDetach(); int actualIdx; @@ -509,7 +509,7 @@ bool TQSqlQuery::seek( int i, bool relative ) if ( i < 0 ) { d->sqlResult->setAt( TQSql::BeforeFirst ); afterSeek(); - return FALSE; + return false; } actualIdx = i; } else { @@ -519,7 +519,7 @@ bool TQSqlQuery::seek( int i, bool relative ) actualIdx = i; else { afterSeek(); - return FALSE; + return false; } break; case TQSql::AfterLast: @@ -528,14 +528,14 @@ bool TQSqlQuery::seek( int i, bool relative ) actualIdx = at() + i; } else { afterSeek(); - return FALSE; + return false; } break; default: if ( ( at() + i ) < 0 ) { d->sqlResult->setAt( TQSql::BeforeFirst ); afterSeek(); - return FALSE; + return false; } actualIdx = at() + i; break; @@ -547,40 +547,40 @@ bool TQSqlQuery::seek( int i, bool relative ) tqWarning("TQSqlQuery::seek: cannot seek backwards in a forward only query" ); #endif afterSeek(); - return FALSE; + return false; } if ( actualIdx == ( at() + 1 ) && at() != TQSql::BeforeFirst ) { if ( !d->sqlResult->fetchNext() ) { d->sqlResult->setAt( TQSql::AfterLast ); afterSeek(); - return FALSE; + return false; } afterSeek(); - return TRUE; + return true; } if ( actualIdx == ( at() - 1 ) ) { if ( !d->sqlResult->fetchPrev() ) { d->sqlResult->setAt( TQSql::BeforeFirst ); afterSeek(); - return FALSE; + return false; } afterSeek(); - return TRUE; + return true; } if ( !d->sqlResult->fetch( actualIdx ) ) { d->sqlResult->setAt( TQSql::AfterLast ); afterSeek(); - return FALSE; + return false; } afterSeek(); - return TRUE; + return true; } /*! Retrieves the next record in the result, if available, and positions the query on the retrieved record. Note that the result - must be in an active state and isSelect() must return TRUE before - calling this function or it will do nothing and return FALSE. + must be in an active state and isSelect() must return true before + calling this function or it will do nothing and return false. The following rules apply: @@ -590,15 +590,15 @@ bool TQSqlQuery::seek( int i, bool relative ) made to retrieve the first record. \i If the result is currently located after the last record, - there is no change and FALSE is returned. + there is no change and false is returned. \i If the result is located somewhere in the middle, an attempt is made to retrieve the next record. \endlist If the record could not be retrieved, the result is positioned after - the last record and FALSE is returned. If the record is successfully - retrieved, TRUE is returned. + the last record and false is returned. If the record is successfully + retrieved, true is returned. \sa prev() first() last() seek() at() isActive() isValid() */ @@ -606,10 +606,10 @@ bool TQSqlQuery::seek( int i, bool relative ) bool TQSqlQuery::next() { if ( !isSelect() || !isActive() ) - return FALSE; + return false; beforeSeek(); checkDetach(); - bool b = FALSE; + bool b = false; switch ( at() ) { case TQSql::BeforeFirst: b = d->sqlResult->fetchFirst(); @@ -617,29 +617,29 @@ bool TQSqlQuery::next() return b; case TQSql::AfterLast: afterSeek(); - return FALSE; + return false; default: if ( !d->sqlResult->fetchNext() ) { d->sqlResult->setAt( TQSql::AfterLast ); afterSeek(); - return FALSE; + return false; } afterSeek(); - return TRUE; + return true; } } /*! Retrieves the previous record in the result, if available, and positions the query on the retrieved record. Note that the result - must be in an active state and isSelect() must return TRUE before - calling this function or it will do nothing and return FALSE. + must be in an active state and isSelect() must return true before + calling this function or it will do nothing and return false. The following rules apply: \list \i If the result is currently located before the first record, - there is no change and FALSE is returned. + there is no change and false is returned. \i If the result is currently located after the last record, an attempt is made to retrieve the last record. @@ -649,8 +649,8 @@ bool TQSqlQuery::next() \endlist If the record could not be retrieved, the result is positioned - before the first record and FALSE is returned. If the record is - successfully retrieved, TRUE is returned. + before the first record and false is returned. If the record is + successfully retrieved, true is returned. \sa next() first() last() seek() at() isActive() isValid() */ @@ -658,21 +658,21 @@ bool TQSqlQuery::next() bool TQSqlQuery::prev() { if ( !isSelect() || !isActive() ) - return FALSE; + return false; if ( isForwardOnly() ) { #ifdef QT_CHECK_RANGE tqWarning("TQSqlQuery::seek: cannot seek backwards in a forward only query" ); #endif - return FALSE; + return false; } beforeSeek(); checkDetach(); - bool b = FALSE; + bool b = false; switch ( at() ) { case TQSql::BeforeFirst: afterSeek(); - return FALSE; + return false; case TQSql::AfterLast: b = d->sqlResult->fetchLast(); afterSeek(); @@ -681,20 +681,20 @@ bool TQSqlQuery::prev() if ( !d->sqlResult->fetchPrev() ) { d->sqlResult->setAt( TQSql::BeforeFirst ); afterSeek(); - return FALSE; + return false; } afterSeek(); - return TRUE; + return true; } } /*! Retrieves the first record in the result, if available, and positions the query on the retrieved record. Note that the result - must be in an active state and isSelect() must return TRUE before - calling this function or it will do nothing and return FALSE. - Returns TRUE if successful. If unsuccessful the query position is - set to an invalid position and FALSE is returned. + must be in an active state and isSelect() must return true before + calling this function or it will do nothing and return false. + Returns true if successful. If unsuccessful the query position is + set to an invalid position and false is returned. \sa next() prev() last() seek() at() isActive() isValid() */ @@ -702,16 +702,16 @@ bool TQSqlQuery::prev() bool TQSqlQuery::first() { if ( !isSelect() || !isActive() ) - return FALSE; + return false; if ( isForwardOnly() && at() > TQSql::BeforeFirst ) { #ifdef QT_CHECK_RANGE tqWarning("TQSqlQuery::seek: cannot seek backwards in a forward only query" ); #endif - return FALSE; + return false; } beforeSeek(); checkDetach(); - bool b = FALSE; + bool b = false; b = d->sqlResult->fetchFirst(); afterSeek(); return b; @@ -720,10 +720,10 @@ bool TQSqlQuery::first() /*! Retrieves the last record in the result, if available, and positions the query on the retrieved record. Note that the result - must be in an active state and isSelect() must return TRUE before - calling this function or it will do nothing and return FALSE. - Returns TRUE if successful. If unsuccessful the query position is - set to an invalid position and FALSE is returned. + must be in an active state and isSelect() must return true before + calling this function or it will do nothing and return false. + Returns true if successful. If unsuccessful the query position is + set to an invalid position and false is returned. \sa next() prev() first() seek() at() isActive() isValid() */ @@ -731,10 +731,10 @@ bool TQSqlQuery::first() bool TQSqlQuery::last() { if ( !isSelect() || !isActive() ) - return FALSE; + return false; beforeSeek(); checkDetach(); - bool b = FALSE; + bool b = false; b = d->sqlResult->fetchLast(); afterSeek(); return b; @@ -744,8 +744,8 @@ bool TQSqlQuery::last() Returns the size of the result, (number of rows returned), or -1 if the size cannot be determined or if the database does not support reporting information about query sizes. Note that for - non-\c SELECT statements (isSelect() returns FALSE), size() will - return -1. If the query is not active (isActive() returns FALSE), + non-\c SELECT statements (isSelect() returns false), size() will + return -1. If the query is not active (isActive() returns false), -1 is returned. To determine the number of rows affected by a non-SELECT @@ -766,7 +766,7 @@ int TQSqlQuery::size() const Returns the number of rows affected by the result's SQL statement, or -1 if it cannot be determined. Note that for \c SELECT statements, the value is undefined; see size() instead. If the - query is not active (isActive() returns FALSE), -1 is returned. + query is not active (isActive() returns false), -1 is returned. \sa size() TQSqlDriver::hasFeature() */ @@ -795,56 +795,56 @@ TQSqlError TQSqlQuery::lastError() const } /*! - Returns TRUE if the query is currently positioned on a valid - record; otherwise returns FALSE. + Returns true if the query is currently positioned on a valid + record; otherwise returns false. */ bool TQSqlQuery::isValid() const { if ( !d->sqlResult ) - return FALSE; + return false; return d->sqlResult->isValid(); } /*! - Returns TRUE if the query is currently active; otherwise returns - FALSE. + Returns true if the query is currently active; otherwise returns + false. */ bool TQSqlQuery::isActive() const { if ( !d->sqlResult ) - return FALSE; + return false; return d->sqlResult->isActive(); } /*! - Returns TRUE if the current query is a \c SELECT statement; - otherwise returns FALSE. + Returns true if the current query is a \c SELECT statement; + otherwise returns false. */ bool TQSqlQuery::isSelect() const { if ( !d->sqlResult ) - return FALSE; + return false; return d->sqlResult->isSelect(); } /*! - Returns TRUE if you can only scroll \e forward through a result - set; otherwise returns FALSE. + Returns true if you can only scroll \e forward through a result + set; otherwise returns false. \sa setForwardOnly() */ bool TQSqlQuery::isForwardOnly() const { if ( !d->sqlResult ) - return FALSE; + return false; return d->sqlResult->isForwardOnly(); } /*! - Sets forward only mode to \a forward. If forward is TRUE only + Sets forward only mode to \a forward. If forward is true only next(), and seek() with positive values, are allowed for navigating the results. Forward only mode needs far less memory since results do not need to be cached. @@ -885,9 +885,9 @@ bool TQSqlQuery::checkDetach() TQString sql = d->sqlResult->lastQuery(); *this = driver()->createQuery(); exec( sql ); - return TRUE; + return true; } - return FALSE; + return false; } @@ -930,8 +930,8 @@ void TQSqlQuery::afterSeek() bool TQSqlQuery::prepare( const TQString& query ) { if ( !d->sqlResult || !d->sqlResult->extension() ) - return FALSE; - d->sqlResult->setActive( FALSE ); + return false; + d->sqlResult->setActive( false ); d->sqlResult->setLastError( TQSqlError() ); d->sqlResult->setAt( TQSql::BeforeFirst ); d->sqlResult->extension()->clear(); @@ -939,7 +939,7 @@ bool TQSqlQuery::prepare( const TQString& query ) #ifdef QT_CHECK_RANGE tqWarning("TQSqlQuery::prepare: no driver" ); #endif - return FALSE; + return false; } if ( d->count > 1 ) *this = driver()->createQuery(); @@ -948,13 +948,13 @@ bool TQSqlQuery::prepare( const TQString& query ) #ifdef QT_CHECK_RANGE tqWarning("TQSqlQuery::prepare: database not open" ); #endif - return FALSE; + return false; } if ( query.isNull() || query.length() == 0 ) { #ifdef QT_CHECK_RANGE tqWarning("TQSqlQuery::prepare: empty query" ); #endif - return FALSE; + return false; } #ifdef QT_DEBUG_SQL tqDebug( "\n TQSqlQuery: " + query ); @@ -997,15 +997,15 @@ bool TQSqlQuery::prepare( const TQString& query ) d->sqlResult->extension()->holders.append( Holder( rx.cap(0), i ) ); i += rx.matchedLength(); } - return TRUE; // fake prepares should always succeed + return true; // fake prepares should always succeed } } /*! \overload - Executes a previously prepared SQL query. Returns TRUE if the - query executed successfully; otherwise returns FALSE. + Executes a previously prepared SQL query. Returns true if the + query executed successfully; otherwise returns false. \sa prepare(), bindValue(), addBindValue() */ @@ -1013,7 +1013,7 @@ bool TQSqlQuery::exec() { bool ret; if ( !d->sqlResult || !d->sqlResult->extension() ) - return FALSE; + return false; if ( driver()->hasFeature( TQSqlDriver::PreparedQueries ) ) { ret = d->sqlResult->extension()->exec(); } else { diff --git a/src/sql/tqsqlquery.h b/src/sql/tqsqlquery.h index 5220fa27a..70c6f4b20 100644 --- a/src/sql/tqsqlquery.h +++ b/src/sql/tqsqlquery.h @@ -96,7 +96,7 @@ public: virtual bool exec ( const TQString& query ); virtual TQVariant value( int i ) const; - virtual bool seek( int i, bool relative = FALSE ); + virtual bool seek( int i, bool relative = false ); virtual bool next(); virtual bool prev(); virtual bool first(); diff --git a/src/sql/tqsqlrecord.cpp b/src/sql/tqsqlrecord.cpp index fba3d9e63..72b8e4867 100644 --- a/src/sql/tqsqlrecord.cpp +++ b/src/sql/tqsqlrecord.cpp @@ -52,7 +52,7 @@ class TQSqlRecordPrivate public: class info { public: - info() : nogen(FALSE){} + info() : nogen(false){} ~info() {} info( const info& other ) : field( other.field ), nogen( other.nogen ) @@ -225,9 +225,9 @@ bool TQSqlRecord::checkDetach() if ( sh->count > 1 ) { sh->deref(); sh = new TQSqlRecordShared( new TQSqlRecordPrivate( *sh->d ) ); - return TRUE; + return true; } - return FALSE; + return false; } /*! @@ -414,8 +414,8 @@ void TQSqlRecord::clear() } /*! - Returns TRUE if there are no fields in the record; otherwise - returns FALSE. + Returns true if there are no fields in the record; otherwise + returns false. */ bool TQSqlRecord::isEmpty() const @@ -425,22 +425,22 @@ bool TQSqlRecord::isEmpty() const /*! - Returns TRUE if there is a field in the record called \a name; - otherwise returns FALSE. + Returns true if there is a field in the record called \a name; + otherwise returns false. */ bool TQSqlRecord::contains( const TQString& name ) const { for ( uint i = 0; i < count(); ++i ) { if ( fieldName(i).upper() == name.upper() ) - return TRUE; + return true; } - return FALSE; + return false; } /*! Clears the value of all fields in the record. If \a nullify is - TRUE, (the default is FALSE), each field is set to NULL. + true, (the default is false), each field is set to NULL. */ void TQSqlRecord::clearValues( bool nullify ) @@ -456,7 +456,7 @@ void TQSqlRecord::clearValues( bool nullify ) /*! Sets the generated flag for the field called \a name to \a generated. If the field does not exist, nothing happens. Only - fields that have \a generated set to TRUE are included in the SQL + fields that have \a generated set to true are included in the SQL that is generated, e.g. by TQSqlCursor. \sa isGenerated() @@ -494,7 +494,7 @@ bool TQSqlRecord::isNull( int i ) if ( f ) { return f->isNull(); } - return TRUE; + return true; } /*! @@ -509,8 +509,8 @@ bool TQSqlRecord::isNull( const TQString& name ) /*! \overload - Returns TRUE if the field \a i is NULL or if there is no field at - position \a i; otherwise returns FALSE. + Returns true if the field \a i is NULL or if there is no field at + position \a i; otherwise returns false. \sa fieldName() */ @@ -520,12 +520,12 @@ bool TQSqlRecord::isNull( int i ) const if ( f ) { return f->isNull(); } - return TRUE; + return true; } /*! - Returns TRUE if the field called \a name is NULL or if there is no - field called \a name; otherwise returns FALSE. + Returns true if the field called \a name is NULL or if there is no + field called \a name; otherwise returns false. \sa position() */ @@ -560,8 +560,8 @@ void TQSqlRecord::setNull( const TQString& name ) /*! - Returns TRUE if the record has a field called \a name and this - field is to be generated (the default); otherwise returns FALSE. + Returns true if the record has a field called \a name and this + field is to be generated (the default); otherwise returns false. \sa setGenerated() */ @@ -573,15 +573,15 @@ bool TQSqlRecord::isGenerated( const TQString& name ) const /*! \overload - Returns TRUE if the record has a field at position \a i and this - field is to be generated (the default); otherwise returns FALSE. + Returns true if the record has a field at position \a i and this + field is to be generated (the default); otherwise returns false. \sa setGenerated() */ bool TQSqlRecord::isGenerated( int i ) const { if ( !field( i ) ) - return FALSE; + return false; return !sh->d->fieldInfo( i )->nogen; } @@ -601,13 +601,13 @@ bool TQSqlRecord::isGenerated( int i ) const TQString TQSqlRecord::toString( const TQString& prefix, const TQString& sep ) const { TQString pflist; - bool comma = FALSE; + bool comma = false; for ( uint i = 0; i < count(); ++i ){ if ( isGenerated( field(i)->name() ) ) { if( comma ) pflist += sep + " "; pflist += createField( i, prefix ); - comma = TRUE; + comma = true; } } return pflist; @@ -617,7 +617,7 @@ TQString TQSqlRecord::toString( const TQString& prefix, const TQString& sep ) co Returns a list of all the record's field names, each having the prefix \a prefix. - Note that fields which have generated set to FALSE are \e not + Note that fields which have generated set to false are \e not included. (See \l{isGenerated()}). If \a prefix is supplied, e.g. a table name, all fields are prefixed in the form: diff --git a/src/sql/tqsqlrecord.h b/src/sql/tqsqlrecord.h index bf0d981d8..cc77dcb78 100644 --- a/src/sql/tqsqlrecord.h +++ b/src/sql/tqsqlrecord.h @@ -98,7 +98,7 @@ public: bool isEmpty() const; bool contains( const TQString& name ) const; virtual void clear(); - virtual void clearValues( bool nullify = FALSE ); + virtual void clearValues( bool nullify = false ); uint count() const; virtual TQString toString( const TQString& prefix = TQString::null, const TQString& sep = "," ) const; diff --git a/src/sql/tqsqlresult.cpp b/src/sql/tqsqlresult.cpp index 05559290e..fc32b46d3 100644 --- a/src/sql/tqsqlresult.cpp +++ b/src/sql/tqsqlresult.cpp @@ -76,13 +76,13 @@ public: db. The object is initialized to an inactive state. */ -TQSqlResult::TQSqlResult( const TQSqlDriver * db ): forwardOnly( FALSE ) +TQSqlResult::TQSqlResult( const TQSqlDriver * db ): forwardOnly( false ) { d = new TQSqlResultPrivate(); d->sqldriver = db; d->idx = TQSql::BeforeFirst; - d->isSel = FALSE; - d->active = FALSE; + d->isSel = false; + d->active = false; d->ext = new TQSqlExtension(); } @@ -127,28 +127,27 @@ int TQSqlResult::at() const /*! - Returns TRUE if the result is positioned on a valid record (that + Returns true if the result is positioned on a valid record (that is, the result is not positioned before the first or after the - last record); otherwise returns FALSE. + last record); otherwise returns false. */ bool TQSqlResult::isValid() const { - return ( d->idx != TQSql::BeforeFirst && \ - d->idx != TQSql::AfterLast ) ? TRUE : FALSE; + return (d->idx != TQSql::BeforeFirst && d->idx != TQSql::AfterLast); } /*! \fn bool TQSqlResult::isNull( int i ) - Returns TRUE if the field at position \a i is NULL; otherwise - returns FALSE. + Returns true if the field at position \a i is NULL; otherwise + returns false. */ /*! - Returns TRUE if the result has records to be retrieved; otherwise - returns FALSE. + Returns true if the result has records to be retrieved; otherwise + returns false. */ bool TQSqlResult::isActive() const @@ -172,8 +171,8 @@ void TQSqlResult::setAt( int at ) /*! Protected function provided for derived classes to indicate whether or not the current statement is a SQL SELECT statement. - The \a s parameter should be TRUE if the statement is a SELECT - statement, or FALSE otherwise. + The \a s parameter should be true if the statement is a SELECT + statement, or false otherwise. */ void TQSqlResult::setSelect( bool s ) @@ -182,8 +181,8 @@ void TQSqlResult::setSelect( bool s ) } /*! - Returns TRUE if the current result is from a SELECT statement; - otherwise returns FALSE. + Returns true if the current result is from a SELECT statement; + otherwise returns false. */ bool TQSqlResult::isSelect() const @@ -265,8 +264,8 @@ TQSqlError TQSqlResult::lastError() const apply the \a query to the database. This function is called only after the result is set to an inactive state and is positioned before the first record of the new result. Derived classes should - return TRUE if the query was successful and ready to be used, - or FALSE otherwise. + return true if the query was successful and ready to be used, + or false otherwise. */ /*! @@ -275,8 +274,8 @@ TQSqlError TQSqlResult::lastError() const Positions the result to an arbitrary (zero-based) index \a i. This function is only called if the result is in an active state. Derived classes must reimplement this function and position the result to the - index \a i, and call setAt() with an appropriate value. Return TRUE - to indicate success, or FALSE to signify failure. + index \a i, and call setAt() with an appropriate value. Return true + to indicate success, or false to signify failure. */ /*! @@ -286,7 +285,7 @@ TQSqlError TQSqlResult::lastError() const function is only called if the result is in an active state. Derived classes must reimplement this function and position the result to the first record, and call setAt() with an appropriate value. - Return TRUE to indicate success, or FALSE to signify failure. + Return true to indicate success, or false to signify failure. */ /*! @@ -296,7 +295,7 @@ TQSqlError TQSqlResult::lastError() const function is only called if the result is in an active state. Derived classes must reimplement this function and position the result to the last record, and call setAt() with an appropriate value. - Return TRUE to indicate success, or FALSE to signify failure. + Return true to indicate success, or false to signify failure. */ /*! @@ -305,7 +304,7 @@ TQSqlError TQSqlResult::lastError() const The default implementation calls fetch() with the next index. Derived classes can reimplement this function and position the result to the next record in some other way, and call setAt() with an - appropriate value. Return TRUE to indicate success, or FALSE to + appropriate value. Return true to indicate success, or false to signify failure. */ @@ -320,7 +319,7 @@ bool TQSqlResult::fetchNext() state. The default implementation calls fetch() with the previous index. Derived classes can reimplement this function and position the result to the next record in some other way, and call setAt() with - an appropriate value. Return TRUE to indicate success, or FALSE to + an appropriate value. Return true to indicate success, or false to signify failure. */ @@ -330,8 +329,8 @@ bool TQSqlResult::fetchPrev() } /*! - Returns TRUE if you can only scroll forward through a result set; - otherwise returns FALSE. + Returns true if you can only scroll forward through a result set; + otherwise returns false. */ bool TQSqlResult::isForwardOnly() const { @@ -339,7 +338,7 @@ bool TQSqlResult::isForwardOnly() const } /*! - Sets forward only mode to \a forward. If forward is TRUE only + Sets forward only mode to \a forward. If forward is true only fetchNext() is allowed for navigating the results. Forward only mode needs far less memory since results do not have to be cached. forward only mode is off by default. diff --git a/src/sql/tqsqlselectcursor.cpp b/src/sql/tqsqlselectcursor.cpp index 77d0548ce..57a4a43ab 100644 --- a/src/sql/tqsqlselectcursor.cpp +++ b/src/sql/tqsqlselectcursor.cpp @@ -46,7 +46,7 @@ class TQSqlSelectCursorPrivate { public: - TQSqlSelectCursorPrivate() : populated( FALSE ) {} + TQSqlSelectCursorPrivate() : populated( false ) {} TQString query; bool populated : 1; }; @@ -72,7 +72,7 @@ public: ... TQSqlSelectCursor* cur = new TQSqlSelectCursor( "SELECT id, firstname, lastname FROM author" ); TQDataTable* table = new TQDataTable( this ); - table->setSqlCursor( cur, TRUE, TRUE ); + table->setSqlCursor( cur, true, true ); table->refresh(); ... cur->exec( "SELECT * FROM books" ); @@ -85,7 +85,7 @@ public: Constructs a read only cursor on database \a db using the query \a query. */ TQSqlSelectCursor::TQSqlSelectCursor( const TQString& query, TQSqlDatabase* db ) - : TQSqlCursor( TQString::null, FALSE, db ) + : TQSqlCursor( TQString::null, false, db ) { d = new TQSqlSelectCursorPrivate; d->query = query; @@ -140,7 +140,7 @@ void TQSqlSelectCursor::populateCursor() TQSqlRecordInfo inf = driver()->recordInfo( *(TQSqlQuery*)this ); for ( TQSqlRecordInfo::const_iterator it = inf.begin(); it != inf.end(); ++it ) TQSqlCursor::append( *it ); - d->populated = TRUE; + d->populated = true; } /*! \fn TQSqlIndex TQSqlSelectCursor::primaryIndex( bool ) const diff --git a/src/sql/tqsqlselectcursor.h b/src/sql/tqsqlselectcursor.h index 13069ee6a..37a3b9190 100644 --- a/src/sql/tqsqlselectcursor.h +++ b/src/sql/tqsqlselectcursor.h @@ -65,7 +65,7 @@ public: bool select() { return TQSqlCursor::select(); } protected: - TQSqlIndex primaryIndex( bool = TRUE ) const { return TQSqlIndex(); } + TQSqlIndex primaryIndex( bool = true ) const { return TQSqlIndex(); } TQSqlIndex index( const TQStringList& ) const { return TQSqlIndex(); } TQSqlIndex index( const TQString& ) const { return TQSqlIndex(); } TQSqlIndex index( const char* ) const { return TQSqlIndex(); } @@ -76,20 +76,20 @@ protected: void clear() {} void setGenerated( const TQString&, bool ) {} void setGenerated( int, bool ) {} - TQSqlRecord* editBuffer( bool = FALSE ) { return 0; } + TQSqlRecord* editBuffer( bool = false ) { return 0; } TQSqlRecord* primeInsert() { return 0; } TQSqlRecord* primeUpdate() { return 0; } TQSqlRecord* primeDelete() { return 0; } - int insert( bool = TRUE ) { return 0; } - int update( bool = TRUE ) { return 0; } - int del( bool = TRUE ) { return 0; } + int insert( bool = true ) { return 0; } + int update( bool = true ) { return 0; } + int del( bool = true ) { return 0; } void setMode( int ) {} void setSort( const TQSqlIndex& ) {} TQSqlIndex sort() const { return TQSqlIndex(); } void setFilter( const TQString& ) {} TQString filter() const { return TQString::null; } - void setName( const TQString&, bool = TRUE ) {} + void setName( const TQString&, bool = true ) {} TQString name() const { return TQString::null; } TQString toString( const TQString& = TQString::null, const TQString& = "," ) const { return TQString::null; } bool select( const TQString &, const TQSqlIndex& = TQSqlIndex() ); diff --git a/src/styles/tqcdestyle.cpp b/src/styles/tqcdestyle.cpp index 2c3b103da..61b39ed4f 100644 --- a/src/styles/tqcdestyle.cpp +++ b/src/styles/tqcdestyle.cpp @@ -68,7 +68,7 @@ /*! Constructs a TQCDEStyle. - If \a useHighlightCols is FALSE (the default), then the style will + If \a useHighlightCols is false (the default), then the style will polish the application's color palette to emulate the Motif way of highlighting, which is a simple inversion between the base and the text color. @@ -125,7 +125,7 @@ void TQCDEStyle::drawControl( ControlElement element, case CE_MenuBarItem: { if ( how & Style_Active ) // active item - qDrawShadePanel( p, r, cg, TRUE, 1, + qDrawShadePanel( p, r, cg, true, 1, &cg.brush( TQColorGroup::Button ) ); else // other item p->fillRect( r, cg.brush( TQColorGroup::Button ) ); @@ -341,7 +341,7 @@ void TQCDEStyle::drawPrimitive( PrimitiveElement pe, p->setPen( pen ); p->setBrush( brush ); - p->setWorldMatrix( matrix, TRUE ); // set transformation matrix + p->setWorldMatrix( matrix, true ); // set transformation matrix p->drawPolygon( bFill ); // fill arrow p->setBrush( NoBrush ); // don't fill diff --git a/src/styles/tqcdestyle.h b/src/styles/tqcdestyle.h index 200360bd5..c31559ea7 100644 --- a/src/styles/tqcdestyle.h +++ b/src/styles/tqcdestyle.h @@ -59,7 +59,7 @@ class TQ_EXPORT_STYLE_CDE TQCDEStyle : public TQMotifStyle TQ_OBJECT public: - TQCDEStyle( bool useHighlightCols = FALSE ); + TQCDEStyle( bool useHighlightCols = false ); virtual ~TQCDEStyle(); int pixelMetric( PixelMetric metric, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget *widget = 0 ) const; diff --git a/src/styles/tqcommonstyle.cpp b/src/styles/tqcommonstyle.cpp index a18604f48..bf1001a7d 100644 --- a/src/styles/tqcommonstyle.cpp +++ b/src/styles/tqcommonstyle.cpp @@ -963,7 +963,7 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe, break; case PE_StatusBarSection: - qDrawShadeRect( p, r, cg, TRUE, 1, 0, 0 ); + qDrawShadeRect( p, r, cg, true, 1, 0, 0 ); break; case PE_ButtonCommand: @@ -1162,14 +1162,14 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe, int lw = opt.isDefault() ? pixelMetric(PM_DockWindowFrameWidth, ceData, elementFlags) : opt.lineWidth(); - qDrawShadePanel(p, r, cg, FALSE, lw); + qDrawShadePanel(p, r, cg, false, lw); break; } case PE_PanelMenuBar: { int lw = opt.isDefault() ? pixelMetric(PM_MenuBarFrameWidth, ceData, elementFlags) : opt.lineWidth(); - qDrawShadePanel(p, r, cg, FALSE, lw, &cg.brush(TQColorGroup::Button)); + qDrawShadePanel(p, r, cg, false, lw, &cg.brush(TQColorGroup::Button)); break; } case PE_SizeGrip: { @@ -1555,7 +1555,7 @@ void TQCommonStyle::drawControl( ControlElement element, } #endif // TQT_NO_TOOLBOX case CE_ProgressBarGroove: - qDrawShadePanel(p, r, cg, TRUE, 1, &cg.brush(TQColorGroup::Background)); + qDrawShadePanel(p, r, cg, true, 1, &cg.brush(TQColorGroup::Background)); break; #ifndef TQT_NO_PROGRESSBAR @@ -1726,14 +1726,14 @@ void TQCommonStyle::drawControl( ControlElement element, pr.addCoords( 0, 1, 0, -fh-3 ); tr.addCoords( 0, pr.bottom(), 0, -3 ); pr.moveBy(shiftX, shiftY); - drawItem( p, pr, AlignCenter, cg, TRUE, &pm, TQString::null ); + drawItem( p, pr, AlignCenter, cg, true, &pm, TQString::null ); alignment |= AlignCenter; } else { pr.setWidth( pm.width() + 8 ); tr.addCoords( pr.right(), 0, 0, 0 ); pr.moveBy(shiftX, shiftY); - drawItem( p, pr, AlignCenter, cg, TRUE, &pm, TQString::null ); + drawItem( p, pr, AlignCenter, cg, true, &pm, TQString::null ); alignment |= AlignLeft | AlignVCenter; } @@ -1743,7 +1743,7 @@ void TQCommonStyle::drawControl( ControlElement element, ceData.textLabel.length(), &btext); } else { rect.moveBy(shiftX, shiftY); - drawItem( p, rect, AlignCenter, cg, TRUE, &pm, TQString::null ); + drawItem( p, rect, AlignCenter, cg, true, &pm, TQString::null ); } } } @@ -2330,7 +2330,7 @@ void TQCommonStyle::drawComplexControl( ComplexControl control, } TQRect ir; - bool down = FALSE; + bool down = false; TQPixmap pm; if ( controls & SC_TitleBarCloseButton ) { @@ -2351,7 +2351,7 @@ void TQCommonStyle::drawComplexControl( ComplexControl control, if( down ) p->translate( pixelMetric(PM_ButtonShiftHorizontal, ceData, elementFlags, widget), pixelMetric(PM_ButtonShiftVertical, ceData, elementFlags, widget) ); - drawItem( p, ir, AlignCenter, ceData.colorGroup, TRUE, &pm, TQString::null ); + drawItem( p, ir, AlignCenter, ceData.colorGroup, true, &pm, TQString::null ); p->restore(); } @@ -2368,7 +2368,7 @@ void TQCommonStyle::drawComplexControl( ComplexControl control, if( down ) p->translate( pixelMetric(PM_ButtonShiftHorizontal, ceData, elementFlags, widget), pixelMetric(PM_ButtonShiftVertical, ceData, elementFlags, widget) ); - drawItem( p, ir, AlignCenter, ceData.colorGroup, TRUE, &pm, TQString::null ); + drawItem( p, ir, AlignCenter, ceData.colorGroup, true, &pm, TQString::null ); p->restore(); } @@ -2389,7 +2389,7 @@ void TQCommonStyle::drawComplexControl( ComplexControl control, if( down ) p->translate( pixelMetric(PM_ButtonShiftHorizontal, ceData, elementFlags, widget), pixelMetric(PM_ButtonShiftVertical, ceData, elementFlags, widget) ); - drawItem( p, ir, AlignCenter, ceData.colorGroup, TRUE, &pm, TQString::null ); + drawItem( p, ir, AlignCenter, ceData.colorGroup, true, &pm, TQString::null ); p->restore(); } @@ -2404,7 +2404,7 @@ void TQCommonStyle::drawComplexControl( ComplexControl control, if( down ) p->translate( pixelMetric(PM_ButtonShiftHorizontal, ceData, elementFlags, widget), pixelMetric(PM_ButtonShiftVertical, ceData, elementFlags, widget) ); - drawItem( p, ir, AlignCenter, ceData.colorGroup, TRUE, &pm, TQString::null ); + drawItem( p, ir, AlignCenter, ceData.colorGroup, true, &pm, TQString::null ); p->restore(); } @@ -2419,7 +2419,7 @@ void TQCommonStyle::drawComplexControl( ComplexControl control, if( down ) p->translate( pixelMetric(PM_ButtonShiftHorizontal, ceData, elementFlags, widget), pixelMetric(PM_ButtonShiftVertical, ceData, elementFlags, widget) ); - drawItem( p, ir, AlignCenter, ceData.colorGroup, TRUE, &pm, TQString::null ); + drawItem( p, ir, AlignCenter, ceData.colorGroup, true, &pm, TQString::null ); p->restore(); } } @@ -2427,7 +2427,7 @@ void TQCommonStyle::drawComplexControl( ComplexControl control, if ( controls & SC_TitleBarSysMenu ) { if ( !ceData.icon.isNull() ) { ir = visualRect( querySubControlMetrics( CC_TitleBar, ceData, elementFlags, SC_TitleBarSysMenu, TQStyleOption::Default, widget ), ceData, elementFlags ); - drawItem( p, ir, AlignCenter, ceData.colorGroup, TRUE, (ceData.icon.isNull())?NULL:&ceData.icon, TQString::null ); + drawItem( p, ir, AlignCenter, ceData.colorGroup, true, (ceData.icon.isNull())?NULL:&ceData.icon, TQString::null ); } } #endif @@ -2441,7 +2441,7 @@ void TQCommonStyle::drawComplexControl( ComplexControl control, PrimitiveElement pe; if ( controls & SC_SpinWidgetFrame ) - qDrawWinPanel( p, r, cg, TRUE ); //cstyle == Sunken ); + qDrawWinPanel( p, r, cg, true ); //cstyle == Sunken ); if ( controls & SC_SpinWidgetUp ) { flags = Style_Default | Style_Enabled; diff --git a/src/styles/tqcompactstyle.cpp b/src/styles/tqcompactstyle.cpp index 440c379e4..83a6c8656 100644 --- a/src/styles/tqcompactstyle.cpp +++ b/src/styles/tqcompactstyle.cpp @@ -331,9 +331,9 @@ void TQCompactStyle::drawPrimitive( PrimitiveElement pe, int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL); if ( act && !dis ) { - qDrawShadePanel( p, x, y, checkcol, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Button ) ); + qDrawShadePanel( p, x, y, checkcol, h, cg, true, 1, &cg.brush( TQColorGroup::Button ) ); } else { - qDrawShadePanel( p, x, y, checkcol, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) ); + qDrawShadePanel( p, x, y, checkcol, h, cg, true, 1, &cg.brush( TQColorGroup::Midlight ) ); } } break; @@ -341,7 +341,7 @@ void TQCompactStyle::drawPrimitive( PrimitiveElement pe, { int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL); - qDrawShadePanel( p, x, y, checkcol, h, cg, FALSE, 1, &cg.brush( TQColorGroup::Button ) ); + qDrawShadePanel( p, x, y, checkcol, h, cg, false, 1, &cg.brush( TQColorGroup::Button ) ); } break; case PE_MenuItemIndicatorCheck: diff --git a/src/styles/tqinterlacestyle.cpp b/src/styles/tqinterlacestyle.cpp index a0cd70c58..01e166a7a 100644 --- a/src/styles/tqinterlacestyle.cpp +++ b/src/styles/tqinterlacestyle.cpp @@ -74,7 +74,7 @@ */ TQInterlaceStyle::TQInterlaceStyle() : TQMotifStyle() { - setUseHighlightColors( TRUE ); + setUseHighlightColors( true ); } /*! \reimp @@ -133,7 +133,7 @@ void TQInterlaceStyle::polish( TQApplication *app) dcg.setColor( TQColorGroup::ButtonText, low ); dcg.setColor( TQColorGroup::Text, low ); - app->setPalette( TQPalette( cg, dcg, cg ), TRUE ); + app->setPalette( TQPalette( cg, dcg, cg ), true ); } /*! @@ -141,7 +141,7 @@ void TQInterlaceStyle::polish( TQApplication *app) */ void TQInterlaceStyle::unPolish( TQApplication *app) { - app->setPalette(oldPalette, TRUE); + app->setPalette(oldPalette, true); } /*! @@ -162,7 +162,7 @@ void TQInterlaceStyle::polish( TQWidget* w) if ( w->inherits("TQGroupBox") || w->inherits("TQTabWidget") || w->inherits("TQPushButton") ) { - w->setAutoMask( TRUE ); + w->setAutoMask( true ); return; } if (w->inherits("TQLabel") @@ -220,7 +220,7 @@ void TQInterlaceStyle::unPolish( TQWidget* w) if ( w->inherits("TQGroupBox") || w->inherits("TQTabWidget") || w->inherits("TQPushButton" ) ) { - w->setAutoMask( FALSE ); + w->setAutoMask( false ); return; } if (w->inherits("TQLabel") @@ -313,7 +313,7 @@ void TQInterlaceStyle::drawButtonMask( TQPainter * p, int x, int y, int w, int h TQBrush fill( color1 ); TQColorGroup cg; cg.setBrush( TQColorGroup::Dark, color1 ); - drawButton( p, x, y, w, h, cg, FALSE, &fill ); + drawButton( p, x, y, w, h, cg, false, &fill ); } /*! @@ -341,11 +341,11 @@ void TQInterlaceStyle::drawPushButton( TQPushButton* btn, TQPainter *p) if ( btn->hasFocus() ) g.setBrush( TQColorGroup::Dark, black ); - drawButton( p, x1, y1, x2-x1+1, y2-y1+1, g, FALSE, &fill ); + drawButton( p, x1, y1, x2-x1+1, y2-y1+1, g, false, &fill ); if ( btn->isMenuButton() ) { int dx = (y1-y2-4)/3; - drawArrow( p, DownArrow, FALSE, + drawArrow( p, DownArrow, false, x2 - dx, dx, y1, y2 - y1, g, btn->isEnabled() ); } @@ -382,7 +382,7 @@ void TQInterlaceStyle::drawIndicator( TQPainter * p, int x, int y, int w, int h, else fill = g.brush( enabled ? TQColorGroup::Base : TQColorGroup::Background ); - drawButton( p, x, y, w, h, g, FALSE, &fill ); + drawButton( p, x, y, w, h, g, false, &fill ); if ( s != TQButton::Off ) { TQPointArray a( 7*2 ); @@ -522,9 +522,9 @@ void TQInterlaceStyle::drawComboButton( TQPainter *p, int x, int y, int w, int h int awh, ax, ay, sh, sy, dh, ew; get_combo_parameters( buttonRect(x,y,w,h), ew, awh, ax, ay, sh, dh, sy ); - drawButton( p, x, y, w, h, g, FALSE, &fill ); + drawButton( p, x, y, w, h, g, false, &fill ); - qDrawArrow( p, DownArrow, MotifStyle, FALSE, ax, ay, awh, awh, g, TRUE ); + qDrawArrow( p, DownArrow, MotifStyle, false, ax, ay, awh, awh, g, true ); p->setPen( g.dark() ); p->drawRect( ax+1, sy+1, awh-1, sh-1 ); @@ -626,7 +626,7 @@ void TQInterlaceStyle::drawScrollBarControls( TQPainter* p, const TQScrollBar* s } if ( controls == (AddLine | SubLine | AddPage | SubPage | Slider | First | Last ) ) - drawPanel( p, 0, 0, sb->width(), sb->height(), g, FALSE, 2, &fill ); + drawPanel( p, 0, 0, sb->width(), sb->height(), g, false, 2, &fill ); if (sliderStart > sliderMax) { // sanity check sliderStart = sliderMax; @@ -673,11 +673,11 @@ void TQInterlaceStyle::drawScrollBarControls( TQPainter* p, const TQScrollBar* s if ( controls & AddLine ) drawArrow( p, VERTICAL ? DownArrow : RightArrow, ADD_LINE_ACTIVE, addB.x(), addB.y(), - addB.width(), addB.height(), g, TRUE ); + addB.width(), addB.height(), g, true ); if ( controls & SubLine ) drawArrow( p, VERTICAL ? UpArrow : LeftArrow, SUB_LINE_ACTIVE, subB.x(), subB.y(), - subB.width(), subB.height(), g, TRUE ); + subB.width(), subB.height(), g, true ); if ( controls & SubPage ) p->fillRect( subPageR, fill ); @@ -691,7 +691,7 @@ void TQInterlaceStyle::drawScrollBarControls( TQPainter* p, const TQScrollBar* s if ( sliderR.isValid() ) drawButton( p, sliderR.x(), sliderR.y(), sliderR.width(), sliderR.height(), g, - FALSE, &g.brush( TQColorGroup::Button ) ); + false, &g.brush( TQColorGroup::Button ) ); p->setBrushOrigin(bo); } @@ -703,13 +703,13 @@ void TQInterlaceStyle::drawScrollBarControls( TQPainter* p, const TQScrollBar* s void TQInterlaceStyle::drawSlider ( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, Orientation orient, bool, bool) { p->fillRect( x, y, w, h, g.brush( TQColorGroup::Background ) ); - drawButton( p, x, y, w, h, g, FALSE, &g.brush( TQColorGroup::Button ) ); + drawButton( p, x, y, w, h, g, false, &g.brush( TQColorGroup::Button ) ); if ( orient == Horizontal ) { TQCOORD mid = x + w / 2; - qDrawShadeLine( p, mid, y , mid, y + h - 2, g, TRUE, 1); + qDrawShadeLine( p, mid, y , mid, y + h - 2, g, true, 1); } else { TQCOORD mid = y +h / 2; - qDrawShadeLine( p, x, mid, x + w - 2, mid, g, TRUE, 1); + qDrawShadeLine( p, x, mid, x + w - 2, mid, g, true, 1); } } @@ -723,9 +723,9 @@ void TQInterlaceStyle::drawSliderGroove ( TQPainter * p, int x, int y, int w, in p->setPen( NoPen ); if ( o == Horizontal ) - drawButton( p, x, y+h/2-3, w, 6, g, FALSE, &g.brush( TQColorGroup::Mid ) ); + drawButton( p, x, y+h/2-3, w, 6, g, false, &g.brush( TQColorGroup::Mid ) ); else - drawButton( p, x+w/2-3, y, 6, h, g, FALSE, &g.brush( TQColorGroup::Mid ) ); + drawButton( p, x+w/2-3, y, 6, h, g, false, &g.brush( TQColorGroup::Mid ) ); } @@ -753,7 +753,7 @@ void TQInterlaceStyle::drawSplitter( TQPainter *p, int x, int y, int w, int h, qDrawShadeLine( p, xPos, kPos + kSize - 1 , xPos, h, g ); drawPanel( p, xPos-sw/2+2, kPos, - kSize, kSize, g, FALSE, 2, + kSize, kSize, g, false, 2, &g.brush( TQColorGroup::Button )); qDrawShadeLine( p, xPos, 0, xPos, kPos, g ); } else { @@ -763,7 +763,7 @@ void TQInterlaceStyle::drawSplitter( TQPainter *p, int x, int y, int w, int h, qDrawShadeLine( p, 0, yPos, kPos, yPos, g ); drawPanel( p, kPos, yPos-sw/2+2, - kSize, kSize, g, FALSE, 2, + kSize, kSize, g, false, 2, &g.brush( TQColorGroup::Button )); qDrawShadeLine( p, kPos + kSize -1, yPos, w, yPos, g ); diff --git a/src/styles/tqinterlacestyle.h b/src/styles/tqinterlacestyle.h index 8c1982712..115e0d2ec 100644 --- a/src/styles/tqinterlacestyle.h +++ b/src/styles/tqinterlacestyle.h @@ -62,21 +62,21 @@ public: int defaultFrameWidth() const; TQRect pushButtonContentsRect( TQPushButton *btn ); - void drawFocusRect ( TQPainter *, const TQRect &, const TQColorGroup &, const TQColor * bg = 0, bool = FALSE ); + void drawFocusRect ( TQPainter *, const TQRect &, const TQColorGroup &, const TQColor * bg = 0, bool = false ); void drawButton( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken = FALSE, + const TQColorGroup &g, bool sunken = false, const TQBrush *fill = 0 ); void drawButtonMask ( TQPainter * p, int x, int y, int w, int h ); void drawBevelButton( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken = FALSE, + const TQColorGroup &g, bool sunken = false, const TQBrush *fill = 0 ); void drawPushButton( TQPushButton* btn, TQPainter *p); TQSize indicatorSize () const; - void drawIndicator ( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE ); + void drawIndicator ( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, int state, bool down = false, bool enabled = true ); void drawIndicatorMask( TQPainter *p, int x, int y, int w, int h, int ); TQSize exclusiveIndicatorSize () const; - void drawExclusiveIndicator( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, bool on, bool down = FALSE, bool enabled = TRUE ); + void drawExclusiveIndicator( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, bool on, bool down = false, bool enabled = true ); void drawExclusiveIndicatorMask( TQPainter * p, int x, int y, int w, int h, bool ); TQRect comboButtonRect ( int x, int y, int w, int h ); void drawComboButton( TQPainter *p, int x, int y, int w, int h, const TQColorGroup &g, bool sunken, bool editable, bool enabled, const TQBrush *fb ); diff --git a/src/styles/tqmotifplusstyle.cpp b/src/styles/tqmotifplusstyle.cpp index 6c9075495..8b13cb538 100644 --- a/src/styles/tqmotifplusstyle.cpp +++ b/src/styles/tqmotifplusstyle.cpp @@ -65,7 +65,7 @@ struct TQMotifPlusStylePrivate { TQMotifPlusStylePrivate() - : hovering(FALSE), sliderActive(FALSE), mousePressed(FALSE), + : hovering(false), sliderActive(false), mousePressed(false), scrollbarElement(0), lastElement(0), ref(1) { ; } @@ -144,11 +144,11 @@ static void drawMotifPlusShade(TQPainter *p, /*! Constructs a TQMotifPlusStyle - If \a hoveringHighlight is TRUE (the default), then the style will + If \a hoveringHighlight is true (the default), then the style will not highlight push buttons, checkboxes, radiobuttons, comboboxes, scrollbars or sliders. */ -TQMotifPlusStyle::TQMotifPlusStyle(bool hoveringHighlight) : TQMotifStyle(TRUE) +TQMotifPlusStyle::TQMotifPlusStyle(bool hoveringHighlight) : TQMotifStyle(true) { if ( !singleton ) singleton = new TQMotifPlusStylePrivate; @@ -650,7 +650,7 @@ void TQMotifPlusStyle::drawPrimitive( PrimitiveElement pe, case PE_PanelScrollBar: { - drawMotifPlusShade(p, r, cg, TRUE, FALSE, &cg.brush(TQColorGroup::Mid)); + drawMotifPlusShade(p, r, cg, true, false, &cg.brush(TQColorGroup::Mid)); break; } @@ -667,7 +667,7 @@ void TQMotifPlusStyle::drawPrimitive( PrimitiveElement pe, TQRect vrect = visualRect( TQRect( x+2, y+2, checkcol, h-2 ), r ); - qDrawShadePanel( p, vrect.x(), y+2, checkcol, h-2*2, cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) ); + qDrawShadePanel( p, vrect.x(), y+2, checkcol, h-2*2, cg, true, 1, &cg.brush( TQColorGroup::Midlight ) ); break; } @@ -717,7 +717,7 @@ void TQMotifPlusStyle::drawControl( ControlElement element, if ((elementFlags & CEF_IsDefault) || (elementFlags & CEF_AutoDefault)) { if (elementFlags & CEF_IsDefault) - drawMotifPlusShade(p, br, cg, TRUE, FALSE, + drawMotifPlusShade(p, br, cg, true, false, &cg.brush(TQColorGroup::Background)); br.setCoords(br.left() + dbi, @@ -745,7 +745,7 @@ void TQMotifPlusStyle::drawControl( ControlElement element, r -= visualRect(subRect(SR_CheckBoxIndicator, ceData, elementFlags, widget), ceData, elementFlags); p->setClipRegion(r); p->fillRect(ceData.rect, cg.brush(TQColorGroup::Midlight)); - p->setClipping(FALSE); + p->setClipping(false); } int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; @@ -768,7 +768,7 @@ void TQMotifPlusStyle::drawControl( ControlElement element, r -= visualRect(subRect(SR_RadioButtonIndicator, ceData, elementFlags, widget), ceData, elementFlags); p->setClipRegion(r); p->fillRect(ceData.rect, cg.brush(TQColorGroup::Midlight)); - p->setClipping(FALSE); + p->setClipping(false); } int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; @@ -791,7 +791,7 @@ void TQMotifPlusStyle::drawControl( ControlElement element, TQMenuItem *mi = opt.menuItem(); if ((flags & Style_Enabled) && (flags & Style_Active)) - drawMotifPlusShade(p, r, cg, FALSE, TRUE); + drawMotifPlusShade(p, r, cg, false, true); else p->fillRect(r, cg.button()); @@ -836,7 +836,7 @@ void TQMotifPlusStyle::drawControl( ControlElement element, } if ( act && !dis ) - drawMotifPlusShade(p, TQRect(x, y, w, h), cg, FALSE, TRUE); + drawMotifPlusShade(p, TQRect(x, y, w, h), cg, false, true); else p->fillRect(x, y, w, h, cg.brush( TQColorGroup::Button )); @@ -1161,7 +1161,7 @@ void TQMotifPlusStyle::drawComplexControl(ComplexControl control, first = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarFirst, opt, widget); last = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarLast, opt, widget); - bool skipUpdate = FALSE; + bool skipUpdate = false; if (singleton->hovering) { if (addline.contains(singleton->mousePos)) { skipUpdate = @@ -1286,7 +1286,7 @@ void TQMotifPlusStyle::drawComplexControl(ComplexControl control, editfield.addCoords(-3, -3, 3, 3); if (elementFlags & CEF_HasFocus) editfield.addCoords(1, 1, -1, -1); - drawMotifPlusShade(p, editfield, cg, TRUE, FALSE, + drawMotifPlusShade(p, editfield, cg, true, false, ((elementFlags & CEF_IsEnabled) ? &cg.brush(TQColorGroup::Base) : &cg.brush(TQColorGroup::Background))); @@ -1308,12 +1308,12 @@ void TQMotifPlusStyle::drawComplexControl(ComplexControl control, editfield.addCoords(-3, -3, 3, 3); if (elementFlags & CEF_HasFocus) editfield.addCoords(1, 1, -1, -1); - drawMotifPlusShade(p, editfield, cg, FALSE, + drawMotifPlusShade(p, editfield, cg, false, (flags & Style_MouseOver)); } if (controls & SC_ComboBoxArrow && arrow.isValid()) - drawMotifPlusShade(p, arrow, cg, FALSE, (flags & Style_MouseOver)); + drawMotifPlusShade(p, arrow, cg, false, (flags & Style_MouseOver)); } if ((elementFlags & CEF_HasFocus) || @@ -1331,7 +1331,7 @@ void TQMotifPlusStyle::drawComplexControl(ComplexControl control, SFlags flags = Style_Default; if (controls & SC_SpinWidgetFrame) - drawMotifPlusShade(p, r, cg, TRUE, FALSE, &cg.brush(TQColorGroup::Base)); + drawMotifPlusShade(p, r, cg, true, false, &cg.brush(TQColorGroup::Base)); if (controls & SC_SpinWidgetUp) { flags = Style_Enabled; @@ -1379,7 +1379,7 @@ void TQMotifPlusStyle::drawComplexControl(ComplexControl control, opt, widget); if ((controls & SC_SliderGroove) && groove.isValid()) { - drawMotifPlusShade(p, groove, cg, TRUE, FALSE, + drawMotifPlusShade(p, groove, cg, true, false, &cg.brush(TQColorGroup::Mid)); if ( flags & Style_HasFocus ) { @@ -1400,12 +1400,12 @@ void TQMotifPlusStyle::drawComplexControl(ComplexControl control, TQCOORD mid = handle.x() + handle.width() / 2; qDrawShadeLine( p, mid, handle.y() + 1, mid , handle.y() + handle.height() - 3, - cg, TRUE, 1); + cg, true, 1); } else { TQCOORD mid = handle.y() + handle.height() / 2; qDrawShadeLine( p, handle.x() + 1, mid, handle.x() + handle.width() - 3, mid, - cg, TRUE, 1); + cg, true, 1); } } @@ -1529,23 +1529,23 @@ bool TQMotifPlusStyle::objectEventHandler( const TQStyleControlElementData &ceDa switch(event->type()) { case TQEvent::MouseButtonPress: { - singleton->mousePressed = TRUE; + singleton->mousePressed = true; if (!ceData.widgetObjectTypes.contains("TQSlider")) break; - singleton->sliderActive = TRUE; + singleton->sliderActive = true; break; } case TQEvent::MouseButtonRelease: { - singleton->mousePressed = FALSE; + singleton->mousePressed = false; if (!ceData.widgetObjectTypes.contains("TQSlider")) break; - singleton->sliderActive = FALSE; + singleton->sliderActive = false; widgetActionRequest(ceData, elementFlags, source, WAR_Repaint); break; } @@ -1578,9 +1578,9 @@ bool TQMotifPlusStyle::objectEventHandler( const TQStyleControlElementData &ceDa singleton->mousePos = ((TQMouseEvent *) event)->pos(); if (! singleton->mousePressed) { - singleton->hovering = TRUE; + singleton->hovering = true; widgetActionRequest(ceData, elementFlags, source, WAR_Repaint); - singleton->hovering = FALSE; + singleton->hovering = false; } break; diff --git a/src/styles/tqmotifplusstyle.h b/src/styles/tqmotifplusstyle.h index 3cfca0677..df2bce409 100644 --- a/src/styles/tqmotifplusstyle.h +++ b/src/styles/tqmotifplusstyle.h @@ -59,7 +59,7 @@ class TQ_EXPORT_STYLE_MOTIFPLUS TQMotifPlusStyle : public TQMotifStyle TQ_OBJECT public: - TQMotifPlusStyle(bool hoveringHighlight = TRUE); + TQMotifPlusStyle(bool hoveringHighlight = true); virtual ~TQMotifPlusStyle(); void polish(TQPalette &pal); diff --git a/src/styles/tqmotifstyle.cpp b/src/styles/tqmotifstyle.cpp index 5e71d6813..2b80b1e12 100644 --- a/src/styles/tqmotifstyle.cpp +++ b/src/styles/tqmotifstyle.cpp @@ -91,7 +91,7 @@ static const int motifCheckMarkSpace = 12; /*! Constructs a TQMotifStyle. - If \a useHighlightCols is FALSE (the default), the style will + If \a useHighlightCols is false (the default), the style will polish the application's color palette to emulate the Motif way of highlighting, which is a simple inversion between the base and the text color. @@ -108,7 +108,7 @@ TQMotifStyle::~TQMotifStyle() } /*! - If \a arg is FALSE, the style will polish the application's color + If \a arg is false, the style will polish the application's color palette to emulate the Motif way of highlighting, which is a simple inversion between the base and the text color. @@ -124,10 +124,10 @@ void TQMotifStyle::setUseHighlightColors( bool arg ) } /*! - Returns TRUE if the style treats the highlight colors of the + Returns true if the style treats the highlight colors of the palette in a Motif-like manner, which is a simple inversion - between the base and the text color; otherwise returns FALSE. The - default is FALSE. + between the base and the text color; otherwise returns false. The + default is false. */ bool TQMotifStyle::useHighlightColors() const { @@ -678,7 +678,7 @@ void TQMotifStyle::drawPrimitive( PrimitiveElement pe, qDrawShadeLine( p, 0, yPos, kPos, yPos, cg ); qDrawShadePanel( p, kPos, yPos - sw / 2 + 1, kSize, kSize, - cg, FALSE, 1, &cg.brush( TQColorGroup::Button ) ); + cg, false, 1, &cg.brush( TQColorGroup::Button ) ); qDrawShadeLine( p, kPos + kSize - 1, yPos, r.width(), yPos, cg ); } else { TQCOORD xPos = r.x() + r.width() / 2; @@ -687,7 +687,7 @@ void TQMotifStyle::drawPrimitive( PrimitiveElement pe, qDrawShadeLine( p, xPos, kPos + kSize - 1, xPos, r.height(), cg ); qDrawShadePanel( p, xPos - sw / 2 + 1, kPos, kSize, kSize, cg, - FALSE, 1, &cg.brush( TQColorGroup::Button ) ); + false, 1, &cg.brush( TQColorGroup::Button ) ); qDrawShadeLine( p, xPos, 0, xPos, kPos, cg ); } break; @@ -731,9 +731,9 @@ void TQMotifStyle::drawPrimitive( PrimitiveElement pe, p->setPen( cg.text() ); p->drawLineSegments( a ); - qDrawShadePanel( p, posX-2, posY-2, markW+4, markH+6, cg, TRUE, dfw); + qDrawShadePanel( p, posX-2, posY-2, markW+4, markH+6, cg, true, dfw); } else - qDrawShadePanel( p, posX, posY, markW, markH, cg, TRUE, dfw, + qDrawShadePanel( p, posX, posY, markW, markH, cg, true, dfw, &cg.brush( TQColorGroup::Mid ) ); break; @@ -765,7 +765,7 @@ void TQMotifStyle::drawPrimitive( PrimitiveElement pe, break; case PE_PanelScrollBar: - qDrawShadePanel(p, r, cg, TRUE, + qDrawShadePanel(p, r, cg, true, pixelMetric(PM_DefaultFrameWidth, ceData, elementFlags), &cg.brush(TQColorGroup::Mid)); break; @@ -785,7 +785,7 @@ void TQMotifStyle::drawPrimitive( PrimitiveElement pe, TQRect vrect = visualRect( TQRect( x+motifItemFrame, y+motifItemFrame, checkcol, h-2*motifItemFrame ), r ); int xvis = vrect.x(); - qDrawShadePanel( p, xvis, y+motifItemFrame, checkcol, h-2*motifItemFrame, cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) ); + qDrawShadePanel( p, xvis, y+motifItemFrame, checkcol, h-2*motifItemFrame, cg, true, 1, &cg.brush( TQColorGroup::Midlight ) ); break; } @@ -867,7 +867,7 @@ void TQMotifStyle::drawControl( ControlElement element, x2 -= 2; y2 -= 2; } else { - qDrawShadePanel( p, r, newCg, TRUE ); + qDrawShadePanel( p, r, newCg, true ); } } if ( !( elementFlags & CEF_IsFlat ) || ( elementFlags & CEF_IsOn ) || ( elementFlags & CEF_IsDown ) ) { @@ -902,13 +902,13 @@ void TQMotifStyle::drawControl( ControlElement element, int dfw = pixelMetric( PM_DefaultFrameWidth, ceData, elementFlags, widget ); bool selected = flags & Style_Selected; int o = dfw > 1 ? 1 : 0; - bool lastTab = FALSE; + bool lastTab = false; TQRect r2( r ); if ( ceData.tabBarData.shape == TQTabBar::RoundedAbove ) { if ( styleHint( SH_TabBar_Alignment, ceData, elementFlags, TQStyleOption::Default, 0, widget ) == AlignRight && ceData.tabBarData.identIndexMap[t->identifier()] == ceData.tabBarData.tabCount-1 ) - lastTab = TRUE; + lastTab = true; if ( o ) { p->setPen( ceData.colorGroup.light() ); @@ -963,7 +963,7 @@ void TQMotifStyle::drawControl( ControlElement element, } else if ( ceData.tabBarData.shape == TQTabBar::RoundedBelow ) { if ( styleHint( SH_TabBar_Alignment, ceData, elementFlags, TQStyleOption::Default, 0, widget ) == AlignLeft && ceData.tabBarData.identIndexMap[t->identifier()] == ceData.tabBarData.tabCount-1 ) - lastTab = TRUE; + lastTab = true; if ( selected ) { p->fillRect( TQRect( r2.left()+1, r2.top(), r2.width()-3, 1), ceData.palette.active().brush( TQColorGroup::Background )); @@ -1010,7 +1010,7 @@ void TQMotifStyle::drawControl( ControlElement element, } case CE_ProgressBarGroove: - qDrawShadePanel(p, r, cg, TRUE, 2); + qDrawShadePanel(p, r, cg, true, 2); break; case CE_ProgressBarLabel: @@ -1083,10 +1083,10 @@ void TQMotifStyle::drawControl( ControlElement element, if ( act && !dis ) { // active item frame if (pixelMetric( PM_DefaultFrameWidth, ceData, elementFlags ) > 1) - qDrawShadePanel( p, x, y, w, h, cg, FALSE, pw, + qDrawShadePanel( p, x, y, w, h, cg, false, pw, &cg.brush( TQColorGroup::Button ) ); else - qDrawShadePanel( p, x+1, y+1, w-2, h-2, cg, TRUE, 1, + qDrawShadePanel( p, x+1, y+1, w-2, h-2, cg, true, 1, &cg.brush( TQColorGroup::Button ) ); } else // incognito frame @@ -1192,7 +1192,7 @@ void TQMotifStyle::drawControl( ControlElement element, case CE_MenuBarItem: { if ( flags & Style_Active ) // active item - qDrawShadePanel( p, r, cg, FALSE, motifItemFrame, + qDrawShadePanel( p, r, cg, false, motifItemFrame, &cg.brush(TQColorGroup::Button) ); else // other item p->fillRect( r, cg.brush(TQColorGroup::Button) ); @@ -1271,7 +1271,7 @@ void TQMotifStyle::drawComplexControl( ComplexControl control, case CC_SpinWidget: { SCFlags drawSub = SC_None; if ( sub & SC_SpinWidgetFrame ) - qDrawShadePanel( p, r, cg, TRUE, + qDrawShadePanel( p, r, cg, true, pixelMetric( PM_DefaultFrameWidth, ceData, elementFlags ) ); if ( sub & SC_SpinWidgetUp || sub & SC_SpinWidgetDown ) { @@ -1294,7 +1294,7 @@ void TQMotifStyle::drawComplexControl( ComplexControl control, opt, widget); if ((sub & SC_SliderGroove) && groove.isValid()) { - qDrawShadePanel( p, groove, cg, TRUE, 2, + qDrawShadePanel( p, groove, cg, true, 2, &cg.brush( TQColorGroup::Mid ) ); @@ -1311,12 +1311,12 @@ void TQMotifStyle::drawComplexControl( ComplexControl control, TQCOORD mid = handle.x() + handle.width() / 2; qDrawShadeLine( p, mid, handle.y(), mid, handle.y() + handle.height() - 2, - cg, TRUE, 1); + cg, true, 1); } else { TQCOORD mid = handle.y() + handle.height() / 2; qDrawShadeLine( p, handle.x(), mid, handle.x() + handle.width() - 2, mid, - cg, TRUE, 1); + cg, true, 1); } } @@ -1364,7 +1364,7 @@ void TQMotifStyle::drawComplexControl( ComplexControl control, TQRect er = TQStyle::visualRect( querySubControlMetrics( CC_ComboBox, ceData, elementFlags, SC_ComboBoxEditField, cb ), ceData, elementFlags ); er.addCoords( -1, -1, 1, 1); - qDrawShadePanel( p, er, cg, TRUE, 1, + qDrawShadePanel( p, er, cg, true, 1, &cg.brush( TQColorGroup::Button )); } } diff --git a/src/styles/tqmotifstyle.h b/src/styles/tqmotifstyle.h index e840de446..eaca499a6 100644 --- a/src/styles/tqmotifstyle.h +++ b/src/styles/tqmotifstyle.h @@ -60,7 +60,7 @@ class TQ_EXPORT_STYLE_MOTIF TQMotifStyle : public TQCommonStyle { TQ_OBJECT public: - TQMotifStyle( bool useHighlightCols=FALSE ); + TQMotifStyle( bool useHighlightCols=false ); virtual ~TQMotifStyle(); void setUseHighlightColors( bool ); diff --git a/src/styles/tqplatinumstyle.cpp b/src/styles/tqplatinumstyle.cpp index 4050f075e..71e9ae3ae 100644 --- a/src/styles/tqplatinumstyle.cpp +++ b/src/styles/tqplatinumstyle.cpp @@ -796,9 +796,9 @@ void TQPlatinumStyle::drawControl( ControlElement element, || ( (!ceData.fgPixmap.isNull()) && (ceData.rect.width() * ceData.rect.height() < 1600 || TQABS( ceData.rect.width() - ceData.rect.height()) < 10 )) ) - useBevelButton = TRUE; + useBevelButton = true; else - useBevelButton = FALSE; + useBevelButton = false; int diw = pixelMetric( PM_ButtonDefaultIndicator, ceData, elementFlags, widget ); if ( elementFlags & CEF_IsDefault ) { @@ -1119,7 +1119,7 @@ void TQPlatinumStyle::drawComplexControl( ComplexControl control, // end comboButtonRect... ir.setRect( ir.left() - 1, ir.top() - 1, ir.width() + 2, ir.height() + 2 ); - qDrawShadePanel( p, ir, cg, TRUE, 2, 0 ); + qDrawShadePanel( p, ir, cg, true, 2, 0 ); } } #endif @@ -1260,7 +1260,7 @@ void TQPlatinumStyle::drawComplexControl( ComplexControl control, p->drawLine( x1 + 1, y2 - 1, x2 -my + 2, y2 - 1 ); drawRiffles( p, handle.x(), handle.y() + 2, handle.width() - 3, - handle.height() - 4, cg, TRUE ); + handle.height() - 4, cg, true ); } else { // Horizontal TQBrush oldBrush = p->brush(); p->setBrush( cg.brush( TQColorGroup::Button ) ); @@ -1297,7 +1297,7 @@ void TQPlatinumStyle::drawComplexControl( ComplexControl control, p->drawLine( x1 + mx - 2, y2 - 1, x1 + mx + 2, y2 - 1 ); drawRiffles( p, handle.x() + 2, handle.y(), handle.width() - 4, - handle.height() - 5, cg, FALSE ); + handle.height() - 5, cg, false ); } } diff --git a/src/styles/tqsgistyle.cpp b/src/styles/tqsgistyle.cpp index 3574dc0d0..0a78be86f 100644 --- a/src/styles/tqsgistyle.cpp +++ b/src/styles/tqsgistyle.cpp @@ -109,7 +109,7 @@ public: /*! Constructs a TQSGIStyle. - If \a useHighlightCols is FALSE (default value), the style will + If \a useHighlightCols is false (default value), the style will polish the application's color palette to emulate the Motif way of highlighting, which is a simple inversion between the base and the text color. @@ -156,7 +156,7 @@ TQSGIStyle::applicationPolish( const TQStyleControlElementData &ceData, ControlE pal.setColor( TQPalette::Disabled, TQColorGroup::Highlight, pal.disabled().text() ); pal.setColor( TQPalette::Disabled, TQColorGroup::HighlightedText, pal.disabled().base() ); } - TQApplication::setPalette( pal, TRUE ); + TQApplication::setPalette( pal, true ); // different basecolor and highlighting in Q(Multi)LineEdit pal.setColor( TQColorGroup::Base, TQColor(211,181,181) ); @@ -167,15 +167,15 @@ TQSGIStyle::applicationPolish( const TQStyleControlElementData &ceData, ControlE pal.setColor( TQPalette::Disabled, TQColorGroup::Highlight, pal.disabled().midlight() ); pal.setColor( TQPalette::Disabled, TQColorGroup::HighlightedText, pal.disabled().text() ); - TQApplication::setPalette( pal, TRUE, "TQLineEdit" ); - TQApplication::setPalette( pal, TRUE, "TQTextEdit" ); - TQApplication::setPalette( pal, TRUE, "TQDateTimeEditBase" ); + TQApplication::setPalette( pal, true, "TQLineEdit" ); + TQApplication::setPalette( pal, true, "TQTextEdit" ); + TQApplication::setPalette( pal, true, "TQDateTimeEditBase" ); pal = TQApplication::palette(); pal.setColor( TQColorGroup::Button, pal.active().background() ); - TQApplication::setPalette( pal, TRUE, "TQMenuBar" ); - TQApplication::setPalette( pal, TRUE, "TQToolBar" ); - TQApplication::setPalette( pal, TRUE, "TQPopupMenu" ); + TQApplication::setPalette( pal, true, "TQMenuBar" ); + TQApplication::setPalette( pal, true, "TQToolBar" ); + TQApplication::setPalette( pal, true, "TQPopupMenu" ); } /*! \reimp @@ -184,7 +184,7 @@ void TQSGIStyle::applicationUnPolish( const TQStyleControlElementData&, ControlElementFlags, void * ) { TQFont f = TQApplication::font(); - TQApplication::setFont( f, TRUE ); // get rid of the special fonts for special widget classes + TQApplication::setFont( f, true ); // get rid of the special fonts for special widget classes } /*! @@ -241,16 +241,16 @@ TQSGIStyle::polish( const TQStyleControlElementData &ceData, ControlElementFlags #endif } else if ( ceData.widgetObjectTypes.contains("TQComboBox") ) { TQFont f = TQApplication::font(); - f.setBold( TRUE ); - f.setItalic( TRUE ); + f.setBold( true ); + f.setItalic( true ); widgetActionRequest(ceData, elementFlags, ptr, WAR_SetFont, TQStyleWidgetActionRequestData(f)); #ifndef TQT_NO_MENUBAR } else if ( ceData.widgetObjectTypes.contains("TQMenuBar") ) { widgetActionRequest(ceData, elementFlags, ptr, WAR_FrameSetStyle, TQStyleWidgetActionRequestData(TQFrame::StyledPanel | TQFrame::Raised)); widgetActionRequest(ceData, elementFlags, ptr, WAR_SetBackgroundMode, TQStyleWidgetActionRequestData(TQWidget::PaletteBackground)); TQFont f = TQApplication::font(); - f.setBold( TRUE ); - f.setItalic( TRUE ); + f.setBold( true ); + f.setItalic( true ); widgetActionRequest(ceData, elementFlags, ptr, WAR_SetFont, TQStyleWidgetActionRequestData(f)); #endif #ifndef TQT_NO_POPUPMENU @@ -258,8 +258,8 @@ TQSGIStyle::polish( const TQStyleControlElementData &ceData, ControlElementFlags TQStyleWidgetActionRequestData requestData; widgetActionRequest(ceData, elementFlags, ptr, WAR_FrameSetLineWidth, TQStyleWidgetActionRequestData(pixelMetric( PM_DefaultFrameWidth, TQStyleControlElementData(), CEF_None ) + 1)); TQFont f = TQApplication::font(); - f.setBold( TRUE ); - f.setItalic( TRUE ); + f.setBold( true ); + f.setItalic( true ); widgetActionRequest(ceData, elementFlags, ptr, WAR_SetFont, TQStyleWidgetActionRequestData(f)); #endif } else if ( (ceData.widgetObjectTypes.contains("TQToolBar")) || (ceData.widgetObjectTypes.contains("TQToolBarSeparator")) ) { @@ -494,7 +494,7 @@ static void drawSGIPrefix( TQPainter *p, int x, int y, TQString* miText ) { if ( miText && (!!(*miText)) ) { int amp = 0; - bool nextAmp = FALSE; + bool nextAmp = false; while ( ( amp = miText->find( '&', amp ) ) != -1 ) { if ( (uint)amp == miText->length()-1 ) return; @@ -826,7 +826,7 @@ void TQSGIStyle::drawPrimitive( PrimitiveElement pe, if ( !r.contains( d->mousePos ) ) flags &= ~Style_MouseOver; if ( r.isValid() ) - qDrawShadePanel( p, x, y, w, h, cg, FALSE, 1, hot ? &cg.brush( TQColorGroup::Midlight ) : &cg.brush( TQColorGroup::Button ) ); + qDrawShadePanel( p, x, y, w, h, cg, false, 1, hot ? &cg.brush( TQColorGroup::Midlight ) : &cg.brush( TQColorGroup::Button ) ); break; case PE_ScrollBarSlider: @@ -912,7 +912,7 @@ void TQSGIStyle::drawPrimitive( PrimitiveElement pe, r.rect(&x, &y, &w, &h); int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL); - drawPanel( p, x+sgiItemFrame, y+sgiItemFrame, checkcol, h-2*sgiItemFrame, cg, TRUE, 1, &cg.brush( TQColorGroup::Light ) ); + drawPanel( p, x+sgiItemFrame, y+sgiItemFrame, checkcol, h-2*sgiItemFrame, cg, true, 1, &cg.brush( TQColorGroup::Light ) ); } break; @@ -987,7 +987,7 @@ void TQSGIStyle::drawControl( ControlElement element, x2 -= 2; y2 -= 2; } else { - qDrawShadePanel( p, ceData.rect, cg, TRUE ); + qDrawShadePanel( p, ceData.rect, cg, true ); } } @@ -1032,10 +1032,10 @@ void TQSGIStyle::drawControl( ControlElement element, if ( act && !dis ) { if ( pixelMetric( PM_DefaultFrameWidth, ceData, elementFlags ) > 1 ) - drawPanel( p, x, y, w, h, cg, FALSE, pw, + drawPanel( p, x, y, w, h, cg, false, pw, &cg.brush( TQColorGroup::Light ) ); else - drawPanel( p, x+1, y+1, w-2, h-2, cg, FALSE, 1, + drawPanel( p, x+1, y+1, w-2, h-2, cg, false, 1, &cg.brush( TQColorGroup::Light ) ); } else { p->fillRect( x, y, w, h, cg.brush( TQColorGroup::Button ) ); @@ -1149,7 +1149,7 @@ void TQSGIStyle::drawControl( ControlElement element, if ( active ) { p->setPen( TQPen( cg.shadow(), 1) ); p->drawRect( x, y, w, h ); - qDrawShadePanel( p, TQRect(x+1,y+1,w-2,h-2), cg, FALSE, 2, + qDrawShadePanel( p, TQRect(x+1,y+1,w-2,h-2), cg, false, 2, &cg.brush( TQColorGroup::Light )); } else { p->fillRect( x, y, w, h, cg.brush( TQColorGroup::Button )); @@ -1231,11 +1231,11 @@ void TQSGIStyle::drawComplexControl( ComplexControl control, region = region.subtract( handle ); p->setClipRegion( region ); } else { - p->setClipping( FALSE ); + p->setClipping( false ); } - qDrawShadePanel( p, d->lastSliderRect.rect, cg, TRUE, 1, &cg.brush( TQColorGroup::Dark ) ); + qDrawShadePanel( p, d->lastSliderRect.rect, cg, true, 1, &cg.brush( TQColorGroup::Dark ) ); } - p->setClipping( FALSE ); + p->setClipping( false ); } if (( sub & SC_SliderHandle ) && handle.isValid()) { @@ -1247,12 +1247,12 @@ void TQSGIStyle::drawComplexControl( ComplexControl control, TQCOORD mid = handle.x() + handle.width() / 2; qDrawShadeLine( p, mid, handle.y(), mid, handle.y() + handle.height() - 2, - cg, TRUE, 1); + cg, true, 1); } else { TQCOORD mid = handle.y() + handle.height() / 2; qDrawShadeLine( p, handle.x(), mid, handle.x() + handle.width() - 2, mid, - cg, TRUE, 1); + cg, true, 1); } } @@ -1302,7 +1302,7 @@ void TQSGIStyle::drawComplexControl( ComplexControl control, er.addCoords( -1, -1, 1, 1); qDrawShadePanel( p, TQRect( er.x()-1, er.y()-1, er.width()+2, er.height()+2 ), - cg, TRUE, 1, &cg.brush( TQColorGroup::Button ) ); + cg, true, 1, &cg.brush( TQColorGroup::Button ) ); } } #endif @@ -1353,11 +1353,11 @@ void TQSGIStyle::drawComplexControl( ComplexControl control, region.subtract( handle ); p->setClipRegion( region ); } else { - p->setClipping( FALSE ); + p->setClipping( false ); } - qDrawShadePanel( p, d->lastScrollbarRect.rect, cg, TRUE, 1, &cg.brush( TQColorGroup::Dark ) ); + qDrawShadePanel( p, d->lastScrollbarRect.rect, cg, true, 1, &cg.brush( TQColorGroup::Dark ) ); } - p->setClipping( FALSE ); + p->setClipping( false ); } if ( sub & SC_ScrollBarSubPage ) { TQRect er = TQStyle::visualRect( querySubControlMetrics( CC_ScrollBar, ceData, elementFlags, SC_ScrollBarSubPage, opt, widget ), ceData, elementFlags ); @@ -1381,14 +1381,14 @@ void TQSGIStyle::drawComplexControl( ComplexControl control, region.subtract( handle ); p->setClipRegion( region ); } else { - p->setClipping( FALSE ); + p->setClipping( false ); } - qDrawShadePanel( p, d->lastScrollbarRect.rect, cg, TRUE, 1, &cg.brush( TQColorGroup::Dark ) ); + qDrawShadePanel( p, d->lastScrollbarRect.rect, cg, true, 1, &cg.brush( TQColorGroup::Dark ) ); } - p->setClipping( FALSE ); + p->setClipping( false ); } if ( sub & SC_ScrollBarSlider ) { - p->setClipping( FALSE ); + p->setClipping( false ); if ( subActive == SC_ScrollBarSlider ) flags |= Style_Active; diff --git a/src/styles/tqsgistyle.h b/src/styles/tqsgistyle.h index bd129ac53..0b65f3681 100644 --- a/src/styles/tqsgistyle.h +++ b/src/styles/tqsgistyle.h @@ -61,7 +61,7 @@ class TQ_EXPORT_STYLE_SGI TQSGIStyle: public TQMotifStyle { TQ_OBJECT public: - TQSGIStyle( bool useHighlightCols = FALSE ); + TQSGIStyle( bool useHighlightCols = false ); virtual ~TQSGIStyle(); #if !defined(Q_NO_USING_KEYWORD) diff --git a/src/styles/tqstylefactory.cpp b/src/styles/tqstylefactory.cpp index 05418b275..ed697dd8c 100644 --- a/src/styles/tqstylefactory.cpp +++ b/src/styles/tqstylefactory.cpp @@ -85,7 +85,7 @@ TQPluginManager<TQStyleFactoryInterface> *TQStyleFactoryPrivate::manager = 0; TQStyleFactoryPrivate::TQStyleFactoryPrivate() : TQObject( tqApp ) { - manager = new TQPluginManager<TQStyleFactoryInterface>( IID_QStyleFactory, TQApplication::libraryPaths(), "/styles", FALSE ); + manager = new TQPluginManager<TQStyleFactoryInterface>( IID_QStyleFactory, TQApplication::libraryPaths(), "/styles", false ); } TQStyleFactoryPrivate::~TQStyleFactoryPrivate() diff --git a/src/styles/tqstyleplugin.cpp b/src/styles/tqstyleplugin.cpp index 50e0e684d..9edadfc24 100644 --- a/src/styles/tqstyleplugin.cpp +++ b/src/styles/tqstyleplugin.cpp @@ -147,7 +147,7 @@ TQStyle *TQStylePluginPrivate::create( const TQString &key ) bool TQStylePluginPrivate::init() { - return TRUE; + return true; } void TQStylePluginPrivate::cleanup() diff --git a/src/styles/tqwindowsstyle.cpp b/src/styles/tqwindowsstyle.cpp index 02bd43720..38c126349 100644 --- a/src/styles/tqwindowsstyle.cpp +++ b/src/styles/tqwindowsstyle.cpp @@ -79,7 +79,7 @@ static const int windowsCheckMarkHMargin = 2; // horiz. margins of check mark static const int windowsRightBorder = 12; // right border on windows static const int windowsCheckMarkWidth = 12; // checkmarks width on windows -static bool use2000style = TRUE; +static bool use2000style = true; enum TQSliderDirection { SlUp, SlDown, SlLeft, SlRight }; @@ -110,7 +110,7 @@ TQWindowsStyle::Private::Private(TQWindowsStyle *parent) bool TQWindowsStyle::Private::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags, void* source, TQEvent *e ) { if (!(ceData.widgetObjectTypes.contains("TQWidget"))) { - return TRUE; + return true; } TQWidget *widget = reinterpret_cast<TQWidget*>(source); @@ -135,8 +135,8 @@ bool TQWindowsStyle::Private::objectEventHandler( const TQStyleControlElementDat if (menuBar && te->timerId() == menuBarTimer) { menuBar->killTimer(te->timerId()); menuBarTimer = 0; - menuBar->repaint(FALSE); - return TRUE; + menuBar->repaint(false); + return true; } } break; @@ -144,7 +144,7 @@ bool TQWindowsStyle::Private::objectEventHandler( const TQStyleControlElementDat break; } - return TRUE; + return true; } /*! @@ -177,7 +177,7 @@ bool TQWindowsStyle::objectEventHandler( const TQStyleControlElementData &ceData if (d) { return d->objectEventHandler(ceData, elementFlags, source, e); } - return TRUE; + return true; } /*! \reimp */ @@ -276,13 +276,13 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe, case PE_ButtonTool: { TQBrush fill; - bool stippled = FALSE; + bool stippled = false; if (! (flags & (Style_Down | Style_MouseOver)) && (flags & Style_On) && use2000style) { fill = TQBrush(cg.light(), Dense4Pattern); - stippled = TRUE; + stippled = true; } else fill = cg.brush(TQColorGroup::Button); @@ -329,7 +329,7 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe, else fill = cg.brush( TQColorGroup::Background ); - qDrawWinPanel( p, r, cg, TRUE, &fill ); + qDrawWinPanel( p, r, cg, true, &fill ); if (flags & Style_NoChange ) p->setPen( cg.dark() ); @@ -581,7 +581,7 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe, int xvis = vrect.x(); if ( act && !dis ) { - qDrawShadePanel( p, xvis, y, checkcol, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Button ) ); + qDrawShadePanel( p, xvis, y, checkcol, h, cg, true, 1, &cg.brush( TQColorGroup::Button ) ); } else { TQBrush fill( cg.light(), Dense4Pattern ); @@ -590,7 +590,7 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe, // a consistent look TQPoint origin = p->brushOrigin(); p->setBrushOrigin( xvis, y ); - qDrawShadePanel( p, xvis, y, checkcol, h, cg, TRUE, 1, &fill ); + qDrawShadePanel( p, xvis, y, checkcol, h, cg, true, 1, &fill ); // restore the previous brush origin p->setBrushOrigin( origin ); } @@ -606,7 +606,7 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe, TQRect vrect = visualRect( TQRect( x, y, checkcol, h ), r ); int xvis = vrect.x(); - qDrawShadePanel( p, xvis, y, w, h, cg, FALSE, 1, &cg.brush( TQColorGroup::Button ) ); + qDrawShadePanel( p, xvis, y, w, h, cg, false, 1, &cg.brush( TQColorGroup::Button ) ); } break; @@ -705,8 +705,7 @@ void TQWindowsStyle::drawControl( ControlElement element, const TQTab * t = opt.tab(); bool selected = flags & Style_Selected; - bool lastTab = (ceData.tabBarData.identIndexMap[t->identifier()] == ceData.tabBarData.tabCount-1) ? - TRUE : FALSE; + bool lastTab = (ceData.tabBarData.identIndexMap[t->identifier()] == ceData.tabBarData.tabCount-1); TQRect r2( r ); if ( ceData.tabBarData.shape == TQTabBar::RoundedAbove ) { p->setPen( cg.midlight() ); @@ -1634,8 +1633,8 @@ void TQWindowsStyle::drawComplexControl( ComplexControl ctrl, TQPainter *p, if ( !verticalLine ) { // make 128*1 and 1*128 bitmaps that can be used for // drawing the right sort of lines. - verticalLine = new TQBitmap( 1, 129, TRUE ); - horizontalLine = new TQBitmap( 128, 1, TRUE ); + verticalLine = new TQBitmap( 1, 129, true ); + horizontalLine = new TQBitmap( 128, 1, true ); TQPointArray a( 64 ); TQPainter p; p.begin( verticalLine ); @@ -1705,7 +1704,7 @@ void TQWindowsStyle::drawComplexControl( ComplexControl ctrl, TQPainter *p, if ( sub & SC_ComboBoxArrow ) { SFlags flags = Style_Default; - qDrawWinPanel( p, r, cg, TRUE, ( elementFlags & CEF_IsEnabled ) ? + qDrawWinPanel( p, r, cg, true, ( elementFlags & CEF_IsEnabled ) ? &cg.brush( TQColorGroup::Base ): &cg.brush( TQColorGroup::Background ) ); @@ -1717,7 +1716,7 @@ void TQWindowsStyle::drawComplexControl( ComplexControl ctrl, TQPainter *p, p->setBrush( cg.brush( TQColorGroup::Button ) ); p->drawRect( ar ); } else - qDrawWinPanel( p, ar, cg, FALSE, + qDrawWinPanel( p, ar, cg, false, &cg.brush( TQColorGroup::Button ) ); ar.addCoords( 2, 2, -2, -2 ); @@ -1780,12 +1779,12 @@ void TQWindowsStyle::drawComplexControl( ComplexControl ctrl, TQPainter *p, p->setPen( cg.shadow() ); if ( ceData.orientation == Horizontal ) { qDrawWinPanel( p, groove.x(), groove.y() + mid - 2, - groove.width(), 4, cg, TRUE ); + groove.width(), 4, cg, true ); p->drawLine( groove.x() + 1, groove.y() + mid - 1, groove.x() + groove.width() - 3, groove.y() + mid - 1 ); } else { qDrawWinPanel( p, groove.x() + mid - 2, groove.y(), - 4, groove.height(), cg, TRUE ); + 4, groove.height(), cg, true ); p->drawLine( groove.x() + mid - 1, groove.y() + 1, groove.x() + mid - 1, groove.y() + groove.height() - 3 ); @@ -1833,7 +1832,7 @@ void TQWindowsStyle::drawComplexControl( ComplexControl ctrl, TQPainter *p, } if ( (tickAbove && tickBelow) || (!tickAbove && !tickBelow) ) { - qDrawWinButton( p, TQRect(x,y,wi,he), cg, FALSE, + qDrawWinButton( p, TQRect(x,y,wi,he), cg, false, &cg.brush( TQColorGroup::Button ) ); return; } diff --git a/src/table/tqtable.cpp b/src/table/tqtable.cpp index b990a854a..28fe17cf2 100644 --- a/src/table/tqtable.cpp +++ b/src/table/tqtable.cpp @@ -62,8 +62,8 @@ #include <stdlib.h> #include <limits.h> -static bool qt_update_cell_widget = TRUE; -static bool qt_table_clipper_enabled = TRUE; +static bool qt_update_cell_widget = true; +static bool qt_table_clipper_enabled = true; #ifndef QT_INTERNAL_TABLE TQ_EXPORT #endif @@ -131,7 +131,7 @@ private: void updateSelections(); void saveStates(); void setCaching( bool b ); - void swapSections( int oldIdx, int newIdx, bool swapTable = TRUE ); + void swapSections( int oldIdx, int newIdx, bool swapTable = true ); bool doSelection( TQMouseEvent *e ); void sectionLabelChanged( int section ); void resizeArrays( int n ); @@ -157,11 +157,11 @@ private: struct TQTablePrivate { - TQTablePrivate() : hasRowSpan( FALSE ), hasColSpan( FALSE ), - inMenuMode( FALSE ), redirectMouseEvent( FALSE ) + TQTablePrivate() : hasRowSpan( false ), hasColSpan( false ), + inMenuMode( false ), redirectMouseEvent( false ) { - hiddenRows.setAutoDelete( TRUE ); - hiddenCols.setAutoDelete( TRUE ); + hiddenRows.setAutoDelete( true ); + hiddenCols.setAutoDelete( true ); } uint hasRowSpan : 1; uint hasColSpan : 1; @@ -209,7 +209,7 @@ static bool isRowSelection( TQTable::SelectionMode selMode ) rectangle's four edges. All four are part of the selection. A newly created TQTableSelection is inactive -- isActive() returns - FALSE. You must use init() and expandTo() to activate it. + false. You must use init() and expandTo() to activate it. \sa TQTable TQTable::addSelection() TQTable::selection() TQTable::selectCells() TQTable::selectRow() TQTable::selectColumn() @@ -221,7 +221,7 @@ static bool isRowSelection( TQTable::SelectionMode selMode ) */ TQTableSelection::TQTableSelection() - : active( FALSE ), inited( FALSE ), tRow( -1 ), lCol( -1 ), + : active( false ), inited( false ), tRow( -1 ), lCol( -1 ), bRow( -1 ), rCol( -1 ), aRow( -1 ), aCol( -1 ) { } @@ -232,7 +232,7 @@ TQTableSelection::TQTableSelection() */ TQTableSelection::TQTableSelection( int start_row, int start_col, int end_row, int end_col ) - : active( FALSE ), inited( FALSE ), tRow( -1 ), lCol( -1 ), + : active( false ), inited( false ), tRow( -1 ), lCol( -1 ), bRow( -1 ), rCol( -1 ), aRow( -1 ), aCol( -1 ) { init( start_row, start_col ); @@ -254,8 +254,8 @@ void TQTableSelection::init( int row, int col ) { aCol = lCol = rCol = col; aRow = tRow = bRow = row; - active = FALSE; - inited = TRUE; + active = false; + inited = true; } /*! @@ -273,7 +273,7 @@ void TQTableSelection::expandTo( int row, int col ) { if ( !inited ) return; - active = TRUE; + active = true; if ( row < aRow ) { tRow = row; @@ -293,8 +293,8 @@ void TQTableSelection::expandTo( int row, int col ) } /*! - Returns TRUE if \a s includes the same cells as the selection; - otherwise returns FALSE. + Returns true if \a s includes the same cells as the selection; + otherwise returns false. */ bool TQTableSelection::operator==( const TQTableSelection &s ) const @@ -307,8 +307,8 @@ bool TQTableSelection::operator==( const TQTableSelection &s ) const /*! \fn bool TQTableSelection::operator!=( const TQTableSelection &s ) const - Returns TRUE if \a s does not include the same cells as the - selection; otherwise returns FALSE. + Returns true if \a s does not include the same cells as the + selection; otherwise returns false. */ @@ -480,7 +480,7 @@ int TQTableSelection::numCols() const 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) + this does not happen, you must call setReplaceable(false) in the constructor of your subclass. \img tqtableitems.png Table Items @@ -533,8 +533,8 @@ int TQTableSelection::numCols() const \value Never The cell is not editable. The cell is actually editable only if TQTable::isRowReadOnly() is - FALSE for its row, TQTable::isColumnReadOnly() is FALSE for its - column, and TQTable::isReadOnly() is FALSE. + false for its row, TQTable::isColumnReadOnly() is false for its + column, and TQTable::isReadOnly() is false. TQComboTableItems have an isEditable() property. This property is used to indicate whether the user may enter their own text or are @@ -557,10 +557,10 @@ int TQTableSelection::numCols() const */ TQTableItem::TQTableItem( TQTable *table, EditType et ) - : txt(), pix(), t( table ), edType( et ), wordwrap( FALSE ), - tcha( TRUE ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) + : txt(), pix(), t( table ), edType( et ), wordwrap( false ), + tcha( true ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) { - enabled = TRUE; + enabled = true; } /*! @@ -576,10 +576,10 @@ TQTableItem::TQTableItem( TQTable *table, EditType et ) */ TQTableItem::TQTableItem( TQTable *table, EditType et, const TQString &text ) - : txt( text ), pix(), t( table ), edType( et ), wordwrap( FALSE ), - tcha( TRUE ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) + : txt( text ), pix(), t( table ), edType( et ), wordwrap( false ), + tcha( true ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) { - enabled = TRUE; + enabled = true; } /*! @@ -597,10 +597,10 @@ TQTableItem::TQTableItem( TQTable *table, EditType et, const TQString &text ) TQTableItem::TQTableItem( TQTable *table, EditType et, const TQString &text, const TQPixmap &p ) - : txt( text ), pix( p ), t( table ), edType( et ), wordwrap( FALSE ), - tcha( TRUE ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) + : txt( text ), pix( p ), t( table ), edType( et ), wordwrap( false ), + tcha( true ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) { - enabled = TRUE; + enabled = true; } /*! @@ -719,7 +719,7 @@ void TQTableItem::setText( const TQString &str ) using the painter \a p in the rectangular area \a cr using the color group \a cg. - If \a selected is TRUE the cell is displayed in a way that + If \a selected is true the cell is displayed in a way that indicates that it is highlighted. You don't usually need to use this function but if you want to @@ -734,7 +734,7 @@ void TQTableItem::setText( const TQString &str ) \code p->setClipRect( table()->cellRect(row, col), TQPainter::ClipPainter ); //... your drawing code - p->setClipping( FALSE ); + p->setClipping( false ); \endcode */ @@ -787,7 +787,7 @@ sizeHint(). TQWidget *TQTableItem::createEditor() const { TQLineEdit *e = new TQLineEdit( table()->viewport(), "qt_tableeditor" ); - e->setFrame( FALSE ); + e->setFrame( false ); e->setText( text() ); return e; } @@ -832,7 +832,7 @@ void TQTableItem::setContentFromEditor( TQWidget *w ) int TQTableItem::alignment() const { bool num; - bool ok1 = FALSE, ok2 = FALSE; + bool ok1 = false, ok2 = false; (void)text().toInt( &ok1 ); if ( !ok1 ) (void)text().toDouble( &ok2 ); // ### should be .-aligned @@ -842,7 +842,7 @@ int TQTableItem::alignment() const } /*! - If \a b is TRUE, the cell's text will be wrapped over multiple + If \a b is true, the cell's text will be wrapped over multiple lines, when necessary, to fit the width of the cell; otherwise the text will be written as a single line. @@ -855,8 +855,8 @@ void TQTableItem::setWordWrap( bool b ) } /*! - Returns TRUE if word wrap is enabled for the cell; otherwise - returns FALSE. + Returns true if word wrap is enabled for the cell; otherwise + returns false. \sa setWordWrap() */ @@ -892,8 +892,8 @@ TQTableItem::EditType TQTableItem::editType() const } /*! - 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 + 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 replaced by the contents of another table item. Table items that span more than one cell may not have their contents replaced by another table item. @@ -924,7 +924,7 @@ void TQTableItem::setReplaceable( bool b ) bool TQTableItem::isReplaceable() const { if ( rowspan > 1 || colspan > 1 ) - return FALSE; + return false; return tcha; } @@ -1025,9 +1025,9 @@ void TQTableItem::setSpan( int rs, int cs ) for ( int c = 0; c < colspan; ++c ) { if ( r == 0 && c == 0 ) continue; - qt_update_cell_widget = FALSE; + qt_update_cell_widget = false; table()->setItem( r + rw, c + cl, this ); - qt_update_cell_widget = TRUE; + qt_update_cell_widget = true; rw = rrow; cl = rcol; } @@ -1118,7 +1118,7 @@ int TQTableItem::col() const } /*! - If \a b is TRUE, the table item is enabled; if \a b is FALSE the + If \a b is true, the table item is enabled; if \a b is false the table item is disabled. A disabled item doesn't respond to user interaction. @@ -1135,7 +1135,7 @@ void TQTableItem::setEnabled( bool b ) } /*! - Returns TRUE if the table item is enabled; otherwise returns FALSE. + Returns true if the table item is enabled; otherwise returns false. \sa setEnabled() */ @@ -1175,7 +1175,7 @@ bool TQTableItem::isEnabled() const currentText(), and the text of a particular item can be retrieved with text(). - If isEditable() is TRUE the TQComboTableItem will permit the user + If isEditable() is true the TQComboTableItem will permit the user to either choose an existing list item, or create a new list item by entering their own text; otherwise the user may only choose one of the existing list items. @@ -1201,11 +1201,11 @@ int TQComboTableItem::fakeRef = 0; /*! Creates a combo table item for the table \a table. The combobox's list of items is passed in the \a list argument. If \a editable is - TRUE the user may type in new list items; if \a editable is FALSE + 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 replaced by other table - items since isReplaceable() returns FALSE by default. + items since isReplaceable() returns false by default. \sa TQTable::clearCell() EditType */ @@ -1213,10 +1213,10 @@ int TQComboTableItem::fakeRef = 0; TQComboTableItem::TQComboTableItem( TQTable *table, const TQStringList &list, bool editable ) : TQTableItem( table, WhenCurrent, "" ), entries( list ), current( 0 ), edit( editable ) { - setReplaceable( FALSE ); + setReplaceable( false ); if ( !TQComboTableItem::fakeCombo ) { TQComboTableItem::fakeComboWidget = new TQWidget( 0, 0 ); - TQComboTableItem::fakeCombo = new TQComboBox( FALSE, TQComboTableItem::fakeComboWidget, 0 ); + TQComboTableItem::fakeCombo = new TQComboBox( false, TQComboTableItem::fakeComboWidget, 0 ); TQComboTableItem::fakeCombo->hide(); } ++TQComboTableItem::fakeRef; @@ -1403,8 +1403,8 @@ TQString TQComboTableItem::text( int i ) const } /*! - If \a b is TRUE the combo table item can be edited, i.e. the user - may enter a new text item themselves. If \a b is FALSE the user may + If \a b is true the combo table item can be edited, i.e. the user + may enter a new text item themselves. If \a b is false the user may may only choose one of the existing items. \sa isEditable() @@ -1416,8 +1416,8 @@ void TQComboTableItem::setEditable( bool b ) } /*! - Returns TRUE if the user can add their own list items to the - combobox's list of items; otherwise returns FALSE. + Returns true if the user can add their own list items to the + combobox's list of items; otherwise returns false. \sa setEditable() */ @@ -1503,7 +1503,7 @@ TQSize TQComboTableItem::sizeHint() const */ TQCheckTableItem::TQCheckTableItem( TQTable *table, const TQString &txt ) - : TQTableItem( table, WhenCurrent, txt ), checked( FALSE ) + : TQTableItem( table, WhenCurrent, txt ), checked( false ) { } @@ -1578,7 +1578,7 @@ void TQCheckTableItem::paint( TQPainter *p, const TQColorGroup &cg, } /*! - If \a b is TRUE the checkbox is checked; if \a b is FALSE the + If \a b is true the checkbox is checked; if \a b is false the checkbox is unchecked. \sa isChecked() @@ -1595,8 +1595,8 @@ void TQCheckTableItem::setChecked( bool b ) } /*! - Returns TRUE if the checkbox table item is checked; otherwise - returns FALSE. + Returns true if the checkbox table item is checked; otherwise + returns false. \sa setChecked() */ @@ -1689,7 +1689,7 @@ TQSize TQCheckTableItem::sizeHint() const the table showing column numbers. (The numbers displayed start at 1, although row and column numbers within TQTable begin at 0.) - If you want to use mouse tracking call setMouseTracking( TRUE ) on + If you want to use mouse tracking call setMouseTracking( true ) on the \e viewport; (see \link tqscrollview.html#allviews TQScrollView\endlink). @@ -1747,7 +1747,7 @@ TQSize TQCheckTableItem::sizeHint() const independently of the user interface ordering. The table can be sorted using sortColumn(). Users can sort a - column by clicking its header if setSorting() is set to TRUE. Rows + column by clicking its header if setSorting() is set to true. Rows can be swapped with swapRows(), columns with swapColumns() and cells with swapCells(). @@ -2027,8 +2027,8 @@ TQSize TQCheckTableItem::sizeHint() const TQTable::TQTable( TQWidget *parent, const char *name ) : TQScrollView( parent, name, WNoAutoErase | WStaticContents ), leftHeader( 0 ), topHeader( 0 ), - currentSel( 0 ), lastSortCol( -1 ), sGrid( TRUE ), mRows( FALSE ), mCols( FALSE ), - asc( TRUE ), doSort( TRUE ), readOnly( FALSE ) + currentSel( 0 ), lastSortCol( -1 ), sGrid( true ), mRows( false ), mCols( false ), + asc( true ), doSort( true ), readOnly( false ) { init( 0, 0 ); } @@ -2048,8 +2048,8 @@ TQTable::TQTable( TQWidget *parent, const char *name ) TQTable::TQTable( int numRows, int numCols, TQWidget *parent, const char *name ) : TQScrollView( parent, name, WNoAutoErase | WStaticContents ), leftHeader( 0 ), topHeader( 0 ), - currentSel( 0 ), lastSortCol( -1 ), sGrid( TRUE ), mRows( FALSE ), mCols( FALSE ), - asc( TRUE ), doSort( TRUE ), readOnly( FALSE ) + currentSel( 0 ), lastSortCol( -1 ), sGrid( true ), mRows( false ), mCols( false ), + asc( true ), doSort( true ), readOnly( false ) { init( numRows, numCols ); } @@ -2060,25 +2060,25 @@ TQTable::TQTable( int numRows, int numCols, TQWidget *parent, const char *name ) void TQTable::init( int rows, int cols ) { #ifndef TQT_NO_DRAGANDDROP - setDragAutoScroll( FALSE ); + setDragAutoScroll( false ); #endif d = new TQTablePrivate; d->geomTimer = new TQTimer( this ); d->lastVisCol = 0; d->lastVisRow = 0; connect( d->geomTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( updateGeometriesSlot() ) ); - shouldClearSelection = FALSE; - dEnabled = FALSE; - roRows.setAutoDelete( TRUE ); - roCols.setAutoDelete( TRUE ); - setSorting( FALSE ); + shouldClearSelection = false; + dEnabled = false; + roRows.setAutoDelete( true ); + roCols.setAutoDelete( true ); + setSorting( false ); - unused = TRUE; // It's unused, ain't it? :) + unused = true; // It's unused, ain't it? :) selMode = Multi; - contents.setAutoDelete( TRUE ); - widgets.setAutoDelete( TRUE ); + contents.setAutoDelete( true ); + widgets.setAutoDelete( true ); // Enable clipper and set background mode enableClipper( qt_table_clipper_enabled ); @@ -2089,35 +2089,35 @@ void TQTable::init( int rows, int cols ) viewport()->setBackgroundMode( PaletteBase ); setBackgroundMode( PaletteBackground, PaletteBase ); setResizePolicy( Manual ); - selections.setAutoDelete( TRUE ); + selections.setAutoDelete( true ); // Create headers leftHeader = new TQTableHeader( rows, this, this, "left table header" ); leftHeader->setOrientation( Vertical ); - leftHeader->setTracking( TRUE ); - leftHeader->setMovingEnabled( TRUE ); + leftHeader->setTracking( true ); + leftHeader->setMovingEnabled( true ); topHeader = new TQTableHeader( cols, this, this, "right table header" ); topHeader->setOrientation( Horizontal ); - topHeader->setTracking( TRUE ); - topHeader->setMovingEnabled( TRUE ); + topHeader->setTracking( true ); + topHeader->setMovingEnabled( true ); if ( TQApplication::reverseLayout() ) setMargins( 0, fontMetrics().height() + 4, 30, 0 ); else setMargins( 30, fontMetrics().height() + 4, 0, 0 ); - topHeader->setUpdatesEnabled( FALSE ); - leftHeader->setUpdatesEnabled( FALSE ); + topHeader->setUpdatesEnabled( false ); + leftHeader->setUpdatesEnabled( false ); // Initialize headers int i = 0; for ( i = 0; i < numCols(); ++i ) topHeader->resizeSection( i, TQMAX( 100, TQApplication::globalStrut().height() ) ); for ( i = 0; i < numRows(); ++i ) leftHeader->resizeSection( i, TQMAX( 20, TQApplication::globalStrut().width() ) ); - topHeader->setUpdatesEnabled( TRUE ); - leftHeader->setUpdatesEnabled( TRUE ); + topHeader->setUpdatesEnabled( true ); + leftHeader->setUpdatesEnabled( true ); // Prepare for contents - contents.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); // Connect header, table and scrollbars connect( horizontalScrollBar(), TQ_SIGNAL( valueChanged(int) ), @@ -2145,13 +2145,13 @@ void TQTable::init( int rows, int cols ) edMode = NotEditing; editRow = editCol = -1; - drawActiveSelection = TRUE; + drawActiveSelection = true; installEventFilter( this ); focusStl = SpreadSheet; - was_visible = FALSE; + was_visible = false; // initial size resize( 640, 480 ); @@ -2164,8 +2164,8 @@ void TQTable::init( int rows, int cols ) TQTable::~TQTable() { - setUpdatesEnabled( FALSE ); - contents.setAutoDelete( TRUE ); + setUpdatesEnabled( false ); + contents.setAutoDelete( true ); contents.clear(); widgets.clear(); @@ -2178,7 +2178,7 @@ void TQTable::setReadOnly( bool b ) TQTableItem *i = item(curRow, curCol); if (readOnly && isEditing()) { - endEdit(editRow, editCol, TRUE, FALSE); + endEdit(editRow, editCol, true, false); } else if (!readOnly && i && (i->editType() == TQTableItem::WhenCurrent || i->editType() == TQTableItem::Always)) { editCell(curRow, curCol); @@ -2186,7 +2186,7 @@ void TQTable::setReadOnly( bool b ) } /*! - If \a ro is TRUE, row \a row is set to be read-only; otherwise the + If \a ro is true, row \a row is set to be read-only; otherwise the row is set to be editable. Whether a cell in this row is editable or read-only depends on the @@ -2206,7 +2206,7 @@ void TQTable::setRowReadOnly( int row, bool ro ) if (curRow == row) { TQTableItem *i = item(curRow, curCol); if (ro && isEditing()) { - endEdit(editRow, editCol, TRUE, FALSE); + endEdit(editRow, editCol, true, false); } else if (!ro && i && (i->editType() == TQTableItem::WhenCurrent || i->editType() == TQTableItem::Always)) { editCell(curRow, curCol); @@ -2215,7 +2215,7 @@ void TQTable::setRowReadOnly( int row, bool ro ) } /*! - If \a ro is TRUE, column \a col is set to be read-only; otherwise + If \a ro is true, column \a col is set to be read-only; otherwise the column is set to be editable. Whether a cell in this column is editable or read-only depends on @@ -2236,7 +2236,7 @@ void TQTable::setColumnReadOnly( int col, bool ro ) if (curCol == col) { TQTableItem *i = item(curRow, curCol); if (ro && isEditing()) { - endEdit(editRow, editCol, TRUE, FALSE); + endEdit(editRow, editCol, true, false); } else if (!ro && i && (i->editType() == TQTableItem::WhenCurrent || i->editType() == TQTableItem::Always)) { editCell(curRow, curCol); @@ -2262,7 +2262,7 @@ bool TQTable::isReadOnly() const } /*! - Returns TRUE if row \a row is read-only; otherwise returns FALSE. + Returns true if row \a row is read-only; otherwise returns false. Whether a cell in this row is editable or read-only depends on the cell's \link TQTableItem::EditType EditType\endlink, and this @@ -2278,8 +2278,8 @@ bool TQTable::isRowReadOnly( int row ) const } /*! - Returns TRUE if column \a col is read-only; otherwise returns - FALSE. + Returns true if column \a col is read-only; otherwise returns + false. Whether a cell in this column is editable or read-only depends on the cell's EditType, and this setting: see \link @@ -2352,8 +2352,8 @@ TQTable::FocusStyle TQTable::focusStyle() const void TQTable::updateHeaderStates() { - horizontalHeader()->setUpdatesEnabled( FALSE ); - verticalHeader()->setUpdatesEnabled( FALSE ); + horizontalHeader()->setUpdatesEnabled( false ); + verticalHeader()->setUpdatesEnabled( false ); ( (TQTableHeader*)verticalHeader() )->setSectionStateToAll( TQTableHeader::Normal ); ( (TQTableHeader*)horizontalHeader() )->setSectionStateToAll( TQTableHeader::Normal ); @@ -2376,10 +2376,10 @@ void TQTable::updateHeaderStates() } } - horizontalHeader()->setUpdatesEnabled( TRUE ); - verticalHeader()->setUpdatesEnabled( TRUE ); - horizontalHeader()->repaint( FALSE ); - verticalHeader()->repaint( FALSE ); + horizontalHeader()->setUpdatesEnabled( true ); + verticalHeader()->setUpdatesEnabled( true ); + horizontalHeader()->repaint( false ); + verticalHeader()->repaint( false ); } /*! @@ -2437,7 +2437,7 @@ bool TQTable::showGrid() const \property TQTable::columnMovingEnabled \brief whether columns can be moved by the user - The default is FALSE. Columns are moved by dragging whilst holding + The default is false. Columns are moved by dragging whilst holding down the Ctrl key. \warning If TQTable is used to move header sections as a result of user @@ -2463,7 +2463,7 @@ bool TQTable::columnMovingEnabled() const \property TQTable::rowMovingEnabled \brief whether rows can be moved by the user - The default is FALSE. Rows are moved by dragging whilst holding + The default is false. Rows are moved by dragging whilst holding down the Ctrl key. \warning If TQTable is used to move header sections as a result of user @@ -2511,7 +2511,7 @@ void TQTable::resizeData( int len ) swap rows, e.g. for sorting, you will need to reimplement this function. (See the notes on large tables.) - If \a swapHeader is TRUE, the rows' header contents is also + If \a swapHeader is true, the rows' header contents is also swapped. This function will not update the TQTable, you will have to do @@ -2523,7 +2523,7 @@ void TQTable::resizeData( int len ) void TQTable::swapRows( int row1, int row2, bool swapHeader ) { if ( swapHeader ) - leftHeader->swapSections( row1, row2, FALSE ); + leftHeader->swapSections( row1, row2, false ); TQPtrVector<TQTableItem> tmpContents; tmpContents.resize( numCols() ); @@ -2531,8 +2531,8 @@ void TQTable::swapRows( int row1, int row2, bool swapHeader ) tmpWidgets.resize( numCols() ); int i; - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( false ); for ( i = 0; i < numCols(); ++i ) { TQTableItem *i1, *i2; i1 = item( row1, i ); @@ -2560,8 +2560,8 @@ void TQTable::swapRows( int row1, int row2, bool swapHeader ) widgets.insert( indexOf( row2, i ), tmpWidgets[ i ] ); } } - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( TRUE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( true ); updateRowWidgets( row1 ); updateRowWidgets( row2 ); @@ -2623,7 +2623,7 @@ void TQTable::setTopMargin( int m ) swap columns you will need to reimplement this function. (See the notes on large tables.) - If \a swapHeader is TRUE, the columns' header contents is also + If \a swapHeader is true, the columns' header contents is also swapped. \sa swapCells() @@ -2632,7 +2632,7 @@ void TQTable::setTopMargin( int m ) void TQTable::swapColumns( int col1, int col2, bool swapHeader ) { if ( swapHeader ) - topHeader->swapSections( col1, col2, FALSE ); + topHeader->swapSections( col1, col2, false ); TQPtrVector<TQTableItem> tmpContents; tmpContents.resize( numRows() ); @@ -2640,8 +2640,8 @@ void TQTable::swapColumns( int col1, int col2, bool swapHeader ) tmpWidgets.resize( numRows() ); int i; - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( false ); for ( i = 0; i < numRows(); ++i ) { TQTableItem *i1, *i2; i1 = item( i, col1 ); @@ -2669,8 +2669,8 @@ void TQTable::swapColumns( int col1, int col2, bool swapHeader ) widgets.insert( indexOf( i, col2 ), tmpWidgets[ i ] ); } } - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( TRUE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( true ); columnWidthChanged( col1 ); columnWidthChanged( col2 ); @@ -2699,8 +2699,8 @@ void TQTable::swapColumns( int col1, int col2, bool swapHeader ) void TQTable::swapCells( int row1, int col1, int row2, int col2 ) { - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( false ); TQTableItem *i1, *i2; i1 = item( row1, col1 ); i2 = item( row2, col2 ); @@ -2735,18 +2735,18 @@ void TQTable::swapCells( int row1, int col1, int row2, int col2 ) updateRowWidgets( row2 ); updateColWidgets( col1 ); updateColWidgets( col2 ); - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( TRUE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( true ); } static bool is_child_of( TQWidget *child, TQWidget *parent ) { while ( child ) { if ( child == parent ) - return TRUE; + return true; child = child->parentWidget(); } - return FALSE; + return false; } /*! @@ -2778,7 +2778,7 @@ void TQTable::drawContents( TQPainter *p, int cx, int cy, int cw, int ch ) if ( collast == -1 ) collast = numCols() - 1; - bool currentInSelection = FALSE; + bool currentInSelection = false; TQPtrListIterator<TQTableSelection> it( selections ); TQTableSelection *s; @@ -2835,7 +2835,7 @@ void TQTable::drawContents( TQPainter *p, int cx, int cy, int cw, int ch ) bool selected = isSelected( r, c ); if ( focusStl != FollowStyle && selected && !currentInSelection && r == curRow && c == curCol ) - selected = FALSE; + selected = false; paintCell( p, r, c, TQRect( colp, rowp, colw, rowh ), selected ); p->translate( -colp, -rowp ); @@ -2862,7 +2862,7 @@ void TQTable::drawContents( TQPainter *p, int cx, int cy, int cw, int ch ) // Paint empty rects paintEmptyArea( p, cx, cy, cw, ch ); - drawActiveSelection = TRUE; + drawActiveSelection = true; } /*! @@ -2920,7 +2920,7 @@ void TQTable::paintCell( TQPainter* p, int row, int col, has already been translated to the cell's origin. \a cr describes the cell coordinates in the content coordinate system. - If \a selected is TRUE the cell is highlighted. + If \a selected is true the cell is highlighted. \a cg is the colorgroup which should be used to draw the cell content. @@ -2944,7 +2944,7 @@ void TQTable::paintCell( TQPainter* p, int row, int col, \code p->setClipRect( cellRect(row, col), TQPainter::CoordPainter ); //... your drawing code - p->setClipping( FALSE ); + p->setClipping( false ); \endcode */ @@ -2954,7 +2954,7 @@ void TQTable::paintCell( TQPainter *p, int row, int col, if ( focusStl == SpreadSheet && selected && row == curRow && col == curCol && ( hasFocus() || viewport()->hasFocus() ) ) - selected = FALSE; + selected = false; int w = cr.width(); int h = cr.height(); @@ -3011,10 +3011,10 @@ void TQTable::paintFocus( TQPainter *p, const TQRect &cr ) p->drawRect( focusRect.x(), focusRect.y(), focusRect.width() - 1, focusRect.height() - 1 ); p->drawRect( focusRect.x() - 1, focusRect.y() - 1, focusRect.width() + 1, focusRect.height() + 1 ); } else { - TQColor c = isSelected( curRow, curCol, FALSE ) ? + TQColor c = isSelected( curRow, curCol, false ) ? colorGroup().highlight() : colorGroup().base(); style().drawPrimitive( TQStyle::PE_FocusRect, p, focusRect, colorGroup(), - ( isSelected( curRow, curCol, FALSE ) ? + ( isSelected( curRow, curCol, false ) ? TQStyle::Style_FocusAtBorder : TQStyle::Style_Default ), TQStyleOption(c) ); @@ -3107,7 +3107,7 @@ void TQTable::setItem( int row, int col, TQTableItem *item ) item->updateEditor( orow, ocol ); if ( row == curRow && col == curCol && item->editType() == TQTableItem::WhenCurrent ) { - if ( beginEdit( row, col, FALSE ) ) + if ( beginEdit( row, col, false ) ) setEditMode( Editing, row, col ); } } @@ -3124,9 +3124,9 @@ void TQTable::clearCell( int row, int col ) if ( (int)contents.size() != numRows() * numCols() ) resizeData( numRows() * numCols() ); clearCellWidget( row, col ); - contents.setAutoDelete( TRUE ); + contents.setAutoDelete( true ); contents.remove( indexOf( row, col ) ); - contents.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); } /*! @@ -3219,7 +3219,7 @@ TQPixmap TQTable::pixmap( int row, int col ) const void TQTable::setCurrentCell( int row, int col ) { - setCurrentCell( row, col, TRUE, TRUE ); + setCurrentCell( row, col, true, true ); } // need to use a define, as leftMargin() is protected @@ -3247,7 +3247,7 @@ void TQTable::setCurrentCell( int row, int col, bool updateSelections, bool ensu TQTableItem *itm = oldItem; if ( itm && itm->editType() != TQTableItem::Always && itm->editType() != TQTableItem::Never ) - endEdit( itm->row(), itm->col(), TRUE, FALSE ); + endEdit( itm->row(), itm->col(), true, false ); int oldRow = curRow; int oldCol = curCol; curRow = row; @@ -3263,14 +3263,14 @@ void TQTable::setCurrentCell( int row, int col, bool updateSelections, bool ensu topHeader->setSectionState( oldCol, TQTableHeader::Normal ); else if ( isRowSelection( selectionMode() ) ) topHeader->setSectionState( oldCol, TQTableHeader::Selected ); - topHeader->setSectionState( curCol, isColumnSelected( curCol, TRUE ) ? + topHeader->setSectionState( curCol, isColumnSelected( curCol, true ) ? TQTableHeader::Selected : TQTableHeader::Bold ); } if ( oldRow != curRow ) { if ( !isRowSelected( oldRow ) ) leftHeader->setSectionState( oldRow, TQTableHeader::Normal ); - leftHeader->setSectionState( curRow, isRowSelected( curRow, TRUE ) ? + leftHeader->setSectionState( curRow, isRowSelected( curRow, true ) ? TQTableHeader::Selected : TQTableHeader::Bold ); } @@ -3286,7 +3286,7 @@ void TQTable::setCurrentCell( int row, int col, bool updateSelections, bool ensu viewport()->setFocus(); if ( itm && itm->editType() == TQTableItem::WhenCurrent ) { - if ( beginEdit( itm->row(), itm->col(), FALSE ) ) + if ( beginEdit( itm->row(), itm->col(), false ) ) setEditMode( Editing, itm->row(), itm->col() ); } else if ( itm && itm->editType() == TQTableItem::Always ) { if ( cellWidget( itm->row(), itm->col() ) ) @@ -3294,7 +3294,7 @@ void TQTable::setCurrentCell( int row, int col, bool updateSelections, bool ensu } if ( updateSelections && isRowSelection( selectionMode() ) && - !isSelected( curRow, curCol, FALSE ) ) { + !isSelected( curRow, curCol, false ) ) { if ( selectionMode() == TQTable::SingleRow ) clearSelection(); currentSel = new TQTableSelection(); @@ -3323,15 +3323,15 @@ void TQTable::ensureCellVisible( int row, int col ) } /*! - Returns TRUE if the cell at \a row, \a col is selected; otherwise - returns FALSE. + Returns true if the cell at \a row, \a col is selected; otherwise + returns false. \sa isRowSelected() isColumnSelected() */ bool TQTable::isSelected( int row, int col ) const { - return isSelected( row, col, TRUE ); + return isSelected( row, col, true ); } /*! \internal */ @@ -3347,18 +3347,18 @@ bool TQTable::isSelected( int row, int col, bool includeCurrent ) const row <= s->bottomRow() && col >= s->leftCol() && col <= s->rightCol() ) - return TRUE; + return true; if ( includeCurrent && row == currentRow() && col == currentColumn() ) - return TRUE; + return true; } - return FALSE; + return false; } /*! - Returns TRUE if row \a row is selected; otherwise returns FALSE. + Returns true if row \a row is selected; otherwise returns false. - If \a full is FALSE (the default), 'row is selected' means that at - least one cell in the row is selected. If \a full is TRUE, then 'row + If \a full is false (the default), 'row is selected' means that at + least one cell in the row is selected. If \a full is true, then 'row is selected' means every cell in the row is selected. \sa isColumnSelected() isSelected() @@ -3374,9 +3374,9 @@ bool TQTable::isRowSelected( int row, bool full ) const if ( s->isActive() && row >= s->topRow() && row <= s->bottomRow() ) - return TRUE; + return true; if ( row == currentRow() ) - return TRUE; + return true; } } else { TQPtrListIterator<TQTableSelection> it( selections ); @@ -3388,17 +3388,17 @@ bool TQTable::isRowSelected( int row, bool full ) const row <= s->bottomRow() && s->leftCol() == 0 && s->rightCol() == numCols() - 1 ) - return TRUE; + return true; } } - return FALSE; + return false; } /*! - Returns TRUE if column \a col is selected; otherwise returns FALSE. + Returns true if column \a col is selected; otherwise returns false. - If \a full is FALSE (the default), 'column is selected' means that - at least one cell in the column is selected. If \a full is TRUE, + If \a full is false (the default), 'column is selected' means that + at least one cell in the column is selected. If \a full is true, then 'column is selected' means every cell in the column is selected. @@ -3415,9 +3415,9 @@ bool TQTable::isColumnSelected( int col, bool full ) const if ( s->isActive() && col >= s->leftCol() && col <= s->rightCol() ) - return TRUE; + return true; if ( col == currentColumn() ) - return TRUE; + return true; } } else { TQPtrListIterator<TQTableSelection> it( selections ); @@ -3429,10 +3429,10 @@ bool TQTable::isColumnSelected( int col, bool full ) const col <= s->rightCol() && s->topRow() == 0 && s->bottomRow() == numRows() - 1 ) - return TRUE; + return true; } } - return FALSE; + return false; } /*! @@ -3485,7 +3485,7 @@ int TQTable::addSelection( const TQTableSelection &s ) selections.append( sel ); - repaintSelections( 0, sel, TRUE, TRUE ); + repaintSelections( 0, sel, true, true ); emit selectionChanged(); @@ -3501,17 +3501,17 @@ int TQTable::addSelection( const TQTableSelection &s ) void TQTable::removeSelection( const TQTableSelection &s ) { - selections.setAutoDelete( FALSE ); + selections.setAutoDelete( false ); for ( TQTableSelection *sel = selections.first(); sel; sel = selections.next() ) { if ( s == *sel ) { selections.removeRef( sel ); - repaintSelections( sel, 0, TRUE, TRUE ); + repaintSelections( sel, 0, true, true ); if ( sel == currentSel ) currentSel = 0; delete sel; } } - selections.setAutoDelete( TRUE ); + selections.setAutoDelete( true ); emit selectionChanged(); } @@ -3532,7 +3532,7 @@ void TQTable::removeSelection( int num ) if ( s == currentSel ) currentSel = 0; selections.removeRef( s ); - repaintContents( FALSE ); + repaintContents( false ); } /*! @@ -3579,7 +3579,7 @@ void TQTable::selectRow( int row ) row = TQMIN(numRows()-1, row); if ( row < 0 ) return; - bool isDataTable = FALSE; + bool isDataTable = false; #ifndef TQT_NO_SQL isDataTable = ::tqt_cast<TQDataTable*>(this) != 0; #endif @@ -3613,17 +3613,17 @@ void TQTable::contentsMousePressEvent( TQMouseEvent* e ) void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) { - shouldClearSelection = FALSE; + shouldClearSelection = false; if ( isEditing() ) { if ( !cellGeometry( editRow, editCol ).contains( e->pos() ) ) { - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); } else { e->ignore(); return; } } - d->redirectMouseEvent = FALSE; + d->redirectMouseEvent = false; int tmpRow = rowAt( e->pos().y() ); int tmpCol = columnAt( e->pos().x() ); @@ -3649,7 +3649,7 @@ void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) if ( ( e->state() & ShiftButton ) == ShiftButton ) { int oldRow = curRow; int oldCol = curCol; - setCurrentCell( tmpRow, tmpCol, selMode == SingleRow, TRUE ); + setCurrentCell( tmpRow, tmpCol, selMode == SingleRow, true ); if ( selMode != NoSelection && selMode != SingleRow ) { if ( !currentSel ) { currentSel = new TQTableSelection(); @@ -3668,11 +3668,11 @@ void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) emit selectionChanged(); } } else if ( ( e->state() & ControlButton ) == ControlButton ) { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); if ( selMode != NoSelection ) { - if ( selMode == Single || ( selMode == SingleRow && !isSelected( tmpRow, tmpCol, FALSE ) ) ) + if ( selMode == Single || ( selMode == SingleRow && !isSelected( tmpRow, tmpCol, false ) ) ) clearSelection(); - if ( !(selMode == SingleRow && isSelected( tmpRow, tmpCol, FALSE )) ) { + if ( !(selMode == SingleRow && isSelected( tmpRow, tmpCol, false )) ) { currentSel = new TQTableSelection(); selections.append( currentSel ); if ( !isRowSelection( selectionMode() ) ) { @@ -3687,7 +3687,7 @@ void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) } } } else { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); TQTableItem *itm = item( tmpRow, tmpCol ); if ( itm && itm->editType() == TQTableItem::WhenCurrent ) { TQWidget *w = cellWidget( tmpRow, tmpCol ); @@ -3696,15 +3696,15 @@ void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) e->globalPos(), e->button(), e->state() ); TQApplication::sendPostedEvents( w, 0 ); TQApplication::sendEvent( w, &ev ); - d->redirectMouseEvent = TRUE; + d->redirectMouseEvent = true; } } - if ( isSelected( tmpRow, tmpCol, FALSE ) ) { - shouldClearSelection = TRUE; + if ( isSelected( tmpRow, tmpCol, false ) ) { + shouldClearSelection = true; } else { bool b = signalsBlocked(); if ( selMode != NoSelection ) - blockSignals( TRUE ); + blockSignals( true ); clearSelection(); blockSignals( b ); if ( selMode != NoSelection ) { @@ -3741,7 +3741,7 @@ void TQTable::contentsMouseDoubleClickEvent( TQMouseEvent *e ) if ( itm && !itm->isEnabled() ) return; if ( tmpRow != -1 && tmpCol != -1 ) { - if ( beginEdit( tmpRow, tmpCol, FALSE ) ) + if ( beginEdit( tmpRow, tmpCol, false ) ) setEditMode( Editing, tmpRow, tmpCol ); } @@ -3783,7 +3783,7 @@ void TQTable::contentsMouseMoveEvent( TQMouseEvent *e ) } #endif if ( selectionMode() == MultiRow && ( e->state() & ControlButton ) == ControlButton ) - shouldClearSelection = FALSE; + shouldClearSelection = false; if ( shouldClearSelection ) { clearSelection(); @@ -3796,7 +3796,7 @@ void TQTable::contentsMouseMoveEvent( TQMouseEvent *e ) currentSel->init( tmpRow, 0 ); emit selectionChanged(); } - shouldClearSelection = FALSE; + shouldClearSelection = false; } TQPoint pos = mapFromGlobal( e->globalPos() ); @@ -3804,7 +3804,7 @@ void TQTable::contentsMouseMoveEvent( TQMouseEvent *e ) autoScrollTimer->stop(); doAutoScroll(); if ( pos.x() < 0 || pos.x() > visibleWidth() || pos.y() < 0 || pos.y() > visibleHeight() ) - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } /*! \internal @@ -3854,7 +3854,7 @@ void TQTable::doAutoScroll() if ( currentSel && selMode != NoSelection ) { TQTableSelection oldSelection = *currentSel; - bool useOld = TRUE; + bool useOld = true; if ( selMode != SingleRow ) { if ( !isRowSelection( selectionMode() ) ) { currentSel->expandTo( tmpRow, tmpCol ); @@ -3864,7 +3864,7 @@ void TQTable::doAutoScroll() } else { bool currentInSelection = tmpRow == curRow && isSelected( tmpRow, tmpCol ); if ( !currentInSelection ) { - useOld = FALSE; + useOld = false; clearSelection(); currentSel = new TQTableSelection(); selections.append( currentSel ); @@ -3875,16 +3875,16 @@ void TQTable::doAutoScroll() currentSel->expandTo( tmpRow, numCols() - 1 ); } } - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); repaintSelections( useOld ? &oldSelection : 0, currentSel ); if ( currentSel && oldSelection != *currentSel ) emit selectionChanged(); } else { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); } if ( pos.x() < 0 || pos.x() > visibleWidth() || pos.y() < 0 || pos.y() > visibleHeight() ) - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } /*! \reimp @@ -3915,7 +3915,7 @@ void TQTable::contentsMouseReleaseEvent( TQMouseEvent *e ) } emit selectionChanged(); } - shouldClearSelection = FALSE; + shouldClearSelection = false; } autoScrollTimer->stop(); @@ -3976,26 +3976,26 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) TQKeyEvent *ke = (TQKeyEvent*)e; if ( ke->key() == Key_Escape ) { if ( !itm || itm->editType() == TQTableItem::OnTyping ) - endEdit( editRow, editCol, FALSE, edMode != Editing ); - return TRUE; + endEdit( editRow, editCol, false, edMode != Editing ); + return true; } if ( ( ke->state() == NoButton || ke->state() == Keypad ) && ( ke->key() == Key_Return || ke->key() == Key_Enter ) ) { if ( !itm || itm->editType() == TQTableItem::OnTyping ) - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); activateNextCell(); - return TRUE; + return true; } if ( ke->key() == Key_Tab || ke->key() == Key_BackTab ) { if ( ke->state() & TQt::ControlButton ) - return FALSE; + return false; if ( !itm || itm->editType() == TQTableItem::OnTyping ) - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); if ( (ke->key() == Key_Tab) && !(ke->state() & ShiftButton) ) { if ( currentColumn() >= numCols() - 1 ) - return TRUE; + return true; int cc = TQMIN( numCols() - 1, currentColumn() + 1 ); while ( cc < numCols() ) { TQTableItem *i = item( currentRow(), cc ); @@ -4006,7 +4006,7 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) setCurrentCell( currentRow(), cc ); } else { // Key_BackTab if ( currentColumn() == 0 ) - return TRUE; + return true; int cc = TQMAX( 0, currentColumn() - 1 ); while ( cc >= 0 ) { TQTableItem *i = item( currentRow(), cc ); @@ -4017,9 +4017,9 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) setCurrentCell( currentRow(), cc ); } itm = item( curRow, curCol ); - if ( beginEdit( curRow, curCol, FALSE ) ) + if ( beginEdit( curRow, curCol, false ) ) setEditMode( Editing, curRow, curCol ); - return TRUE; + return true; } if ( ( edMode == Replacing || @@ -4029,10 +4029,10 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) ke->key() == Key_Next || ke->key() == Key_End || ke->key() == Key_Left || ke->key() == Key_Right ) ) { if ( !itm || itm->editType() == TQTableItem::OnTyping ) { - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); } keyPressEvent( ke ); - return TRUE; + return true; } } else { TQObjectList *l = viewport()->queryList( "TQWidget" ); @@ -4044,9 +4044,9 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) ke->key() != Key_Up && ke->key() != Key_Down && ke->key() != Key_Prior && ke->key() != Key_Next && ke->key() != Key_Home && ke->key() != Key_End ) ) - return FALSE; + return false; keyPressEvent( (TQKeyEvent*)e ); - return TRUE; + return true; } delete l; } @@ -4056,8 +4056,8 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) if ( isEditing() && editorWidget && o == editorWidget && ( (TQFocusEvent*)e )->reason() != TQFocusEvent::Popup ) { TQTableItem *itm = item( editRow, editCol ); if ( !itm || itm->editType() == TQTableItem::OnTyping ) { - endEdit( editRow, editCol, TRUE, edMode != Editing ); - return TRUE; + endEdit( editRow, editCol, true, edMode != Editing ); + return true; } } break; @@ -4067,7 +4067,7 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) TQWheelEvent* we = (TQWheelEvent*)e; scrollBy( 0, -we->delta() ); we->accept(); - return TRUE; + return true; } #endif default: @@ -4126,30 +4126,30 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) int oldRow = tmpRow; int oldCol = tmpCol; - bool navigationKey = FALSE; + bool navigationKey = false; int r; switch ( e->key() ) { case Key_Left: tmpCol = TQMAX( 0, tmpCol - 1 ); - navigationKey = TRUE; + navigationKey = true; break; case Key_Right: tmpCol = TQMIN( numCols() - 1, tmpCol + 1 ); - navigationKey = TRUE; + navigationKey = true; break; case Key_Up: tmpRow = TQMAX( 0, tmpRow - 1 ); - navigationKey = TRUE; + navigationKey = true; break; case Key_Down: tmpRow = TQMIN( numRows() - 1, tmpRow + 1 ); - navigationKey = TRUE; + navigationKey = true; break; case Key_Prior: r = TQMAX( 0, rowAt( rowPos( tmpRow ) - visibleHeight() ) ); if ( r < tmpRow || tmpRow < 0 ) tmpRow = r; - navigationKey = TRUE; + navigationKey = true; break; case Key_Next: r = TQMIN( numRows() - 1, rowAt( rowPos( tmpRow ) + visibleHeight() ) ); @@ -4157,18 +4157,18 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) tmpRow = r; else tmpRow = numRows() - 1; - navigationKey = TRUE; + navigationKey = true; break; case Key_Home: tmpRow = 0; - navigationKey = TRUE; + navigationKey = true; break; case Key_End: tmpRow = numRows() - 1; - navigationKey = TRUE; + navigationKey = true; break; case Key_F2: - if ( beginEdit( tmpRow, tmpCol, FALSE ) ) + if ( beginEdit( tmpRow, tmpCol, false ) ) setEditMode( Editing, tmpRow, tmpCol ); break; case Key_Enter: case Key_Return: @@ -4207,7 +4207,7 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) TQTableItem *itm = item( tmpRow, tmpCol ); if ( !itm || itm->editType() == TQTableItem::OnTyping ) { TQWidget *w = beginEdit( tmpRow, tmpCol, - itm ? itm->isReplaceable() : TRUE ); + itm ? itm->isReplaceable() : true ); if ( w ) { setEditMode( ( !itm || ( itm && itm->isReplaceable() ) ? Replacing : Editing ), tmpRow, tmpCol ); @@ -4224,10 +4224,10 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) fixCell( tmpRow, tmpCol, e->key() ); if ( ( e->state() & ShiftButton ) == ShiftButton && selMode != NoSelection && selMode != SingleRow ) { - bool justCreated = FALSE; - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + bool justCreated = false; + setCurrentCell( tmpRow, tmpCol, false, true ); if ( !currentSel ) { - justCreated = TRUE; + justCreated = true; currentSel = new TQTableSelection(); selections.append( currentSel ); if ( !isRowSelection( selectionMode() ) ) @@ -4243,23 +4243,23 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) repaintSelections( justCreated ? 0 : &oldSelection, currentSel ); emit selectionChanged(); } else { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); if ( !isRowSelection( selectionMode() ) ) { clearSelection(); } else { - bool currentInSelection = tmpRow == oldRow && isSelected( tmpRow, tmpCol, FALSE ); + bool currentInSelection = tmpRow == oldRow && isSelected( tmpRow, tmpCol, false ); if ( !currentInSelection ) { - bool hasOldSel = FALSE; + bool hasOldSel = false; TQTableSelection oldSelection; if ( selectionMode() == MultiRow ) { bool b = signalsBlocked(); - blockSignals( TRUE ); + blockSignals( true ); clearSelection(); blockSignals( b ); } else { if ( currentSel ) { oldSelection = *currentSel; - hasOldSel = TRUE; + hasOldSel = true; selections.removeRef( currentSel ); leftHeader->setSectionState( oldSelection.topRow(), TQTableHeader::Normal ); } @@ -4274,7 +4274,7 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) } } } else { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); } } @@ -4283,7 +4283,7 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) void TQTable::focusInEvent( TQFocusEvent* ) { - d->inMenuMode = FALSE; + d->inMenuMode = false; TQWidget *editorWidget = cellWidget( editRow, editCol ); updateCell( curRow, curCol ); if ( style().styleHint( TQStyle::SH_ItemView_ChangeHighlightOnFocus, this ) ) @@ -4374,7 +4374,7 @@ void TQTable::paintEvent( TQPaintEvent *e ) #endif } -static bool inUpdateCell = FALSE; +static bool inUpdateCell = false; /*! Repaints the cell at \a row, \a col. @@ -4384,13 +4384,13 @@ void TQTable::updateCell( int row, int col ) { if ( inUpdateCell || row < 0 || col < 0 ) return; - inUpdateCell = TRUE; + inUpdateCell = true; TQRect cg = cellGeometry( row, col ); TQRect r( contentsToViewport( TQPoint( cg.x() - 2, cg.y() - 2 ) ), TQSize( cg.width() + 4, cg.height() + 4 ) ); if (viewport()->rect().intersects(r)) - TQApplication::postEvent( viewport(), new TQPaintEvent( r, FALSE ) ); - inUpdateCell = FALSE; + TQApplication::postEvent( viewport(), new TQPaintEvent( r, false ) ); + inUpdateCell = false; } void TQTable::repaintCell( int row, int col ) @@ -4404,7 +4404,7 @@ void TQTable::repaintCell( int row, int col ) TQRect v = viewport()->rect(); v.moveBy(contentsX(), contentsY()); if (v.intersects(r)) - repaintContents( r, FALSE ); + repaintContents( r, false ); } void TQTable::contentsToViewport2( int x, int y, int& vx, int& vy ) @@ -4450,10 +4450,10 @@ void TQTable::columnWidthChanged( int col ) resizeContents( s.width(), s.height() ); if ( contentsWidth() < w ) repaintContents( s.width(), contentsY(), - w - s.width() + 1, visibleHeight(), TRUE ); + w - s.width() + 1, visibleHeight(), true ); else repaintContents( w, contentsY(), - s.width() - w + 1, visibleHeight(), FALSE ); + s.width() - w + 1, visibleHeight(), false ); // update widgets that are affected by this change if ( widgets.size() ) { @@ -4481,10 +4481,10 @@ void TQTable::rowHeightChanged( int row ) resizeContents( s.width(), s.height() ); if ( contentsHeight() < h ) { repaintContents( contentsX(), contentsHeight(), - visibleWidth(), h - s.height() + 1, TRUE ); + visibleWidth(), h - s.height() + 1, true ); } else { repaintContents( contentsX(), h, - visibleWidth(), s.height() - h + 1, FALSE ); + visibleWidth(), s.height() - h + 1, false ); } // update widgets that are affected by this change @@ -4539,7 +4539,7 @@ void TQTable::columnIndexChanged( int, int fromIndex, int toIndex ) if ( doSort && lastSortCol == fromIndex && topHeader ) topHeader->setSortIndicator( toIndex, topHeader->sortIndicatorOrder() ); repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), FALSE ); + visibleWidth(), visibleHeight(), false ); } /*! @@ -4556,12 +4556,12 @@ void TQTable::columnIndexChanged( int, int fromIndex, int toIndex ) void TQTable::rowIndexChanged( int, int, int ) { repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), FALSE ); + visibleWidth(), visibleHeight(), false ); } /*! This function is called when the column \a col has been clicked. - The default implementation sorts this column if sorting() is TRUE. + The default implementation sorts this column if sorting() is true. */ void TQTable::columnClicked( int col ) @@ -4573,7 +4573,7 @@ void TQTable::columnClicked( int col ) asc = !asc; } else { lastSortCol = col; - asc = TRUE; + asc = true; } sortColumn( lastSortCol, asc ); } @@ -4597,11 +4597,11 @@ bool TQTable::sorting() const return doSort; } -static bool inUpdateGeometries = FALSE; +static bool inUpdateGeometries = false; void TQTable::delayedUpdateGeometries() { - d->geomTimer->start( 0, TRUE ); + d->geomTimer->start( 0, true ); } void TQTable::updateGeometriesSlot() @@ -4618,7 +4618,7 @@ void TQTable::updateGeometries() { if ( inUpdateGeometries ) return; - inUpdateGeometries = TRUE; + inUpdateGeometries = true; TQSize ts = tableSize(); if ( topHeader->offset() && ts.width() < topHeader->offset() + topHeader->width() ) @@ -4635,7 +4635,7 @@ void TQTable::updateGeometries() verticalScrollBar()->raise(); topHeader->updateStretches(); leftHeader->updateStretches(); - inUpdateGeometries = FALSE; + inUpdateGeometries = false; } /*! @@ -4779,7 +4779,7 @@ void TQTable::saveContents( TQPtrVector<TQTableItem> &tmp, { int nCols = numCols(); if ( editRow != -1 && editCol != -1 ) - endEdit( editRow, editCol, FALSE, edMode != Editing ); + endEdit( editRow, editCol, false, edMode != Editing ); tmp.resize( contents.size() ); tmp2.resize( widgets.size() ); int i; @@ -4808,12 +4808,12 @@ void TQTable::updateHeaderAndResizeContents( TQTableHeader *header, header->TQHeader::resizeArrays( rowCol ); header->TQTableHeader::resizeArrays( rowCol ); int old = num; - clearSelection( FALSE ); + clearSelection( false ); int i = 0; for ( i = old; i < rowCol; ++i ) header->addLabel( TQString::null, width ); } else { - clearSelection( FALSE ); + clearSelection( false ); if ( header == leftHeader ) { while ( numRows() > rowCol ) header->removeLabel( numRows() - 1 ); @@ -4823,12 +4823,12 @@ void TQTable::updateHeaderAndResizeContents( TQTableHeader *header, } } - contents.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); contents.clear(); - contents.setAutoDelete( TRUE ); - widgets.setAutoDelete( FALSE ); + contents.setAutoDelete( true ); + widgets.setAutoDelete( false ); widgets.clear(); - widgets.setAutoDelete( TRUE ); + widgets.setAutoDelete( true ); resizeData( numRows() * numCols() ); // keep numStretches in sync @@ -4888,10 +4888,10 @@ void TQTable::finishContentsResze( bool updateBefore ) updateGeometries(); if ( updateBefore ) repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), TRUE ); + visibleWidth(), visibleHeight(), true ); else repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), FALSE ); + visibleWidth(), visibleHeight(), false ); if ( isRowSelection( selectionMode() ) ) { int r = curRow; @@ -4920,7 +4920,7 @@ void TQTable::setNumRows( int r ) saveContents( tmp, tmp2 ); bool isUpdatesEnabled = leftHeader->isUpdatesEnabled(); - leftHeader->setUpdatesEnabled( FALSE ); + leftHeader->setUpdatesEnabled( false ); bool updateBefore; updateHeaderAndResizeContents( leftHeader, numRows(), r, 20, updateBefore ); @@ -4969,7 +4969,7 @@ void TQTable::setNumCols( int c ) saveContents( tmp, tmp2 ); bool isUpdatesEnabled = topHeader->isUpdatesEnabled(); - topHeader->setUpdatesEnabled( FALSE ); + topHeader->setUpdatesEnabled( false ); bool updateBefore; updateHeaderAndResizeContents( topHeader, numCols(), c, 100, updateBefore ); @@ -5009,15 +5009,15 @@ void TQTable::setColumnLabels( const TQStringList &labels ) This function returns the widget which should be used as an editor for the contents of the cell at \a row, \a col. - If \a initFromCell is TRUE, the editor is used to edit the current + 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 + with this content). If \a initFromCell is false, the content of 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 - TRUE or the cell has a TQTableItem and the table item's - TQTableItem::isReplaceable() is FALSE then the cell is asked to + true or the cell has a TQTableItem and the table item's + TQTableItem::isReplaceable() is false then the cell is asked to create an appropriate editor (using TQTableItem::createEditor()). Otherwise a TQLineEdit is used as the editor. @@ -5068,7 +5068,7 @@ TQWidget *TQTable::createEditor( int row, int col, bool initFromCell ) const // no contents in the cell yet, so open the default editor if ( !e ) { e = new TQLineEdit( viewport(), "qt_lineeditor" ); - ( (TQLineEdit*)e )->setFrame( FALSE ); + ( (TQLineEdit*)e )->setFrame( false ); } return e; @@ -5080,7 +5080,7 @@ TQWidget *TQTable::createEditor( int row, int col, bool initFromCell ) const (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 replace the cell's content - with the editor's content.) If \a replace is TRUE the editor will + 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. @@ -5115,11 +5115,11 @@ TQWidget *TQTable::beginEdit( int row, int col, bool replace ) This function is called when in-place editing of the cell at \a row, \a col is requested to stop. - If the cell is not being edited or \a accept is FALSE the function + If the cell is not being edited or \a accept is false the function 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 replace is TRUE the current content of + If \a accept is true the content of the editor must be transferred + 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 @@ -5208,8 +5208,8 @@ void TQTable::setCellContentFromEditor( int row, int col ) } /*! - Returns TRUE if the \l EditMode is \c Editing or \c Replacing; - otherwise (i.e. the \l EditMode is \c NotEditing) returns FALSE. + Returns true if the \l EditMode is \c Editing or \c Replacing; + otherwise (i.e. the \l EditMode is \c NotEditing) returns false. \sa TQTable::EditMode */ @@ -5275,8 +5275,8 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, if ( oldSelection && !oldSelection->isActive() ) oldSelection = 0; - bool optimizeOld = FALSE; - bool optimizeNew = FALSE; + bool optimizeOld = false; + bool optimizeNew = false; TQRect old; if ( oldSelection ) @@ -5303,7 +5303,7 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, old.width() > SHRT_MAX || old.height() > SHRT_MAX || cur.width() > SHRT_MAX || cur.height() > SHRT_MAX ) { TQRect rr = cur.unite( old ); - repaintContents( rr, FALSE ); + repaintContents( rr, false ); } else { old = TQRect( contentsToViewport2( old.topLeft() ), old.size() ); cur = TQRect( contentsToViewport2( cur.topLeft() ), cur.size() ); @@ -5315,12 +5315,12 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, for ( i = 0; i < (int)r3.rects().count(); ++i ) { TQRect r( r3.rects()[ i ] ); r = TQRect( viewportToContents2( r.topLeft() ), r.size() ); - repaintContents( r, FALSE ); + repaintContents( r, false ); } for ( i = 0; i < (int)r4.rects().count(); ++i ) { TQRect r( r4.rects()[ i ] ); r = TQRect( viewportToContents2( r.topLeft() ), r.size() ); - repaintContents( r, FALSE ); + repaintContents( r, false ); } } @@ -5354,13 +5354,13 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, for ( i = left; i <= right; ++i ) { if ( !isColumnSelected( i ) ) *s = TQTableHeader::Normal; - else if ( isColumnSelected( i, TRUE ) ) + else if ( isColumnSelected( i, true ) ) *s = TQTableHeader::Selected; else *s = TQTableHeader::Bold; ++s; } - topHeader->repaint( FALSE ); + topHeader->repaint( false ); } if ( updateVertical && numRows() > 0 && top >= 0 ) { @@ -5368,13 +5368,13 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, for ( i = top; i <= bottom; ++i ) { if ( !isRowSelected( i ) ) *s = TQTableHeader::Normal; - else if ( isRowSelected( i, TRUE ) ) + else if ( isRowSelected( i, true ) ) *s = TQTableHeader::Selected; else *s = TQTableHeader::Bold; ++s; } - leftHeader->repaint( FALSE ); + leftHeader->repaint( false ); } } @@ -5396,12 +5396,12 @@ void TQTable::repaintSelections() s->rightCol(), b ) ); } - repaintContents( r, FALSE ); + repaintContents( r, false ); } /*! Clears all selections and repaints the appropriate regions if \a - repaint is TRUE. + repaint is true. \sa removeSelection() */ @@ -5425,13 +5425,13 @@ void TQTable::clearSelection( bool repaint ) selections.clear(); if ( needRepaint && repaint ) - repaintContents( r, FALSE ); + repaintContents( r, false ); leftHeader->setSectionStateToAll( TQTableHeader::Normal ); - leftHeader->repaint( FALSE ); + leftHeader->repaint( false ); if ( !isRowSelection( selectionMode() ) ) { topHeader->setSectionStateToAll( TQTableHeader::Normal ); - topHeader->repaint( FALSE ); + topHeader->repaint( false ); } topHeader->setSectionState( curCol, TQTableHeader::Bold ); leftHeader->setSectionState( curRow, TQTableHeader::Bold ); @@ -5452,14 +5452,14 @@ TQRect TQTable::rangeGeometry( int topRow, int leftCol, int ca = columnAt( contentsX() + visibleWidth() ); if ( ca != -1 ) rightCol = TQMIN( rightCol, ca ); - optimize = TRUE; + optimize = true; TQRect rect; for ( int r = topRow; r <= bottomRow; ++r ) { for ( int c = leftCol; c <= rightCol; ++c ) { rect = rect.unite( cellGeometry( r, c ) ); TQTableItem *i = item( r, c ); if ( i && ( i->rowSpan() > 1 || i->colSpan() > 1 ) ) - optimize = FALSE; + optimize = false; } } return rect; @@ -5563,10 +5563,10 @@ static int cmpTableItems( const void *n1, const void *n2 ) #endif /*! - Sorts column \a col. If \a ascending is TRUE the sort is in + Sorts column \a col. If \a ascending is true the sort is in ascending order, otherwise the sort is in descending order. - If \a wholeRows is TRUE, entire rows are sorted using swapRows(); + If \a wholeRows is true, entire rows are sorted using swapRows(); otherwise only cells in the column are sorted using swapCells(). Note that if you are not using TQTableItems you will need to @@ -5600,7 +5600,7 @@ void TQTable::sortColumn( int col, bool ascending, bool wholeRows ) qsort( items, filledRows, sizeof( SortableTableItem ), cmpTableItems ); bool updatesEnabled = isUpdatesEnabled(); - setUpdatesEnabled( FALSE ); + setUpdatesEnabled( false ); for ( i = 0; i < numRows(); ++i ) { if ( i < filledRows ) { if ( ascending ) { @@ -5627,10 +5627,10 @@ void TQTable::sortColumn( int col, bool ascending, bool wholeRows ) if ( !wholeRows ) repaintContents( columnPos( col ), contentsY(), - columnWidth( col ), visibleHeight(), FALSE ); + columnWidth( col ), visibleHeight(), false ); else repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), FALSE ); + visibleWidth(), visibleHeight(), false ); delete [] items; } @@ -5647,7 +5647,7 @@ void TQTable::hideRow( int row ) return; d->hiddenRows.replace( row, new int( leftHeader->sectionSize( row ) ) ); leftHeader->resizeSection( row, 0 ); - leftHeader->setResizeEnabled( FALSE, row ); + leftHeader->setResizeEnabled( false, row ); if ( isRowStretchable(row) ) leftHeader->numStretches--; rowHeightChanged( row ); @@ -5673,7 +5673,7 @@ void TQTable::hideColumn( int col ) return; d->hiddenCols.replace( col, new int( topHeader->sectionSize( col ) ) ); topHeader->resizeSection( col, 0 ); - topHeader->setResizeEnabled( FALSE, col ); + topHeader->setResizeEnabled( false, col ); if ( isColumnStretchable(col) ) topHeader->numStretches--; columnWidthChanged( col ); @@ -5705,7 +5705,7 @@ void TQTable::showRow( int row ) } else if ( rowHeight( row ) == 0 ) { setRowHeight( row, 20 ); } - leftHeader->setResizeEnabled( TRUE, row ); + leftHeader->setResizeEnabled( true, row ); } /*! @@ -5726,12 +5726,12 @@ void TQTable::showColumn( int col ) } else if ( columnWidth( col ) == 0 ) { setColumnWidth( col, 20 ); } - topHeader->setResizeEnabled( TRUE, col ); + topHeader->setResizeEnabled( true, col ); } /*! - Returns TRUE if row \a row is hidden; otherwise returns - FALSE. + Returns true if row \a row is hidden; otherwise returns + false. \sa hideRow(), isColumnHidden() */ @@ -5741,8 +5741,8 @@ bool TQTable::isRowHidden( int row ) const } /*! - Returns TRUE if column \a col is hidden; otherwise returns - FALSE. + Returns true if column \a col is hidden; otherwise returns + false. \sa hideColumn(), isRowHidden() */ @@ -5853,7 +5853,7 @@ void TQTable::adjustRow( int row ) } /*! - If \a stretch is TRUE, column \a col is set to be stretchable; + If \a stretch is true, column \a col is set to be stretchable; otherwise column \a col is set to be unstretchable. If the table widget's width decreases or increases stretchable @@ -5873,7 +5873,7 @@ void TQTable::setColumnStretchable( int col, bool stretch ) } /*! - If \a stretch is TRUE, row \a row is set to be stretchable; + If \a stretch is true, row \a row is set to be stretchable; otherwise row \a row is set to be unstretchable. If the table widget's height decreases or increases stretchable @@ -5893,8 +5893,8 @@ void TQTable::setRowStretchable( int row, bool stretch ) } /*! - Returns TRUE if column \a col is stretchable; otherwise returns - FALSE. + Returns true if column \a col is stretchable; otherwise returns + false. \sa setColumnStretchable() isRowStretchable() */ @@ -5905,8 +5905,8 @@ bool TQTable::isColumnStretchable( int col ) const } /*! - Returns TRUE if row \a row is stretchable; otherwise returns - FALSE. + Returns true if row \a row is stretchable; otherwise returns + false. \sa setRowStretchable() isColumnStretchable() */ @@ -5934,7 +5934,7 @@ void TQTable::takeItem( TQTableItem *i ) if ( !i ) return; TQRect rect = cellGeometry( i->row(), i->col() ); - contents.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); int bottom = i->row() + i->rowSpan(); if ( bottom > numRows() ) bottom = numRows(); @@ -5945,8 +5945,8 @@ void TQTable::takeItem( TQTableItem *i ) for ( int c = i->col(); c < right; ++c ) contents.remove( indexOf( r, c ) ); } - contents.setAutoDelete( TRUE ); - repaintContents( rect, FALSE ); + contents.setAutoDelete( true ); + repaintContents( rect, false ); int orow = i->row(); int ocol = i->col(); i->setRow( -1 ); @@ -5981,7 +5981,7 @@ void TQTable::setCellWidget( int row, int col, TQWidget *e ) TQWidget *w = cellWidget( row, col ); if ( w && row == editRow && col == editCol ) - endEdit( editRow, editCol, FALSE, edMode != Editing ); + endEdit( editRow, editCol, false, edMode != Editing ); e->installEventFilter( this ); clearCellWidget( row, col ); @@ -6067,9 +6067,9 @@ void TQTable::clearCellWidget( int row, int col ) w->removeEventFilter( this ); w->deleteLater(); } - widgets.setAutoDelete( FALSE ); + widgets.setAutoDelete( false ); widgets.remove( indexOf( row, col ) ); - widgets.setAutoDelete( TRUE ); + widgets.setAutoDelete( true ); } /*! @@ -6081,7 +6081,7 @@ void TQTable::clearCellWidget( int row, int col ) */ /*! - If \a b is TRUE, the table starts a drag (see dragObject()) when + If \a b is true, the table starts a drag (see dragObject()) when the user presses and moves the mouse on a selected cell. */ @@ -6091,7 +6091,7 @@ void TQTable::setDragEnabled( bool b ) } /*! - If this function returns TRUE, the table supports dragging. + If this function returns true, the table supports dragging. \sa setDragEnabled(); */ @@ -6124,9 +6124,9 @@ void TQTable::insertRows( int row, int count ) return; bool updatesEnabled = isUpdatesEnabled(); - setUpdatesEnabled( FALSE ); + setUpdatesEnabled( false ); bool leftHeaderUpdatesEnabled = leftHeader->isUpdatesEnabled(); - leftHeader->setUpdatesEnabled( FALSE ); + leftHeader->setUpdatesEnabled( false ); int oldLeftMargin = leftMargin(); setNumRows( numRows() + count ); @@ -6141,7 +6141,7 @@ void TQTable::insertRows( int row, int count ) int cc = TQMAX( 0, currentColumn() ); if ( curRow > row ) curRow -= count; // this is where curRow was - setCurrentCell( cr, cc, TRUE, FALSE ); // without ensureCellVisible + setCurrentCell( cr, cc, true, false ); // without ensureCellVisible // Repaint the header if ( leftHeaderUpdatesEnabled ) { @@ -6182,9 +6182,9 @@ void TQTable::insertColumns( int col, int count ) return; bool updatesEnabled = isUpdatesEnabled(); - setUpdatesEnabled( FALSE ); + setUpdatesEnabled( false ); bool topHeaderUpdatesEnabled = topHeader->isUpdatesEnabled(); - topHeader->setUpdatesEnabled( FALSE ); + topHeader->setUpdatesEnabled( false ); int oldTopMargin = topMargin(); setNumCols( numCols() + count ); @@ -6199,7 +6199,7 @@ void TQTable::insertColumns( int col, int count ) int cc = TQMAX( 0, currentColumn() ); if ( curCol > col ) curCol -= count; // this is where curCol was - setCurrentCell( cr, cc, TRUE, FALSE ); // without ensureCellVisible + setCurrentCell( cr, cc, true, false ); // without ensureCellVisible // Repaint the header if ( topHeaderUpdatesEnabled ) { @@ -6321,7 +6321,7 @@ void TQTable::removeColumns( const TQMemArray<int> &cols ) /*! Starts editing the cell at \a row, \a col. - If \a replace is TRUE the content of this cell will be replaced 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. @@ -6360,7 +6360,7 @@ void TQTable::contentsDragEnterEvent( TQDragEnterEvent *e ) fixRow( tmpRow, e->pos().y() ); fixCol( tmpCol, e->pos().x() ); if (e->source() != (TQObject*)cellWidget( currentRow(), currentColumn() ) ) - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); e->accept(); } @@ -6379,7 +6379,7 @@ void TQTable::contentsDragMoveEvent( TQDragMoveEvent *e ) fixRow( tmpRow, e->pos().y() ); fixCol( tmpCol, e->pos().x() ); if (e->source() != (TQObject*)cellWidget( currentRow(), currentColumn() ) ) - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); e->accept(); } @@ -6390,7 +6390,7 @@ void TQTable::contentsDragMoveEvent( TQDragMoveEvent *e ) void TQTable::contentsDragLeaveEvent( TQDragLeaveEvent * ) { - setCurrentCell( oldCurrentRow, oldCurrentCol, FALSE, TRUE ); + setCurrentCell( oldCurrentRow, oldCurrentCol, false, true ); } /*! @@ -6401,13 +6401,13 @@ void TQTable::contentsDragLeaveEvent( TQDragLeaveEvent * ) void TQTable::contentsDropEvent( TQDropEvent *e ) { - setCurrentCell( oldCurrentRow, oldCurrentCol, FALSE, TRUE ); + setCurrentCell( oldCurrentRow, oldCurrentCol, false, true ); emit dropped( e ); } /*! If the user presses the mouse on a selected cell, starts moving - (i.e. dragging), and dragEnabled() is TRUE, this function is + (i.e. dragging), and dragEnabled() is true, this function is called to obtain a drag object. A drag using this object begins immediately unless dragObject() returns 0. @@ -6465,7 +6465,7 @@ void TQTable::setEnabled( bool b ) if ( !b ) { // editor will lose focus, causing a crash deep in setEnabled(), // so we'll end the edit early. - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); } TQScrollView::setEnabled(b); } @@ -6507,16 +6507,16 @@ void TQTable::setEnabled( bool b ) TQTableHeader::TQTableHeader( int i, TQTable *t, TQWidget *parent, const char *name ) - : TQHeader( i, parent, name ), mousePressed(FALSE), startPos(-1), - table( t ), caching( FALSE ), resizedSection(-1), + : TQHeader( i, parent, name ), mousePressed(false), startPos(-1), + table( t ), caching( false ), resizedSection(-1), numStretches( 0 ) { - setIsATableHeader( TRUE ); + setIsATableHeader( true ); d = 0; states.resize( i ); stretchable.resize( i ); states.fill( Normal, -1 ); - stretchable.fill( FALSE, -1 ); + stretchable.fill( false, -1 ); autoScrollTimer = new TQTimer( this ); connect( autoScrollTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( doAutoScroll() ) ); @@ -6563,7 +6563,7 @@ void TQTableHeader::addLabel( const TQString &s , int size ) stretchable.resize( count() ); for ( ; s < count(); ++s ) { states[ s ] = Normal; - stretchable[ s ] = FALSE; + stretchable[ s ] = false; } } } @@ -6584,7 +6584,7 @@ void TQTableHeader::resizeArrays( int n ) stretchable.resize( n ); if ( n > old ) { for ( int i = old; i < n; ++i ) { - stretchable[ i ] = FALSE; + stretchable[ i ] = false; states[ i ] = Normal; } } @@ -6621,9 +6621,9 @@ void TQTableHeader::setSectionState( int s, SectionState astate ) states.data()[ s ] = astate; if ( isUpdatesEnabled() ) { if ( orientation() == Horizontal ) - repaint( sectionPos( s ) - offset(), 0, sectionSize( s ), height(), FALSE ); + repaint( sectionPos( s ) - offset(), 0, sectionSize( s ), height(), false ); else - repaint( 0, sectionPos( s ) - offset(), width(), sectionSize( s ), FALSE ); + repaint( 0, sectionPos( s ) - offset(), width(), sectionSize( s ), false ); } } @@ -6692,7 +6692,7 @@ void TQTableHeader::paintEvent( TQPaintEvent *e ) if ( !( orientation() == Horizontal && isRowSelection( table->selectionMode() ) ) && ( sectionState( i ) == Bold || sectionState( i ) == Selected ) ) { TQFont f( font() ); - f.setBold( TRUE ); + f.setBold( true ); p.setFont( f ); } paintSection( &p, i, r ); @@ -6755,14 +6755,14 @@ void TQTableHeader::mousePressEvent( TQMouseEvent *e ) if ( e->button() != LeftButton ) return; TQHeader::mousePressEvent( e ); - mousePressed = TRUE; + mousePressed = true; pressPos = real_pos( e->pos(), orientation() ); if ( !table->currentSel || ( e->state() & ShiftButton ) != ShiftButton ) startPos = -1; - setCaching( TRUE ); + setCaching( true ); resizedSection = -1; #ifdef TQT_NO_CURSOR - isResizing = FALSE; + isResizing = false; #else isResizing = cursor().shape() != ArrowCursor; if ( !isResizing && sectionAt( pressPos ) != -1 ) @@ -6796,13 +6796,13 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) if ( isRowSelection( table->selectionMode() ) ) { if ( orientation() == Horizontal ) - return TRUE; + return true; if ( table->selectionMode() == TQTable::SingleRow ) { int secAt = sectionAt( p ); if ( secAt == -1 ) - return TRUE; + return true; table->setCurrentCell( secAt, table->currentColumn() ); - return TRUE; + return true; } } @@ -6814,7 +6814,7 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) table->selectionMode() == TQTable::SingleRow ) { startPos = p; bool b = table->signalsBlocked(); - table->blockSignals( TRUE ); + table->blockSignals( true ); table->clearSelection(); table->blockSignals( b ); } @@ -6825,7 +6825,7 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) TQTableSelection *oldSelection = table->currentSel; if ( orientation() == Vertical ) { - if ( !table->isRowSelected( secAt, TRUE ) ) { + if ( !table->isRowSelected( secAt, true ) ) { table->currentSel = new TQTableSelection(); table->selections.append( table->currentSel ); table->currentSel->init( secAt, 0 ); @@ -6834,7 +6834,7 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) } table->setCurrentCell( secAt, 0 ); } else { // orientation == Horizontal - if ( !table->isColumnSelected( secAt, TRUE ) ) { + if ( !table->isColumnSelected( secAt, true ) ) { table->currentSel = new TQTableSelection(); table->selections.append( table->currentSel ); table->currentSel->init( 0, secAt ); @@ -6855,7 +6855,7 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) if ( sectionAt( p ) != -1 ) endPos = p; - return TRUE; + return true; } } @@ -6866,12 +6866,12 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) p -= offset(); if ( orientation() == Horizontal && ( p < 0 || p > width() ) ) { doAutoScroll(); - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } else if ( orientation() == Vertical && ( p < 0 || p > height() ) ) { doAutoScroll(); - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } - return TRUE; + return true; } return table->selectionMode() == TQTable::NoSelection; } @@ -6907,8 +6907,8 @@ void TQTableHeader::mouseReleaseEvent( TQMouseEvent *e ) if ( e->button() != LeftButton ) return; autoScrollTimer->stop(); - mousePressed = FALSE; - setCaching( FALSE ); + mousePressed = false; + setCaching( false ); TQHeader::mouseReleaseEvent( e ); #ifndef NO_LINE_WIDGET line1->hide(); @@ -6990,7 +6990,7 @@ void TQTableHeader::resizeEvent( TQResizeEvent *e ) TQHeader::resizeEvent( e ); if ( numStretches == 0 ) return; - stretchTimer->start( 0, TRUE ); + stretchTimer->start( 0, true ); } void TQTableHeader::updateStretches() @@ -7005,7 +7005,7 @@ void TQTableHeader::updateStretches() int pd = dim - ( sectionPos(count() - 1) + sectionSize(count() - 1) ); bool block = signalsBlocked(); - blockSignals( TRUE ); + blockSignals( true ); for ( i = 0; i < (int)stretchable.count(); ++i ) { if ( !stretchable[i] || ( stretchable[i] && table->d->hiddenCols[i] ) ) @@ -7023,8 +7023,8 @@ void TQTableHeader::updateStretches() resizeSection( i, TQMAX( 20, pd ) ); } blockSignals( block ); - table->repaintContents( FALSE ); - widgetStretchTimer->start( 100, TRUE ); + table->repaintContents( false ); + widgetStretchTimer->start( 100, true ); } void TQTableHeader::updateWidgetStretches() @@ -7052,7 +7052,7 @@ void TQTableHeader::updateSelections() *s = Selected; ++s; } - repaint( FALSE ); + repaint( false ); if (table->currentSel) { TQTableSelection oldSelection = *table->currentSel; @@ -7090,7 +7090,7 @@ void TQTableHeader::doAutoScroll() else table->ensureVisible( table->contentsX(), endPos ); updateSelections(); - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } void TQTableHeader::sectionWidthChanged( int col, int, int ) @@ -7250,7 +7250,7 @@ void TQTableHeader::setCaching( bool b ) } /*! - If \a b is TRUE, section \a s is stretchable; otherwise the + If \a b is true, section \a s is stretchable; otherwise the section is not stretchable. \sa isSectionStretchable() @@ -7268,8 +7268,8 @@ void TQTableHeader::setSectionStretchable( int s, bool b ) } /*! - Returns TRUE if section \a s is stretcheable; otherwise returns - FALSE. + Returns true if section \a s is stretcheable; otherwise returns + false. \sa setSectionStretchable() */ @@ -7282,7 +7282,7 @@ bool TQTableHeader::isSectionStretchable( int s ) const void TQTableHeader::swapSections( int oldIdx, int newIdx, bool swapTable ) { extern bool tqt_qheader_label_return_null_strings; // tqheader.cpp - tqt_qheader_label_return_null_strings = TRUE; + tqt_qheader_label_return_null_strings = true; TQIconSet oldIconSet, newIconSet; if ( iconSet( oldIdx ) ) @@ -7298,7 +7298,7 @@ void TQTableHeader::swapSections( int oldIdx, int newIdx, bool swapTable ) setLabel( newIdx, oldIconSet, oldLabel ); } - tqt_qheader_label_return_null_strings = FALSE; + tqt_qheader_label_return_null_strings = false; int w1 = sectionSize( oldIdx ); int w2 = sectionSize( newIdx ); @@ -7344,7 +7344,7 @@ void TQTableHeader::setLabels(const TQStringList & labels) int i = 0; bool updates = isUpdatesEnabled(); const int c = TQMIN(count(), (int)labels.count()); - setUpdatesEnabled(FALSE); + setUpdatesEnabled(false); for ( TQStringList::ConstIterator it = labels.begin(); i < c; ++i, ++it ) { if (i == c - 1) { setUpdatesEnabled(updates); diff --git a/src/table/tqtable.h b/src/table/tqtable.h index 9f2535ec7..d26c06642 100644 --- a/src/table/tqtable.h +++ b/src/table/tqtable.h @@ -183,7 +183,7 @@ private: class TQM_EXPORT_TABLE TQComboTableItem : public TQTableItem { public: - TQComboTableItem( TQTable *table, const TQStringList &list, bool editable = FALSE ); + TQComboTableItem( TQTable *table, const TQStringList &list, bool editable = false ); ~TQComboTableItem(); virtual TQWidget *createEditor() const; virtual void setContentFromEditor( TQWidget *w ); @@ -302,8 +302,8 @@ public: void ensureCellVisible( int row, int col ); bool isSelected( int row, int col ) const; - bool isRowSelected( int row, bool full = FALSE ) const; - bool isColumnSelected( int col, bool full = FALSE ) const; + bool isRowSelected( int row, bool full = false ) const; + bool isColumnSelected( int col, bool full = false ) const; int numSelections() const; TQTableSelection selection( int num ) const; virtual int addSelection( const TQTableSelection &s ); @@ -320,8 +320,8 @@ public: bool columnMovingEnabled() const; bool rowMovingEnabled() const; - virtual void sortColumn( int col, bool ascending = TRUE, - bool wholeRows = FALSE ); + virtual void sortColumn( int col, bool ascending = true, + bool wholeRows = false ); bool sorting() const; virtual void takeItem( TQTableItem *i ); @@ -375,14 +375,14 @@ public slots: bool isColumnStretchable( int col ) const; bool isRowStretchable( int row ) const; virtual void setSorting( bool b ); - virtual void swapRows( int row1, int row2, bool swapHeader = FALSE ); - virtual void swapColumns( int col1, int col2, bool swapHeader = FALSE ); + virtual void swapRows( int row1, int row2, bool swapHeader = false ); + virtual void swapColumns( int col1, int col2, bool swapHeader = false ); virtual void swapCells( int row1, int col1, int row2, int col2 ); virtual void setLeftMargin( int m ); virtual void setTopMargin( int m ); virtual void setCurrentCell( int row, int col ); - void clearSelection( bool repaint = TRUE ); + void clearSelection( bool repaint = true ); virtual void setColumnMovingEnabled( bool b ); virtual void setRowMovingEnabled( bool b ); @@ -400,7 +400,7 @@ public slots: virtual void removeColumn( int col ); virtual void removeColumns( const TQMemArray<int> &cols ); - virtual void editCell( int row, int col, bool replace = FALSE ); + virtual void editCell( int row, int col, bool replace = false ); void setRowLabels( const TQStringList &labels ); void setColumnLabels( const TQStringList &labels ); @@ -476,8 +476,8 @@ private: void updateGeometries(); void repaintSelections( TQTableSelection *oldSelection, TQTableSelection *newSelection, - bool updateVertical = TRUE, - bool updateHorizontal = TRUE ); + bool updateVertical = true, + bool updateHorizontal = true ); TQRect rangeGeometry( int topRow, int leftCol, int bottomRow, int rightCol, bool &optimize ); void fixRow( int &row, int y ); @@ -494,7 +494,7 @@ private: void updateRowWidgets( int row ); void updateColWidgets( int col ); bool isSelected( int row, int col, bool includeCurrent ) const; - void setCurrentCell( int row, int col, bool updateSelections, bool ensureVisible = FALSE ); + void setCurrentCell( int row, int col, bool updateSelections, bool ensureVisible = false ); void fixCell( int &row, int &col, int key ); void delayedUpdateGeometries(); struct TableWidget |
