本文整理汇总了C++中UMLAttribute::setVisibility方法的典型用法代码示例。如果您正苦于以下问题:C++ UMLAttribute::setVisibility方法的具体用法?C++ UMLAttribute::setVisibility怎么用?C++ UMLAttribute::setVisibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMLAttribute
的用法示例。
在下文中一共展示了UMLAttribute::setVisibility方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotEditFinished
//.........这里部分代码省略.........
op->addParm(a);
}
}
m_label = op->toString(Uml::SignatureType::SigNoVis);
} else {
KMessageBox::error(0,
Model_Utils::psText(st),
i18n("Rename canceled"));
}
setText(m_label);
break;
}
case lvt_Attribute:
case lvt_EntityAttribute: {
if (m_object == 0) {
cancelRenameWithMsg();
return;
}
UMLClassifier *parent = static_cast<UMLClassifier*>(m_object->parent());
Model_Utils::NameAndType nt;
Uml::Visibility::Enum vis;
Model_Utils::Parse_Status st;
st = Model_Utils::parseAttribute(newText, nt, parent, &vis);
if (st == Model_Utils::PS_OK) {
UMLObject *exists = parent->findChildObject(newText);
if (exists) {
cancelRenameWithMsg();
return;
}
UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObject(m_object, nt.m_name));
UMLAttribute *pAtt = static_cast<UMLAttribute*>(m_object);
pAtt->setType(nt.m_type);
pAtt->setVisibility(vis);
pAtt->setParmKind(nt.m_direction);
pAtt->setInitialValue(nt.m_initialValue);
m_label = pAtt->toString(Uml::SignatureType::SigNoVis);
} else {
KMessageBox::error(0,
Model_Utils::psText(st),
i18n("Rename canceled"));
}
setText(m_label);
break;
}
case lvt_PrimaryKeyConstraint:
case lvt_UniqueConstraint:
case lvt_ForeignKeyConstraint:
case lvt_CheckConstraint: {
if (m_object == 0) {
cancelRenameWithMsg();
return;
}
UMLEntity *parent = static_cast<UMLEntity*>(m_object->parent());
QString name;
Model_Utils::Parse_Status st;
st = Model_Utils::parseConstraint(newText, name, parent);
if (st == Model_Utils::PS_OK) {
UMLObject *exists = parent->findChildObject(name);
if (exists) {
cancelRenameWithMsg();
return;
}
UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObject(m_object, name));