本文整理汇总了C++中UMLClassifier::setAbstract方法的典型用法代码示例。如果您正苦于以下问题:C++ UMLClassifier::setAbstract方法的具体用法?C++ UMLClassifier::setAbstract怎么用?C++ UMLClassifier::setAbstract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMLClassifier
的用法示例。
在下文中一共展示了UMLClassifier::setAbstract方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
bool UMLOperationDialog::apply()
{
QString name = m_pNameLE -> text();
if( name.length() == 0 ) {
KMessageBox::error(this, i18n("You have entered an invalid operation name."),
i18n("Operation Name Invalid"), false);
m_pNameLE -> setText( m_pOperation -> getName() );
return false;
}
UMLClassifier *classifier = dynamic_cast<UMLClassifier*>( m_pOperation->parent() );
if( classifier != 0L &&
classifier->checkOperationSignature(name, m_pOperation->getParmList(), m_pOperation) )
{
QString msg = QString(i18n("An operation with that signature already exists in %1.\n")).arg(classifier->getName())
+
QString(i18n("Choose a different name or parameter list." ));
KMessageBox::error(this, msg, i18n("Operation Name Invalid"), false);
return false;
}
m_pOperation -> setName( name );
if( m_pPublicRB -> isChecked() )
m_pOperation -> setVisibility( Uml::Visibility::Public );
else if( m_pPrivateRB -> isChecked() )
m_pOperation -> setVisibility( Uml::Visibility::Private );
else if (m_pProtectedRB -> isChecked() )
m_pOperation -> setVisibility( Uml::Visibility::Protected );
else if (m_pImplementationRB -> isChecked() )
m_pOperation -> setVisibility( Uml::Visibility::Implementation );
QString typeName = m_pRtypeCB->currentText();
UMLTemplate *tmplParam = classifier->findTemplate(typeName);
if (tmplParam)
m_pOperation->setType(tmplParam);
else
m_pOperation->setTypeName(typeName);
m_pOperation->setStereotype( m_pStereoTypeCB->currentText() );
bool isAbstract = m_pAbstractCB->isChecked();
m_pOperation -> setAbstract( isAbstract );
if (isAbstract) {
/* If any operation is abstract then the owning class needs
to be made abstract.
The inverse is not true: The fact that no operation is
abstract does not mean that the class must be non-abstract.
*/
classifier->setAbstract(true);
}
m_pOperation->setStatic( m_pStaticCB->isChecked() );
m_pOperation->setConst( m_pQueryCB->isChecked() );
return true;
}