当前位置: 首页>>代码示例>>C++>>正文


C++ UMLClassifier::setAbstract方法代码示例

本文整理汇总了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;
}
开发者ID:serghei,项目名称:kde-kdesdk,代码行数:55,代码来源:umloperationdialog.cpp


注:本文中的UMLClassifier::setAbstract方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。