本文整理汇总了C++中UMLAttribute::name方法的典型用法代码示例。如果您正苦于以下问题:C++ UMLAttribute::name方法的具体用法?C++ UMLAttribute::name怎么用?C++ UMLAttribute::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMLAttribute
的用法示例。
在下文中一共展示了UMLAttribute::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attributeAdded
/**
* Slot for adding an attribute to the tree.
* @param listItem the new attribute to add
*/
void RefactoringAssistant::attributeAdded(UMLClassifierListItem *listItem)
{
UMLAttribute *att = static_cast<UMLAttribute*>(listItem);
DEBUG(DBG_SRC) << "attribute = " << att->name(); //:TODO:
UMLClassifier *parent = dynamic_cast<UMLClassifier*>(att->parent());
if (!parent) {
uWarning() << att->name() << " - Parent of attribute is not a classifier!";
return;
}
QTreeWidgetItem *item = findListViewItem(parent);
if (!item) {
uWarning() << "Parent is not in tree!";
return;
}
for (int i = 0; i < item->childCount(); ++i) {
QTreeWidgetItem *folder = item->child(i);
if (folder->text(1) == QLatin1String("attributes")) {
item = new QTreeWidgetItem(folder, QStringList(att->name()));
m_umlObjectMap[item] = att;
connect(att, SIGNAL(modified()), this, SLOT(objectModified()));
setVisibilityIcon(item, att);
DEBUG(DBG_SRC) << "attribute = " << att->name() << " added!"; //:TODO:
break;
}
}
}
示例2: attributeRemoved
/**
* Slot for removing an attribute from the tree.
* @param listItem the attribute to be removed
*/
void RefactoringAssistant::attributeRemoved(UMLClassifierListItem *listItem)
{
UMLAttribute *att = static_cast<UMLAttribute*>(listItem);
DEBUG(DBG_SRC) << "attribute = " << att->name(); //:TODO:
QTreeWidgetItem *item = findListViewItem(att);
if (!item) {
uWarning() << "Attribute is not in tree!";
return;
}
disconnect(att, SIGNAL(modified()), this, SLOT(objectModified()));
m_umlObjectMap.remove(item);
delete item;
DEBUG(DBG_SRC) << "attribute = " << att->name() << " deleted!"; //:TODO:
}
示例3: getFieldName
QString JavaCodeClassField::getFieldName()
{
if (parentIsAttribute())
{
UMLAttribute * at = (UMLAttribute*) getParentObject();
return cleanName(at->name());
}
else
{
UMLRole * role = (UMLRole*) getParentObject();
QString roleName = role->name();
if(fieldIsSingleValue()) {
return roleName.replace(0, 1, roleName.left(1).toLower());
} else {
return roleName.toLower() + QLatin1String("Vector");
}
}
}