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


C++ Q3ValueList::clear方法代码示例

本文整理汇总了C++中Q3ValueList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3ValueList::clear方法的具体用法?C++ Q3ValueList::clear怎么用?C++ Q3ValueList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Q3ValueList的用法示例。


在下文中一共展示了Q3ValueList::clear方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QVERIFY

void tst_Q3ValueList::clear()
{
    Q3ValueList<int> a;
    a.append( 1 );
    a.append( 2 );
    a.append( 3 );
    a.clear();
    QVERIFY( a.isEmpty() );
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:9,代码来源:tst_q3valuelist.cpp

示例2: relationsValue

void UmlBaseClassInstance::relationsValue(Q3ValueList<SlotRelation> & result) {
  UmlCom::send_cmd(_identifier, relationsCmd, (void *) 0);

  unsigned n = UmlCom::read_unsigned();

  result.clear();
  while (n--) {
    UmlRelation * r = (UmlRelation *) UmlBaseItem::read_();

    result.append(SlotRelation(r, (UmlClassInstance *) UmlBaseItem::read_()));
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:12,代码来源:UmlBaseClassInstance.cpp

示例3: attributesValue

void UmlBaseClassInstance::attributesValue(Q3ValueList<SlotAttribute> & result) {
  UmlCom::send_cmd(_identifier, attributesCmd, (char) 0);

  unsigned n = UmlCom::read_unsigned();

  result.clear();
  while (n--) {
    UmlAttribute * at = (UmlAttribute *) UmlBaseItem::read_();

    result.append(SlotAttribute(at, UmlCom::read_string()));
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:12,代码来源:UmlBaseClassInstance.cpp

示例4: isAppliedStereotype

bool UmlClass::isAppliedStereotype(Token & tk, WrapperStr & prof_st, Q3ValueList<WrapperStr> & base_v)
{
    static Q3Dict<WrapperStr> stereotypes;
    static Q3Dict<Q3ValueList<WrapperStr> > bases;

    WrapperStr s = tk.what();
    WrapperStr * st = stereotypes[s];

    if (st != 0) {
        prof_st = *st;
        base_v = *bases[s];
        return TRUE;
    }

    base_v.clear();

    if (tk.xmiType().isEmpty() && (getFct(tk) == 0))  {
        int index = s.find(':');

        if ((index != -1) &&
            ((index != 3) || ((s.left(3) != "uml") && (s.left(3) != "xmi")))) {
            UmlClass * cl = findStereotype(s, FALSE);

            if (cl != 0) {
                const Q3PtrVector<UmlItem> ch = cl->children();
                unsigned n = ch.size();

                for (unsigned i = 0; i != n; i += 1) {
                    UmlItem * x = ch[i];

                    if ((x->kind() == aRelation) &&
                        (((UmlRelation *) x)->relationKind() == aDirectionalAssociation) &&
                        (((UmlRelation *) x)->roleType()->stereotype() == "metaclass"))
                        base_v.append("base_" + ((UmlRelation *) x)->roleType()->name().lower());
                }

                if (base_v.isEmpty())
                    base_v.append("base_element");

                prof_st = cl->parent()->parent()->name() + ":" + cl->name();
                stereotypes.insert(s, new WrapperStr(prof_st));
                bases.insert(s, new Q3ValueList<WrapperStr>(base_v));
                return TRUE;
            }
        }
    }

    return FALSE;
}
开发者ID:daniel7solis,项目名称:douml,代码行数:49,代码来源:UmlClass.cpp

示例5: QCOMPARE

void tst_Q3ValueList::size()
{
    Q3ValueList<int> a;
    QCOMPARE( (int)a.size(), 0 );

    a.append( 1 );
    QCOMPARE( (int)a.size(), 1 );

    a.append( 2 );
    QCOMPARE( (int)a.size(), 2 );

    a.append( 3 );
    QCOMPARE( (int)a.size(), 3 );

    a.clear();
    QCOMPARE( (int)a.size(), 0 );
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:17,代码来源:tst_q3valuelist.cpp

示例6: get_extended

void UmlClass::get_extended(Q3ValueList<WrapperStr> & r)
{
    r.clear();

    const Q3PtrVector<UmlItem> ch = children();
    unsigned n = ch.size();
    unsigned i;

    for (i = 0; i != n; i += 1) {
        UmlItem * x = ch[i];

        if ((x->kind() == aRelation) &&
            (((UmlRelation *) x)->relationKind() == aDirectionalAssociation) &&
            (((UmlRelation *) x)->roleType()->stereotype() == "metaclass"))
            r.append(((UmlRelation *) x)->roleType()->name());
    }

    if (r.isEmpty())
        r.append("Element");
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:20,代码来源:UmlClass.cpp


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