当前位置: 首页>>代码示例>>C++>>正文


C++ QSqlIndex::isEmpty方法代码示例

本文整理汇总了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);
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例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 );
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:9,代码来源:qsqlcursor.cpp

示例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;
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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;
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:11,代码来源:qsqlcursor.cpp

示例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();
}
开发者ID:AbhimanyuAryan,项目名称:treefrog-framework,代码行数:12,代码来源:tableschema.cpp

示例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());
}
开发者ID:AbhimanyuAryan,项目名称:treefrog-framework,代码行数:12,代码来源:tableschema.cpp


注:本文中的QSqlIndex::isEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。