本文整理汇总了C++中Q3SqlCursor::primeUpdate方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3SqlCursor::primeUpdate方法的具体用法?C++ Q3SqlCursor::primeUpdate怎么用?C++ Q3SqlCursor::primeUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3SqlCursor
的用法示例。
在下文中一共展示了Q3SqlCursor::primeUpdate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: primeUpdate
void Q3DataBrowser::postNav(bool primeUpd)
{
if (primeUpd) {
QSqlRecord* buf = d->frm.record();
Q3SqlCursor* cur = d->cur.cursor();
if (!buf || !cur)
return;
currentChanged(cur);
cur->primeUpdate();
emit primeUpdate(buf);
readFields();
}
updateBoundary();
}
示例2: myEditor
** $QT_END_LICENSE$
**
****************************************************************************/
//! [0]
QLineEdit myEditor(this);
Q3SqlForm myForm(this);
Q3SqlCursor myCursor("mytable");
// Execute a query to make the cursor valid
myCursor.select();
// Move the cursor to a valid record (the first record)
myCursor.next();
// Set the form's record pointer to the cursor's edit buffer (which
// contains the current record's values)
myForm.setRecord(myCursor.primeUpdate());
// Insert a field into the form that uses myEditor to edit the
// field 'somefield' in 'mytable'
myForm.insert(&myEditor, "somefield");
// Update myEditor with the value from the mapped database field
myForm.readFields();
...
// Let the user edit the form
...
// Update the database
myForm.writeFields(); // Update the cursor's edit buffer from the form
myCursor.update(); // Update the database from the cursor's buffer
//! [0]