本文整理汇总了C++中setTable函数的典型用法代码示例。如果您正苦于以下问题:C++ setTable函数的具体用法?C++ setTable怎么用?C++ setTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setTable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: QSqlRelationalTableModel
MCompraProducto::MCompraProducto(QObject *parent)
: QSqlRelationalTableModel(parent)
{
setTable( "compras_productos" );
setHeaderData( 0, Qt::Horizontal, "#item" );
setHeaderData( 1, Qt::Horizontal, "#Compra" );
setHeaderData( 2, Qt::Horizontal, "#Producto" );
setHeaderData( 3, Qt::Horizontal, "Precio Compra" );
setHeaderData( 4, Qt::Horizontal, "Cantidad" );
}
开发者ID:chungote,项目名称:gestotux,代码行数:10,代码来源:mcompraproducto.cpp
示例17: QSqlRelationalTableModel
PoitemTableModel::PoitemTableModel(QObject * parent, QSqlDatabase db) :
QSqlRelationalTableModel(parent, db)
{
setTable("poitem");
// select statement on which everything else is based
_selectStatement =
QString("SELECT pohead_number, "
" item_id, item_number,"
" warehous_id, warehous_code,"
" poitem_unitprice * poitem_qty_ordered AS extprice,"
" prj_number,"
" expcat_code,"
" 0 AS itemsrc_minordqty, 0 AS itemsrc_multordqty, "
" 1 AS itemsrc_invvendoruomratio,"
" CURRENT_DATE AS earliestdate, "
" poitem.* "
"FROM pohead"
" JOIN poitem ON (poitem_pohead_id=pohead_id)"
" LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id)"
" LEFT OUTER JOIN item ON (itemsite_item_id=item_id)"
" LEFT OUTER JOIN whsinfo ON (itemsite_warehous_id=warehous_id)"
" LEFT OUTER JOIN prj ON (poitem_prj_id=prj_id)"
" LEFT OUTER JOIN expcat ON (poitem_expcat_id=expcat_id)"
);
setEditStrategy(QSqlTableModel::OnManualSubmit); // OnRow?
setSort(POITEM_LINENUMBER_COL, Qt::AscendingOrder);
// insert only those columns not directly part of the poitem table
insertColumns(0, 7);
setHeaderData(POITEM_LINENUMBER_COL, Qt::Horizontal, tr("#"));
setHeaderData(ITEM_NUMBER_COL, Qt::Horizontal, tr("Item"));
setHeaderData(WAREHOUS_CODE_COL, Qt::Horizontal, tr("Supplying Site"));
setHeaderData(POITEM_VEND_ITEM_NUMBER_COL, Qt::Horizontal, tr("Vend Item #"));
setHeaderData(POITEM_VEND_ITEM_DESCRIP_COL,Qt::Horizontal, tr("Vend Description"));
setHeaderData(POITEM_VEND_UOM_COL, Qt::Horizontal, tr("Vend UOM"));
setHeaderData(POITEM_QTY_ORDERED_COL, Qt::Horizontal, tr("Qty."));
setHeaderData(POITEM_UNITPRICE_COL, Qt::Horizontal, tr("Unit Price"));
setHeaderData(EXTPRICE_COL, Qt::Horizontal, tr("Ext. Price"));
setHeaderData(POITEM_FREIGHT_COL, Qt::Horizontal, tr("Freight"));
setHeaderData(POITEM_DUEDATE_COL, Qt::Horizontal, tr("Due Date"));
setHeaderData(PRJ_NUMBER_COL, Qt::Horizontal, tr("Project #"));
setHeaderData(EXPCAT_CODE_COL, Qt::Horizontal, tr("Expense Cat."));
_poheadid = -1;
_poitemid = -1;
findHeadData();
_dirty = false;
select();
connect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(markDirty(QModelIndex, QModelIndex)));
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:55,代码来源:poitemTableModel.cpp
示例18: QSqlRelationalTableModel
QueueModel::QueueModel(QObject *parent, QSqlDatabase db) :
QSqlRelationalTableModel(parent, db)
{
setTable("queuesongs");
setSinger(-1);
setRelation(3, QSqlRelation("dbsongs", "songid", "artist"));
setRelation(4, QSqlRelation("dbsongs", "songid", "title"));
setRelation(5, QSqlRelation("dbsongs", "songid", "discid"));
setRelation(6, QSqlRelation("dbsongs", "songid", "path"));
setSort(9, Qt::AscendingOrder);
}
开发者ID:khan007,项目名称:OpenKJ,代码行数:11,代码来源:queuemodel.cpp
示例19: QSqlRelationalTableModel
MMascota::MMascota( QObject *parent )
: QSqlRelationalTableModel( parent )
{
setTable( "mascota" );
setHeaderData( 0, Qt::Horizontal, "#ID" );
setHeaderData( 1, Qt::Horizontal, "Dueño" );
setRelation( 1, QSqlRelation( "dueno", "id", "apellido" ) );
setHeaderData( 2, Qt::Horizontal, "Nombre" );
setHeaderData( 3, Qt::Horizontal, "Raza" );
setHeaderData( 4, Qt::Horizontal, "Genero" );
}
开发者ID:chungote,项目名称:gestotux,代码行数:11,代码来源:mmascota.cpp
示例20: setTable
void StreamTableModel2::setFrom(int startTime, int duration )
{
// setFilter(QString("(streamid=%1) AND (startime > %2)").arg(m_StreamId).arg(startTime) );
setTable("event");
generateRoleNames();
setFilter(QString("(streamid=%1) AND (startime BETWEEN %2 AND %3)").arg(m_StreamId).arg(startTime).arg(startTime + duration) );
bool ret = select();
if(!ret){
qDebug() << "select failed";
}
}
开发者ID:xlazom00,项目名称:qml_epg,代码行数:11,代码来源:streamtablemodel2.cpp
注:本文中的setTable函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论