Changeset 561 for trunk/src/sql/kernel/qsqlquery.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/sql/kernel/qsqlquery.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtSql module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 62 62 QAtomicInt ref; 63 63 QSqlResult* sqlResult; 64 QSql::NumericalPrecisionPolicy precisionPolicy;65 64 66 65 static QSqlQueryPrivate* shared_null(); … … 82 81 */ 83 82 QSqlQueryPrivate::QSqlQueryPrivate(QSqlResult* result) 84 : ref(1), sqlResult(result) , precisionPolicy(QSql::HighPrecision)83 : ref(1), sqlResult(result) 85 84 { 86 85 if (!sqlResult) … … 103 102 \ingroup database 104 103 \ingroup shared 105 \mainclass 104 106 105 \inmodule QtSql 107 106 … … 352 351 bool fo = isForwardOnly(); 353 352 *this = QSqlQuery(driver()->createResult()); 354 d->sqlResult->setNumericalPrecisionPolicy(d-> precisionPolicy);353 d->sqlResult->setNumericalPrecisionPolicy(d->); 355 354 setForwardOnly(fo); 356 355 } else { … … 359 358 d->sqlResult->setLastError(QSqlError()); 360 359 d->sqlResult->setAt(QSql::BeforeFirstRow); 361 d->sqlResult->setNumericalPrecisionPolicy(d-> precisionPolicy);360 d->sqlResult->setNumericalPrecisionPolicy(d->); 362 361 } 363 362 d->sqlResult->setQuery(query.trimmed()); … … 813 812 efficient since results do not need to be cached. It will also 814 813 improve performance on some databases. For this to be true, you must 815 call \c setForward Mode() before the query is prepared or executed.814 call \c setForward() before the query is prepared or executed. 816 815 Note that the constructor that takes a query and a database may 817 816 execute the query. … … 819 818 Forward only mode is off by default. 820 819 821 \sa isForwardOnly(), next(), seek() 820 Setting forward only to false is a suggestion to the database engine, 821 which has the final say on whether a result set is forward only or 822 scrollable. isForwardOnly() will always return the correct status of 823 the result set. 824 825 \sa isForwardOnly(), next(), seek(), QSqlResult::setForwardOnly() 822 826 */ 823 827 void QSqlQuery::setForwardOnly(bool forward) … … 892 896 *this = QSqlQuery(driver()->createResult()); 893 897 setForwardOnly(fo); 894 d->sqlResult->setNumericalPrecisionPolicy(d-> precisionPolicy);898 d->sqlResult->setNumericalPrecisionPolicy(d->); 895 899 } else { 896 900 d->sqlResult->setActive(false); 897 901 d->sqlResult->setLastError(QSqlError()); 898 902 d->sqlResult->setAt(QSql::BeforeFirstRow); 899 d->sqlResult->setNumericalPrecisionPolicy(d-> precisionPolicy);903 d->sqlResult->setNumericalPrecisionPolicy(d->); 900 904 } 901 905 if (!driver()) { … … 1127 1131 precision specified by \a precisionPolicy. 1128 1132 1129 The Oracle driver, for example, retrievesnumerical values as1130 strings by default to prevent the loss of precision. If the high1131 precision doesn't matter, use this method to increase execution1132 s peed by bypassing string conversions.1133 The Oracle driver, for example, numerical values as 1134 strings 1135 1136 string conversions. 1133 1137 1134 1138 Note: Drivers that don't support fetching numerical values with low … … 1145 1149 void QSqlQuery::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy) 1146 1150 { 1147 d-> precisionPolicy = precisionPolicy;1151 d->; 1148 1152 } 1149 1153 … … 1155 1159 QSql::NumericalPrecisionPolicy QSqlQuery::numericalPrecisionPolicy() const 1156 1160 { 1157 return d-> precisionPolicy;1161 return d->; 1158 1162 } 1159 1163 … … 1196 1200 result set and must be navigated to a valid record before data 1197 1201 values can be retrieved. If a new result set isn't available the 1198 function returns false and the thequery is set to inactive. In any1202 function returns false and the query is set to inactive. In any 1199 1203 case the old result set will be discarded. 1200 1204
Note:
See TracChangeset
for help on using the changeset viewer.