Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QSqlRecord * Q3SqlCursor::primeUpdate (  )  [virtual]

This function primes the edit buffer's field values for update and 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 it must not be deleted or modified.

See also:
editBuffer() update()

Reimplemented in Q3SqlSelectCursor.

Definition at line 1072 of file q3sqlcursor.cpp.

References QSqlQuery::driver(), editBuffer(), QSqlRecord::isEmpty(), primaryIndex(), and toString().

Referenced by Q3DataTable::beginUpdate(), and Q3DataBrowser::postNav().

{
    // memorize the primary keys as they were before the user changed the values in editBuffer
    QSqlRecord* buf = editBuffer(true);
    QSqlIndex idx = primaryIndex(false);
    if (!idx.isEmpty())
        d->editIndex = toString(idx, buf, d->nm, QString(QLatin1Char('=')), QLatin1String("and"));
    else
        d->editIndex = qWhereClause(buf, d->nm, QLatin1String("and"), driver());
    return buf;
}


Generated by  Doxygen 1.6.0   Back to index