/** * Add C++ stereotypes. */ void createCppStereotypes() { UMLDoc *umldoc = UMLApp::app()->document(); umldoc->findOrCreateStereotype("constructor"); // declares an operation as friend umldoc->findOrCreateStereotype("friend"); // to use in methods that aren't abstract umldoc->findOrCreateStereotype("virtual"); }
void UMLObject::setStereotypeCmd(const QString& name) { if (name.isEmpty()) { setUMLStereotype(NULL); return; } UMLDoc *pDoc = UMLApp::app()->document(); UMLStereotype *s = pDoc->findOrCreateStereotype(name); setUMLStereotype(s); }
/** * Sets the classes stereotype name. * Internally uses setUMLStereotype(). * * @param _name Sets the classes stereotype name. */ void UMLObject::setStereotype(const QString &_name) { // UMLDoc* pDoc = UMLApp::app()->document(); // pDoc->executeCommand(new cmdSetStereotype(this,_name)); if (_name.isEmpty()) { setUMLStereotype(NULL); return; } UMLDoc *pDoc = UMLApp::app()->document(); UMLStereotype *s = pDoc->findOrCreateStereotype(_name); setUMLStereotype(s); }