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


C++ setTable函数代码示例

本文整理汇总了C++中setTable函数的典型用法代码示例。如果您正苦于以下问题:C++ setTable函数的具体用法?C++ setTable怎么用?C++ setTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setTable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Q_UNUSED

void HiddenTableModel::setTableModel(int id) {
    Q_UNUSED(id);
    QSqlQuery query;
    const QString tableName("hidden_songs");

    QStringList columns;
    columns << "library." + LIBRARYTABLE_ID;
    QString filter("mixxx_deleted=1");
    query.prepare("CREATE TEMPORARY VIEW IF NOT EXISTS " + tableName + " AS "
                  "SELECT "
                  + columns.join(",") +
                  " FROM library "
                  "INNER JOIN track_locations "
                  "ON library.location=track_locations.id "
                  "WHERE " + filter);
    if (!query.exec()) {
        qDebug() << query.executedQuery() << query.lastError();
    }

    //Print out any SQL error, if there was one.
    if (query.lastError().isValid()) {
        qDebug() << __FILE__ << __LINE__ << query.lastError();
    }

    QStringList tableColumns;
    tableColumns << LIBRARYTABLE_ID;
    setTable(tableName, LIBRARYTABLE_ID, tableColumns,
             m_pTrackCollection->getTrackSource());
    setDefaultSort(fieldIndex("artist"), Qt::AscendingOrder);
    setSearch("");
}
开发者ID:Alppasa,项目名称:mixxx,代码行数:31,代码来源:hiddentablemodel.cpp

示例2: setTable

