本文整理汇总了C++中setId函数的典型用法代码示例。如果您正苦于以下问题:C++ setId函数的具体用法?C++ setId怎么用?C++ setId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GUIPage
/**
* Constructeur de PauseMenu
*/
PauseMenu::PauseMenu(Core* core) :
GUIPage(core)
{
setId(IN_PAUSE_MENU);
}
开发者ID:T4g1,项目名称:Embryon,代码行数:8,代码来源:PauseMenu.cpp
示例2: TMXObjectGroup
void TiledObject::initialize()
{
if(!m_componentCompleted) {
m_componentCompleted = true;
return;
}
// Extract properties from layer
TiledLayer *tiledLayer = qobject_cast<TiledLayer *>(parent());
if(!tiledLayer && !tiledLayer->layer())
return;
if(!tiledLayer->layer()->isObjectLayer())
return;
m_layerName = tiledLayer->name();
if(m_objectGroup)
m_objectGroup->deleteLater();
m_objectGroup = new TMXObjectGroup(*tiledLayer->layer(), this);
if(!m_objectGroup)
return;
int collisions = 0;
m_collisionIndex = -1;
foreach(const TMXMapObject &object, m_objectGroup->objects())
{
if(object.name() == m_name && object.type() == m_type)
{
if(!static_cast<TiledScene *>(tiledLayer->parentItem()))
return;
//if(!collisions) {
setProperties(object.properties());
setX(object.x());
setY(object.y());
setWidth(object.width());
setHeight(object.height());
setRotation(object.rotation());
setVisible(object.isVisible());
setId(object.id());
//}
CollisionItem *item = new CollisionItem(tiledLayer->parentItem());
item->setX(object.x());
item->setY(object.y());
item->setWidth(object.width());
item->setHeight(object.height());
item->setRotation(object.rotation());
item->setVisible(object.isVisible());
item->setId(object.id());
item->setProperties(object.properties());
item->setCollisionIndex(collisions);
m_collisionItems.append(item);
switch(object.shape())
{
case TMXMapObject::Rectangle:
createRectangularFixture(object, item);
break;
case TMXMapObject::Ellipse:
createEllipseFixture(object, item);
break;
case TMXMapObject::Polygon:
createPolygonFixture(object, item);
break;
case TMXMapObject::Polyline:
createPolylineFixture(object, item);
break;
default:
qWarning() << "Unhandled object group: " << object.name();
break;
}
setBody(item->body());
collisions++;
}
}
}
开发者ID:Bacon2D,项目名称:Bacon2D,代码行数:81,代码来源:tiledobject.cpp
示例3: id
void GccToolChain::updateId()
{
QString i = id();
i = i.left(i.indexOf(QLatin1Char(':')));
setId(QString::fromLatin1("%1:%2.%3").arg(i).arg(m_compilerPath).arg(m_forcedTo32Bit));
}
开发者ID:yinyunqiao,项目名称:qtcreator,代码行数:6,代码来源:gcctoolchain.cpp
示例4: setId
EditorDocument::EditorDocument()
{
setId(Constants::EditorId);
}
开发者ID:hugopl,项目名称:RubyCreator,代码行数:4,代码来源:RubyEditorDocument.cpp
示例5: setObjectName
SysRootKitInformation::SysRootKitInformation()
{
setObjectName(QLatin1String("SysRootInformation"));
setId(SysRootKitInformation::id());
setPriority(31000);
}
开发者ID:55171514,项目名称:qtcreator,代码行数:6,代码来源:kitinformation.cpp
示例6: setId
void Documents::setCurrentDocument(int strNum)
{
setId(strNum);
currentDocument->setDocId(strNum);
}
开发者ID:morozovvl,项目名称:qbalance,代码行数:5,代码来源:documents.cpp
示例7: d
ProgramBank::ProgramBank(int id)
: d(new Private)
{
setId(id);
}
开发者ID:mlarouche,项目名称:libpcg,代码行数:5,代码来源:programbank.cpp
示例8: setPosition
inline void setPosition(long p) { setId(p); }
开发者ID:fa-vio,项目名称:nuchaRt,代码行数:1,代码来源:Gene.hpp
示例9: Gene
Gene(std::string sym, std::string chr, uint_64 st_, uint_64 sp_, size_t h, int lv, long ps) :
symbol(sym), chrom(chr), start_p(st_), stop_p(sp_), entrez_ID(-1), hs(h), intr(0), cis(-1), trans(-1), nexp(0) {
setLevel(lv);
setId(ps);
}
开发者ID:fa-vio,项目名称:nuchaRt,代码行数:5,代码来源:Gene.hpp
示例10: root
ChallengeData::ChallengeData(const std::string& filename)
{
m_filename = filename;
m_mode = CM_SINGLE_RACE;
m_minor = RaceManager::MINOR_MODE_NORMAL_RACE;
m_num_laps = -1;
m_track_id = "";
m_gp_id = "";
m_version = 0;
m_num_trophies = 0;
for (int d=0; d<RaceManager::DIFFICULTY_COUNT; d++)
{
m_num_karts[d] = -1;
m_position[d] = -1;
m_time[d] = -1.0f;
m_energy[d] = -1;
m_ai_superpower[d] = RaceManager::SUPERPOWER_NONE;
}
// we are using auto_ptr to make sure the XML node is released when leaving
// the scope
std::auto_ptr<XMLNode> root(new XMLNode( filename ));
if(root.get() == NULL || root->getName()!="challenge")
{
std::ostringstream msg;
msg << "Couldn't load challenge '" << filename
<< "': no challenge node.";
throw std::runtime_error(msg.str());
}
setId(StringUtils::removeExtension(StringUtils::getBasename(filename)));
root->get("version", &m_version);
// No need to get the rest of the data if this challenge
// is not supported anyway (id is needed for warning message)
if(!unlock_manager->isSupportedVersion(*this))
{
Log::warn("ChallengeData", "Challenge <%s> is older "
"or newer than this version of STK, will be ignored.\n",
filename.c_str());
return;
}
const XMLNode* mode_node = root->getNode("mode");
if (mode_node == NULL)
{
throw std::runtime_error("Challenge file " + filename +
" has no <mode> node!");
}
std::string mode;
mode_node->get("major", &mode);
if(mode=="grandprix")
m_mode = CM_GRAND_PRIX;
else if(mode=="single")
m_mode = CM_SINGLE_RACE;
else if(mode=="any")
m_mode = CM_ANY;
else
error("major");
mode_node->get("minor", &mode);
if(mode=="timetrial")
m_minor = RaceManager::MINOR_MODE_TIME_TRIAL;
else if(mode=="quickrace")
m_minor = RaceManager::MINOR_MODE_NORMAL_RACE;
else if(mode=="followtheleader")
m_minor = RaceManager::MINOR_MODE_FOLLOW_LEADER;
else
error("minor");
const XMLNode* track_node = root->getNode("track");
const XMLNode* gp_node = root->getNode("grandprix");
if (m_mode == CM_SINGLE_RACE && track_node == NULL)
{
throw std::runtime_error("Challenge file " + filename +
" has no <track> node!");
}
if (m_mode == CM_GRAND_PRIX && gp_node == NULL)
{
throw std::runtime_error("Challenge file " + filename +
" has no <grandprix> node!");
}
if (track_node != NULL)
{
if (!track_node->get("id", &m_track_id ))
{
error("track");
}
if (track_manager->getTrack(m_track_id) == NULL)
{
error("track");
}
//.........这里部分代码省略.........
开发者ID:AkshayGupta94,项目名称:stk-code,代码行数:101,代码来源:challenge_data.cpp
示例11: setLayoutSizeAware
DomElement *WPaintedWidget::createDomElement(WApplication *app)
{
if (isInLayout()) {
setLayoutSizeAware(true);
setJavaScriptMember(WT_RESIZE_JS,
"function(self, w, h) {"
"""var u = $(self).find('canvas, img');"
"""if (w >= 0) "
"" "u.width(w);"
"""if (h >= 0) "
"" "u.height(h);"
"}");
}
createPainter();
DomElement *result = DomElement::createNew(domElementType());
setId(result, app);
DomElement *wrap = result;
if (width().isAuto() && height().isAuto()) {
result->setProperty(PropertyStylePosition, "relative");
wrap = DomElement::createNew(DomElement_DIV);
wrap->setProperty(PropertyStylePosition, "absolute");
wrap->setProperty(PropertyStyleLeft, "0");
wrap->setProperty(PropertyStyleRight, "0");
}
DomElement *canvas = DomElement::createNew(DomElement_DIV);
if (!app->environment().agentIsSpiderBot())
canvas->setId('p' + id());
WPaintDevice *device = painter_->getPaintDevice(false);
//handle the widget correctly when inline and using VML
if (painter_->renderType() == WWidgetPainter::InlineVml && isInline()) {
result->setProperty(PropertyStyle, "zoom: 1;");
canvas->setProperty(PropertyStyleDisplay, "inline");
canvas->setProperty(PropertyStyle, "zoom: 1;");
}
if (renderWidth_ != 0 && renderHeight_ != 0) {
paintEvent(device);
#ifdef WT_TARGET_JAVA
if (device->painter())
device->painter()->end();
#endif // WT_TARGET_JAVA
}
painter_->createContents(canvas, device);
needRepaint_ = false;
wrap->addChild(canvas);
if (wrap != result)
result->addChild(wrap);
updateDom(*result, true);
return result;
}
开发者ID:pgquiles,项目名称:wt,代码行数:66,代码来源:WPaintedWidget.C
示例12: setDisplayName
TestNavigationWidgetFactory::TestNavigationWidgetFactory()
{
setDisplayName(tr("Tests"));
setId(Autotest::Constants::AUTOTEST_ID);
setPriority(666);
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:6,代码来源:testnavigationwidget.cpp
示例13: Q_UNUSED
bool QgsComposerItem::_readXML( const QDomElement& itemElem, const QDomDocument& doc )
{
Q_UNUSED( doc );
if ( itemElem.isNull() )
{
return false;
}
//rotation
setItemRotation( itemElem.attribute( "itemRotation", "0" ).toDouble() );
//uuid
mUuid = itemElem.attribute( "uuid", QUuid::createUuid().toString() );
// temporary for groups imported from templates
mTemplateUuid = itemElem.attribute( "templateUuid" );
//id
QString id = itemElem.attribute( "id", "" );
setId( id );
//frame
QString frame = itemElem.attribute( "frame" );
if ( frame.compare( "true", Qt::CaseInsensitive ) == 0 )
{
mFrame = true;
}
else
{
mFrame = false;
}
//frame
QString background = itemElem.attribute( "background" );
if ( background.compare( "true", Qt::CaseInsensitive ) == 0 )
{
mBackground = true;
}
else
{
mBackground = false;
}
//position lock for mouse moves/resizes
QString positionLock = itemElem.attribute( "positionLock" );
if ( positionLock.compare( "true", Qt::CaseInsensitive ) == 0 )
{
setPositionLock( true );
}
else
{
setPositionLock( false );
}
//position
double x, y, width, height;
bool xOk, yOk, widthOk, heightOk, positionModeOK;
x = itemElem.attribute( "x" ).toDouble( &xOk );
y = itemElem.attribute( "y" ).toDouble( &yOk );
width = itemElem.attribute( "width" ).toDouble( &widthOk );
height = itemElem.attribute( "height" ).toDouble( &heightOk );
mLastUsedPositionMode = ( ItemPositionMode )itemElem.attribute( "positionMode" ).toInt( &positionModeOK );
if ( !positionModeOK )
{
mLastUsedPositionMode = UpperLeft;
}
if ( !xOk || !yOk || !widthOk || !heightOk )
{
return false;
}
mLastValidViewScaleFactor = itemElem.attribute( "lastValidViewScaleFactor", "-1" ).toDouble();
setSceneRect( QRectF( x, y, width, height ) );
setZValue( itemElem.attribute( "zValue" ).toDouble() );
//pen
QDomNodeList frameColorList = itemElem.elementsByTagName( "FrameColor" );
if ( frameColorList.size() > 0 )
{
QDomElement frameColorElem = frameColorList.at( 0 ).toElement();
bool redOk, greenOk, blueOk, alphaOk, widthOk;
int penRed, penGreen, penBlue, penAlpha;
double penWidth;
penWidth = itemElem.attribute( "outlineWidth" ).toDouble( &widthOk );
penRed = frameColorElem.attribute( "red" ).toDouble( &redOk );
penGreen = frameColorElem.attribute( "green" ).toDouble( &greenOk );
penBlue = frameColorElem.attribute( "blue" ).toDouble( &blueOk );
penAlpha = frameColorElem.attribute( "alpha" ).toDouble( &alphaOk );
mFrameJoinStyle = QgsSymbolLayerV2Utils::decodePenJoinStyle( itemElem.attribute( "frameJoinStyle", "miter" ) );
if ( redOk && greenOk && blueOk && alphaOk && widthOk )
{
QPen framePen( QColor( penRed, penGreen, penBlue, penAlpha ) );
framePen.setWidthF( penWidth );
framePen.setJoinStyle( mFrameJoinStyle );
setPen( framePen );
//.........这里部分代码省略.........
开发者ID:micheledalponte,项目名称:QGIS,代码行数:101,代码来源:qgscomposeritem.cpp
示例14: IRunConfigurationAspect
EnvironmentAspect::EnvironmentAspect(RunConfiguration *runConfig)
: IRunConfigurationAspect(runConfig), m_base(-1)
{
setDisplayName(tr("Run Environment"));
setId("EnvironmentAspect");
}
开发者ID:UIKit0,项目名称:qt-creator,代码行数:6,代码来源:environmentaspect.cpp
示例15: loadRTDesc
RenderTargetDescs loadRTDesc( const QString& path )
{
/**/
QByteArray tmpByteArray = path.toLocal8Bit();
const int numRT = GetPrivateProfileIntA( "RT", "NUM_RT", 0, tmpByteArray.data() );
/**/
RenderTargetDescs descs = {0};
descs.numRT = numRT;
/* RTは0番がバックバッファで、1番から別のRTを作る点に注意 */
for(int i=1;i<numRT+1;++i)
{
/**/
RenderTargetDesc& desc = descs.rtDescs[i];
/**/
char formatStr[MAX_PATH+1] = {'\0'};
char keyStr[MAX_PATH+1] = {'\0'};
/**/
sprintf(keyStr, "name%d", i );
GetPrivateProfileStringA( "RT", keyStr, "", formatStr, MAX_PATH, tmpByteArray.data() );
if( strcmp( formatStr, "" ) )
{
setId("RT_NAME", formatStr );
}
/* フォーマット取得 */
sprintf(keyStr, "format%d", i );
GetPrivateProfileStringA( "RT", keyStr, "", formatStr, MAX_PATH, tmpByteArray.data() );
if( !strcmp( formatStr, "B8G8R8A8" ))
{ desc.format = DXGI_FORMAT_B8G8R8A8_UNORM; }
else if( !strcmp( formatStr, "R32G32B32A32_FLOAT" ))
{ desc.format = DXGI_FORMAT_R32G32B32A32_FLOAT; }
else if( !strcmp( formatStr, "R16G16B16A16_FLOAT" ))
{ desc.format = DXGI_FORMAT_R16G16B16A16_FLOAT; }
else if( !strcmp( formatStr, "R16G16_FLOAT" ))
{ desc.format = DXGI_FORMAT_R16G16_FLOAT; }
else if( !strcmp( formatStr, "R32_FLOAT" ))
{ desc.format = DXGI_FORMAT_R32_FLOAT; }
else if( !strcmp( formatStr, "R32G32_FLOAT" ))
{ desc.format = DXGI_FORMAT_R32G32_FLOAT; }
else
{
NL_ERR( ERR_015, formatStr );
desc.format = DXGI_FORMAT_B8G8R8A8_UNORM;
}
/* サイズ */
sprintf(keyStr, "size%d", i );
GetPrivateProfileStringA( "RT", keyStr, "normal", formatStr, MAX_PATH, tmpByteArray.data() );
if( !strcmp(formatStr,"normal") )
{ desc.scaleByBackbuffer = 0; }
else if( !strcmp(formatStr,"half") )
{ desc.scaleByBackbuffer = 1; }
else if( !strcmp(formatStr,"quarter") )
{ desc.scaleByBackbuffer = 2; }
else
{
NL_ERR( ERR_016, formatStr );
desc.scaleByBackbuffer = 0;
}
}
/**/
descs.numDS = GetPrivateProfileIntA( "DS", "NUM_DS", 0, tmpByteArray.data() );
/* DSは0番がバックバッファ用で、1番から別のDSを作る点に注意 */
for(int i=1;i<descs.numDS+1;++i)
{
/**/
RenderTargetDesc& desc = descs.dsDescs[i];
/**/
char formatStr[MAX_PATH+1] = {'\0'};
char keyStr[MAX_PATH+1] = {'\0'};
/**/
sprintf(keyStr, "name%d", i );
GetPrivateProfileStringA( "DS", keyStr, "", formatStr, MAX_PATH, tmpByteArray.data() );
if( strcmp( formatStr, "" ) )
{
setId("DS_NAME", formatStr );
}
/* フォーマットは固定 */
desc.format = DXGI_FORMAT_D24_UNORM_S8_UINT;
/* サイズ */
sprintf(keyStr, "size%d", i );
GetPrivateProfileStringA( "DS", keyStr, "normal", formatStr, MAX_PATH, tmpByteArray.data() );
if( !strcmp(formatStr,"normal") )
{ desc.scaleByBackbuffer = 0; }
else if( !strcmp(formatStr,"half") )
{ desc.scaleByBackbuffer = 1; }
else if( !strcmp(formatStr,"quarter") )
{ desc.scaleByBackbuffer = 2; }
else
{
NL_ERR( ERR_016, formatStr );
desc.scaleByBackbuffer = 0;
}
}
/**/
return descs;
}
开发者ID:githole,项目名称:nlSandbox,代码行数:95,代码来源:nlUtil.cpp
示例16: setId
ParticleState::ParticleState(int id, double E, Vector3d pos, Vector3d dir) {
setId(id);
setEnergy(E);
setPosition(pos);
setDirection(dir);
}
开发者ID:phyytang,项目名称:CRPropa3,代码行数:6,代码来源:ParticleState.cpp
示例17: setId
void UsernameLineEdit::clear()
{
setId(-1);
_username = "";
setText(QString());
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:6,代码来源:usernameCluster.cpp
示例18: WindowFrame
UpDownFrame::UpDownFrame(Frame* parent, int id, int style)
: WindowFrame(parent)
{
create(UPDOWN_CLASS, L"", WS_CHILD | style, 0);
setId(id);
}
开发者ID:NateChambers,项目名称:mule-view,代码行数:6,代码来源:controlframes.cpp
示例19: text
/* copied from virtualCluster.cpp but with one important difference:
if a not-strict flag is set then warn the user but don't clear the
lotserial field
*/
void LotserialLineEdit::sParse()
{
if (_x_metrics)
if (_x_metrics->boolean("LotSerialControl"))
{
if (! _parsed)
{
QString stripped = text().trimmed().toUpper();
if (stripped.length() == 0)
{
_parsed = true;
setId(-1);
}
else
{
XSqlQuery numQ;
numQ.prepare(_query + _numClause +
(_extraClause.isEmpty() ? "" : " AND " + _extraClause) +
QString("ORDER BY %1 LIMIT 1;").arg(_numColName));
numQ.bindValue(":number", "^" + stripped);
numQ.exec();
if (numQ.first())
{
_valid = true;
setId(numQ.value("id").toInt());
_name = (numQ.value("name").toString());
_itemid = (numQ.value("item_id").toInt());
}
else if (numQ.lastError().type() != QSqlError::NoError)
{
QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.")
.arg(__FILE__)
.arg(__LINE__),
numQ.lastError().databaseText());
return;
}
else if (_strict || _itemid == -1)
VirtualClusterLineEdit::clear();
else if (isVisible() &&
QMessageBox::question(this, tr("Lot/Serial # Not Found"),
(_itemid > 0 ?
tr("This Lot/Serial # was not found for this item.") :
tr("This Lot/Serial # was not found.")) +
tr(" Are you sure it is correct?"),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No) == QMessageBox::No)
{
VirtualClusterLineEdit::clear();
return;
}
else
{
int lsid=-1;
numQ.exec("SELECT nextval('ls_ls_id_seq') AS ls_id;");
if (numQ.first())
lsid= numQ.value("ls_id").toInt();
else if (numQ.lastError().type() != QSqlError::NoError)
{
QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.")
.arg(__FILE__)
.arg(__LINE__),
numQ.lastError().databaseText());
return;
}
numQ.prepare("INSERT INTO ls (ls_id,ls_item_id,ls_number) "
"VALUES (:ls_id,:item_id,:number)");
numQ.bindValue(":ls_id", lsid);
numQ.bindValue(":item_id", _itemid);
numQ.bindValue(":number", stripped);
numQ.exec();
if (numQ.lastError().type() != QSqlError::NoError)
{
QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.")
.arg(__FILE__)
.arg(__LINE__),
numQ.lastError().databaseText());
return;
}
setId(lsid);
}
}
}
_parsed = TRUE;
emit parsed();
}
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:91,代码来源:lotserialCluster.cpp
示例20: query
void RomInfo::fillData()
{
if (m_gamename == "")
{
return;
}
MSqlQuery query(MSqlQuery::InitCon());
QString systemtype;
if (m_system != "") {
systemtype += " AND system = :SYSTEM ";
}
QString thequery = "SELECT system,gamename,genre,year,romname,favorite,"
"rompath,country,crc_value,diskcount,gametype,plot,publisher,"
"version,screenshot,fanart,boxart,inetref,intid FROM gamemetadata "
"WHERE gamename = :GAMENAME "
+ systemtype + " ORDER BY diskcount DESC";
query.prepare(thequery);
query.bindValue(":SYSTEM", m_system);
query.bindValue(":GAMENAME", m_gamename);
if (query.exec() && query.next())
{
setSystem(query.value(0).toString());
setGamename(query.value(1).toString());
setGenre(query.value(2).toString());
setYear(query.value(3).toString());
setRomname(query.value(4).toString());
setField("favorite",query.value(5).toString());
setRompath(query.value(6).toString());
setCountry(query.value(7).toString());
setCRC_VALUE(query.value(8).toString());
setDiskCount(query.value(9).toInt());
setGameType(query.value(10).toString());
setPlot(query.value(11).toString());
setPublisher(query.value(12).toString());
setVersion(query.value(13).toString());
setScreenshot(query.value(14).toString());
setFanart(query.value(15).toString());
setBoxart(query.value(16).toString());
setInetref(query.value(17).toString());
setId(query.value(18).toInt());
}
setRomCount(romInDB(m_romname,m_gametype));
// If we have more than one instance of this rom in the DB fill in all
// systems available to play it.
if (RomCount() > 1)
{
query.prepare("SELECT DISTINCT system FROM gamemetadata "
"WHERE romname = :ROMNAME");
query.bindValue(":ROMNAME", Romname());
if (!query.exec())
MythDB::DBError("RomInfo::fillData - selecting systems", query);
while (query.next())
{
if (m_allsystems.isEmpty())
m_allsystems = query.value(0).toString();
else
m_allsystems += "," + query.value(0).toString();
}
}
else
{
m_allsystems = m_system;
}
}
开发者ID:MythTV,项目名称:mythtv,代码行数:72,代码来源:rominfo.cpp
注:本文中的setId函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论