本文整理汇总了C++中UMLClassifierList::findRef方法的典型用法代码示例。如果您正苦于以下问题:C++ UMLClassifierList::findRef方法的具体用法?C++ UMLClassifierList::findRef怎么用?C++ UMLClassifierList::findRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMLClassifierList
的用法示例。
在下文中一共展示了UMLClassifierList::findRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTemplateParams
void UMLAttribute::setTemplateParams(const QString& templateParam, UMLClassifierList &templateParamList) {
if (templateParam.isEmpty())
return;
QString type = templateParam.simplifyWhiteSpace();
int start = type.find(QChar('<'));
if (start >= 0 ) {
int end = start;
int count = 1;
int len = type.length();
while (count != 0 && ++end < len) {
QChar c = type.at(end);
if (c == QChar('<')) {
count++;
}
if (c == QChar('>')) {
count--;
}
}
if (count != 0) {
//The template is ill-formated, let's quit
return;
}
setTemplateParams(type.mid(start + 1, end - start - 1), templateParamList);
setTemplateParams(type.left(start) + type.right(len - end - 1), templateParamList);
} else {
QStringList paramsList = QStringList::split(QChar(','), type);
for ( QStringList::Iterator it = paramsList.begin(); it != paramsList.end(); ++it ) {
QString param = *it;
if (!param.isEmpty()) {
UMLDoc *pDoc = UMLApp::app()->getDocument();
UMLObject* obj = pDoc->findUMLObject(param);
if (obj == NULL ) {
obj = pDoc->findUMLObject(param.remove(QChar(' ')));
}
if (obj != NULL ) {
//We want to list only the params that already exist in this document
//If the param doesnt't already exist, we couldn't draw an association anyway
UMLClassifier* tmpClassifier = static_cast<UMLClassifier*>(obj);
if (templateParamList.findRef(tmpClassifier) == -1) {
templateParamList.append(tmpClassifier);
}
}
}
}
}
}