本文整理汇总了C++中AbstractObject::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ AbstractObject::getName方法的具体用法?C++ AbstractObject::getName怎么用?C++ AbstractObject::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractObject
的用法示例。
在下文中一共展示了AbstractObject::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASCII
AbstractObjectPtr
ObjectFactory::createObject(
const QString &aName,
const Position aPosition,
const qreal aWidth,
const qreal anHeight)
{
const ObjectFactory *myFactoryPtr = theFactoryListPtr->getFactoryPtr(aName);
DEBUG5("ObjectFactory::createObject(\"%s\") Factory=%p", ASCII(aName), myFactoryPtr);
if (myFactoryPtr == nullptr) {
DEBUG1("There is no factory for Object type '%s'", ASCII(aName));
return nullptr;
}
AbstractObject *myObjectPtr = myFactoryPtr->createObject();
assert (myObjectPtr != nullptr);
AbstractObjectPtr mySharedOPtr = AbstractObjectPtr(myObjectPtr);
myObjectPtr->theThisPtr = mySharedOPtr;
DEBUG5(" object created = %p, i18n name = '%s'", myObjectPtr, ASCII(myObjectPtr->getName()));
assert (aName.contains(" ") == false);
myObjectPtr->theInternalName = aName;
myObjectPtr->theCenter = aPosition;
if (aWidth != 1.0)
myObjectPtr->theWidth = aWidth;
if (anHeight != 1.0)
myObjectPtr->theHeight = anHeight;
// finally, get rid of the actual pointer and return the shared_ptr
assert (nullptr != mySharedOPtr);
return mySharedOPtr;
}
示例2:
void DDEngine::SceneTransformator::setObjects(const std::vector<AbstractObject*> objects)
{
SceneTransformatorStatic::objects = objects;
for (size_t i = 0; i < objects.size(); i++) {
AbstractObject* o = objects[i];
Picker item;
item.index = i;
item.name = o->getName();
selections.push_back(item);
}
}