diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-02-15 06:09:59 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-02-15 06:09:59 (GMT) |
commit | a26ae9efb66adcd0f6253b363324c435f5510f6c (patch) | |
tree | fb4c56662c1564d421f8dfc3c8465b1a68b34636 /src/sql/models/qsqlquerymodel.cpp | |
parent | 51872de548e1840431ef37f9172cb06f77875462 (diff) | |
parent | 53e589563f4adc51983703e6119c762bd81f584b (diff) | |
download | Qt-a26ae9efb66adcd0f6253b363324c435f5510f6c.zip Qt-a26ae9efb66adcd0f6253b363324c435f5510f6c.tar.gz Qt-a26ae9efb66adcd0f6253b363324c435f5510f6c.tar.bz2 |
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-releng-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-releng-team: (506 commits)
Removed timestamp setting and checking for Symbian header export
Cocoa/Alien: bugfix corner cases with popups and enter/leave
My 4.7.2 changes
Fix QFileDialog Symbian native file dialog filename filtering.
fix QMAKE_COPY_DIR for mingw+sh
Phonon MMF backend enabled in configuration and deployment
Using a better flag to control the fast allocator
Using QElapesedTimer for Symbian idle detector
Idle detector thread improvements
Updated QtGui and QtCore DEF files
Update tests for QScriptEngineAgent.
PathView items were not correctly updated when rootIndex changed.
Allow text to selected in a TextEdit or TextInput inside a Flickable.
Update modules-related tests and docs
CLeanup registers after AddString
4.7.2 changes
Change paging attributes for Symbian binaries
Fix build failure
Fix regression in creating mkspecs/default
Use the thread-default glib context for the DBus connection in the ICD bearer manager.
...
Diffstat (limited to 'src/sql/models/qsqlquerymodel.cpp')
-rw-r--r-- | src/sql/models/qsqlquerymodel.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp index 8730192..d1051de 100644 --- a/src/sql/models/qsqlquerymodel.cpp +++ b/src/sql/models/qsqlquerymodel.cpp @@ -279,7 +279,11 @@ QVariant QSqlQueryModel::headerData(int section, Qt::Orientation orientation, in val = d->headers.value(section).value(Qt::EditRole); if (val.isValid()) return val; - if (role == Qt::DisplayRole && d->rec.count() > section) + + // See if it's an inserted column (iiq.column() != -1) + QModelIndex dItem = indexInQuery(createIndex(0, section)); + + if (role == Qt::DisplayRole && d->rec.count() > section && dItem.column() != -1) return d->rec.fieldName(section); } return QAbstractItemModel::headerData(section, orientation, role); @@ -306,6 +310,8 @@ void QSqlQueryModel::queryChange() lastError() can be used to retrieve verbose information if there was an error setting the query. + \note Calling setQuery() will remove any inserted columns. + \sa query(), QSqlQuery::isActive(), QSqlQuery::setForwardOnly(), lastError() */ void QSqlQueryModel::setQuery(const QSqlQuery &query) @@ -370,7 +376,8 @@ void QSqlQueryModel::setQuery(const QSqlQuery &query) /*! \overload Executes the query \a query for the given database connection \a - db. If no database is specified, the default connection is used. + db. If no database (or an invalid database) is specified, the + default connection is used. lastError() can be used to retrieve verbose information if there was an error setting the query. |