本文整理汇总了C++中setId函数的典型用法代码示例。如果您正苦于以下问题:C++ setId函数的具体用法?C++ setId怎么用?C++ setId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GUIPage
/**
* Constructeur de PauseMenu
*/
PauseMenu::PauseMenu(Core* core) :
GUIPage(core)
{
setId(IN_PAUSE_MENU);
}
示例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++;
}
}
}
示例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));
}
示例4: setId
EditorDocument::EditorDocument()
{
setId(Constants::EditorId);
}
示例5: setObjectName
SysRootKitInformation::SysRootKitInformation()
{
setObjectName(QLatin1String("SysRootInformation"));
setId(SysRootKitInformation::id());
setPriority(31000);
}
示例6: setId
void Documents::setCurrentDocument(int strNum)
{
setId(strNum);
currentDocument->setDocId(strNum);
}
示例7: d
ProgramBank::ProgramBank(int id)
: d(new Private)
{
setId(id);
}
示例8: setPosition
inline void setPosition(long p) { setId(p); }
示例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);
}
示例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");
}
//.........这里部分代码省略.........
示例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;
}
示例12: setDisplayName
TestNavigationWidgetFactory::TestNavigationWidgetFactory()
{
setDisplayName(tr("Tests"));
setId(Autotest::Constants::AUTOTEST_ID);
setPriority(666);
}
示例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 );
//.........这里部分代码省略.........
示例14: IRunConfigurationAspect
EnvironmentAspect::EnvironmentAspect(RunConfiguration *runConfig)
: IRunConfigurationAspect(runConfig), m_base(-1)
{
setDisplayName(tr("Run Environment"));
setId("EnvironmentAspect");
}
示例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;
}