本文整理汇总了C++中QSqlIndex::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ QSqlIndex::isEmpty方法的具体用法?C++ QSqlIndex::isEmpty怎么用?C++ QSqlIndex::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSqlIndex
的用法示例。
在下文中一共展示了QSqlIndex::isEmpty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: del
int Q3SqlCursor::del(bool invalidate)
{
QSqlIndex idx = primaryIndex(false);
if (idx.isEmpty())
return del(qWhereClause(&d->editBuffer, d->nm, QLatin1String("and"), driver()), invalidate);
return del(toString(primaryIndex(), &d->editBuffer, d->nm, QString(QLatin1Char('=')), QLatin1String("and")), invalidate);
}
示例2: del
int QSqlCursor::del( bool invalidate )
{
QSqlIndex idx = primaryIndex( FALSE );
if ( idx.isEmpty() )
return del( qWhereClause( &d->editBuffer, d->nm, "and", driver() ), invalidate );
else
return del( toString( primaryIndex(), &d->editBuffer, d->nm,
"=", "and" ), invalidate );
}
示例3: editBuffer
QSqlRecord* Q3SqlCursor::primeUpdate()
{
// 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;
}
示例4: primeUpdate
QSqlRecord* QSqlCursor::primeUpdate()
{
// 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, "=", "and" );
else
d->editIndex = qWhereClause( buf, d->nm, "and", driver() );
return buf;
}
示例5: primaryKeyFieldName
QString TableSchema::primaryKeyFieldName() const
{
QSqlTableModel model;
model.setTable(tablename);
QSqlIndex index = model.primaryKey();
if (index.isEmpty()) {
return QString();
}
QSqlField fi = index.field(0);
return fi.name();
}
示例6: primaryKeyIndex
int TableSchema::primaryKeyIndex() const
{
QSqlTableModel model;
model.setTable(tablename);
QSqlIndex index = model.primaryKey();
if (index.isEmpty()) {
return -1;
}
QSqlField fi = index.field(0);
return model.record().indexOf(fi.name());
}