void cNPC::save()
{
	if ( changed_ )
	{
		initSave;
		setTable( "npcs" );

		addField( "serial", serial() );
		addField( "summontime", summonTime_ ? summonTime_ - Server::instance()->time() : 0 );
		addField( "additionalflags", additionalFlags_ );
		addField( "owner", owner_ ? owner_->serial() : INVALID_SERIAL );
		addField( "stablemaster", stablemasterSerial_ );
		addStrField( "ai", aiid_ );
		addField( "wandertype", ( Q_UINT8 ) wanderType() );
		addField( "wanderx1", wanderX1() );
		addField( "wanderx2", wanderX2() );
		addField( "wandery1", wanderY1() );
		addField( "wandery2", wanderY2() );
		addField( "wanderradius", wanderRadius() );

		addCondition( "serial", serial() );
		saveFields;
	}

	cBaseChar::save();
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:26,代码来源:npc.cpp

示例3: setTable

void cNPC::save()
{
	if ( changed_ )
	{
		initSave;
		setTable( "npcs" );

		addField( "serial", serial() );
		addField( "mindamage", minDamage_);
		addField( "maxdamage", maxDamage_);
		addField( "tamingminskill", tamingMinSkill_);
		addField( "summontime", summonTime_ ? summonTime_ - uiCurrentTime : 0 );
		addField( "additionalflags", additionalFlags_ );
		addField( "owner", owner_ ? owner_->serial() : INVALID_SERIAL );
		addStrField( "carve", carve_);
		addStrField( "spawnregion", spawnregion_);
		addField( "stablemaster", stablemasterSerial_ );
		addStrField( "lootlist", lootList_);
		addStrField( "ai", aiid_ );
		addField( "wandertype", (UINT8)wanderType() );
		addField( "wanderx1", wanderX1() );
		addField( "wanderx2", wanderX2() );
		addField( "wandery1", wanderY1() );
		addField( "wandery2", wanderY2() );
		addField( "wanderradius", wanderRadius() );
		addField( "fleeat", criticalHealth() );
		addField( "spellslow", spellsLow_ );
		addField( "spellshigh", spellsHigh_ );
		addField( "controlslots", controlSlots_ );

		addCondition( "serial", serial() );
		saveFields;
	}
	cBaseChar::save();
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:35,代码来源:npc.cpp

示例4: QSqlTableModel

MEstablecimiento::MEstablecimiento( QObject *parent )
 : QSqlTableModel( parent )
{
 setTable( "car_establecimientos" );
 setHeaderData( 0, Qt::Horizontal, "#ID" );
 setHeaderData( 1, Qt::Horizontal, "Nombre" );
 setHeaderData( 2, Qt::Horizontal, "#RESMPA" );
}
开发者ID:chungote,项目名称:gestotux,代码行数:8,代码来源:mestablecimiento.cpp

示例5: QSqlTableModel

MDescuentos::MDescuentos(QObject *parent) :
QSqlTableModel(parent)
{
    setTable( "descuentos" );
    _seleccionado = false;
    _id_comprobante = -1;
    _tipo = Invalido;
}
开发者ID:tranfuga25s,项目名称:gestotux,代码行数:8,代码来源:mdescuentos.cpp

示例6: setTable

/*!
	Performs persistency layer saves.
*/
void cUObject::save()
{
	bool havetags_ = ( tags_.size() > 0 );
	// uobjectmap fields

	// If the type is changed somewhere in the code
	// That part needs to take care of delete/recreate
	// So we never update the type EVER here..
	if( !isPersistent )
	{
		initSave;
		setTable( "uobjectmap" );
		addField( "serial", serial_ );
		addStrField( "type", QString( objectID() ) );
		addCondition( "serial", serial_ );
		saveFields;
		clearFields;
	}

	// uobject fields
	if ( changed_ )
	{
		initSave;
		setTable( "uobject" );
		addStrField( "name", name_ );
		addField( "serial", serial_ );
		addField( "multis", multis_ );
		addField( "direction", dir_);
		addField( "pos_x", pos_.x );
		addField( "pos_y", pos_.y );
		addField( "pos_z", pos_.z );
		addField( "pos_map", pos_.map );
		addStrField( "events", eventList_ == QString::null ? QString( "" ) : eventList_ );
		addStrField( "bindmenu", bindmenu_ );
		addCondition( "serial", serial_ );
		addField( "havetags", havetags_ );
		saveFields;
	}
	if( havetags_ )
	{
		tags_.save( serial_ );
	}

	PersistentObject::save();
	flagUnchanged(); // This is the botton of the chain, now go up and flag everyone unchanged.
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:49,代码来源:uobject.cpp

示例7: setTable

/*!
	Performs persistency layer saves.
*/
void cUObject::save()
{
	bool havetags_ = ( tags_.size() > 0 );
	// uobjectmap fields
	initSave;

	// If the type is changed somewhere in the code
	// That part needs to take care of delete/recreate
	// So we never update the type EVER here..
	if( !isPersistent )
	{
		setTable( "uobjectmap" );
		addField( "serial", serial_ );
		addStrField( "type", objectID() );
		addCondition( "serial", serial_ );
		saveFields;
		clearFields;
	}
	
	// uobject fields
	if ( changed_ )
	{
		setTable( "uobject" );	
		addStrField( "name", name_ );
		addField( "serial", serial_ );
		addField( "multis", multis_ );
		addField( "pos_x", pos_.x );
		addField( "pos_y", pos_.y );
		addField( "pos_z", pos_.z );
		addField( "pos_map", pos_.map );
		addStrField( "events", eventList_.join( "," ) );
		addStrField( "bindmenu", bindmenu_ );
		addCondition( "serial", serial_ );
		addField( "havetags", havetags_ );
		saveFields;
	}
	if( havetags_ )
	{
		tags_.save( serial_ );
	}


	PersistentObject::save();
	changed_ = false;

}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:49,代码来源:uobject.cpp

示例8: QSqlRelationalTableModel

ContentTypesModel::ContentTypesModel(int id, QObject *parent, QSqlDatabase db) :
	QSqlRelationalTableModel(parent, db) {
	_id = id;
	_f = "";
	_begin = 0;
	_limit = 25;
	setTable("app_content_type");
}
开发者ID:nycholas,项目名称:c-project,代码行数:8,代码来源:contenttypesmodel.cpp

示例9: QSqlTableModel

DTScheduleModel::DTScheduleModel(QObject *parent, QSqlDatabase db) :
    QSqlTableModel(parent, db),
    mStartDate(QDate()),
    mEndDate(QDate()),
    mStartColIndex(-1),
    mDurationColIndex(-1)
{
    setTable("RECEPTION");
}
开发者ID:DentalTask,项目名称:main,代码行数:9,代码来源:DTScheduleModel.cpp

示例10: QSqlTableModel

MPrefCategorias::MPrefCategorias(QObject *parent)
 : QSqlTableModel(parent)
{
 setTable( "car_categorias" );
 setHeaderData( 0, Qt::Horizontal, "#id_db" );
 setHeaderData( 1, Qt::Horizontal, "Categoria" );
 setHeaderData( 2, Qt::Horizontal, "Especial" );
 setEditStrategy( QSqlTableModel::OnManualSubmit );
}
开发者ID:chungote,项目名称:gestotux,代码行数:9,代码来源:mprefcategorias.cpp

示例11: QSqlTableModel

MCajas::MCajas(QObject *parent ) :
QSqlTableModel(parent)
{
    setTable( "caja" );
    this->setHeaderData( 0, Qt::Horizontal, "#ID" );
    this->setHeaderData( 1, Qt::Horizontal, "Nombre" );
    this->setHeaderData( 2, Qt::Horizontal, "Fecha de Alta"  );
    this->setHeaderData( 3, Qt::Horizontal, "Saldo Actual" );
}
开发者ID:chungote,项目名称:gestotux,代码行数:9,代码来源:mcajas.cpp

示例12: QSqlRelationalTableModel

MealModel::MealModel(int meal, QObject *parent) : QSqlRelationalTableModel(parent), meal(meal)
{
    setTable("menu");
    setRelation(2, QSqlRelation("recipes", "id", "name"));
    setFilter(QString("meal='%1'").arg(meal));
    sort(2, Qt::AscendingOrder);
    select();

    setSupportedDragActions(Qt::MoveAction);
}
开发者ID:madjar,项目名称:randomcpp,代码行数:10,代码来源:mealmodel.cpp

示例13: setTable

ReferTableModel::ReferTableModel(QObject *parent)
{
    setTable("referNode");
    setSort(1, Qt::AscendingOrder);
    setHeaderData(1, Qt::Horizontal, tr("NetID"));
    setHeaderData(2, Qt::Horizontal, tr("Floor"));
    setHeaderData(3, Qt::Horizontal, tr("Number"));
    setHeaderData(4, Qt::Horizontal, tr("TMP_Period"));
    select();
}
开发者ID:zhongming2013,项目名称:dynamicLocation,代码行数:10,代码来源:refertablemodel.cpp

示例14: QSqlRelationalTableModel

MVPresupuestos::MVPresupuestos(QObject *parent) :
    QSqlRelationalTableModel(parent)
{
    setTable( "v_presupuestos" );
    setHeaderData( 0, Qt::Horizontal, "#ID" );
    setHeaderData( 1, Qt::Horizontal, "#Presupuesto" );
    setHeaderData( 2, Qt::Horizontal, "Destinatario" );
    setHeaderData( 3, Qt::Horizontal, "Fecha" );
    setHeaderData( 4, Qt::Horizontal, "Total" );
}
开发者ID:chungote,项目名称:gestotux,代码行数:10,代码来源:mvpresupuestos.cpp

示例15: Q_UNUSED

void BaseExternalTrackModel::setTableModel(int id) {
    Q_UNUSED(id);
    QStringList columns;
    columns << "id";
    // TODO(XXX) preview column, needs a temporary view
    setTable(m_trackTable, columns[0], columns,
             m_pTrackCollection->getTrackSource(m_trackSource));
    setDefaultSort(fieldIndex("artist"), Qt::AscendingOrder);
    initHeaderData();
}
开发者ID:Shunty,项目名称:mixxx,代码行数:10,代码来源:baseexternaltrackmodel.cpp


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