本文整理汇总了C++中UMLClassifier::removeAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ UMLClassifier::removeAttribute方法的具体用法?C++ UMLClassifier::removeAttribute怎么用?C++ UMLClassifier::removeAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMLClassifier
的用法示例。
在下文中一共展示了UMLClassifier::removeAttribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteItem
/**
* Delete an item from the tree.
* @param item the tree widget item
* @param obj the uml object
*/
void RefactoringAssistant::deleteItem(QTreeWidgetItem *item, UMLObject *obj)
{
UMLObject::ObjectType t = obj->baseType();
if (t == UMLObject::ot_Class || t == UMLObject::ot_Interface) {
DEBUG(DBG_SRC) << "Delete class or interface - not yet implemented!"; //:TODO:
}
else if (t == UMLObject::ot_Operation) {
QTreeWidgetItem *opNode = item->parent();
if (opNode) {
QTreeWidgetItem *parent = opNode->parent();
UMLClassifier* c = static_cast<UMLClassifier*>(findUMLObject(parent));
if (!c) {
uWarning() << "No classifier - cannot delete!";
return;
}
UMLOperation* op = static_cast<UMLOperation*>(obj);
c->removeOperation(op);
}
}
else if (t == UMLObject::ot_Attribute) {
QTreeWidgetItem *attrNode = item->parent();
if (attrNode) {
QTreeWidgetItem *parent = attrNode->parent();
UMLClassifier* c = static_cast<UMLClassifier*>(findUMLObject(parent));
if (!c) {
uWarning() << "No classifier - cannot delete!";
return;
}
UMLAttribute* attr = static_cast<UMLAttribute*>(obj);
c->removeAttribute(attr);
}
}
else {
uWarning() << "Called for unknown type " << typeid(*obj).name();
}
}