本文整理汇总了C++中BrowserNode::nextSibling方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserNode::nextSibling方法的具体用法?C++ BrowserNode::nextSibling怎么用?C++ BrowserNode::nextSibling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserNode
的用法示例。
在下文中一共展示了BrowserNode::nextSibling方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: post_duplicate
void BrowserOperation::post_duplicate()
{
BrowserNode * x_of;
void (BrowserOperation::*set_x_of)(BrowserNode *);
if (get_of != 0) {
x_of = get_of;
get_of = 0;
set_x_of = &BrowserOperation::set_get_of;
}
else if (set_of != 0) {
x_of = set_of;
set_of = 0;
set_x_of = &BrowserOperation::set_set_of;
}
else
return;
// search for attribute/relation
QString s = x_of->get_name();
UmlCode k = x_of->get_type();
BrowserNode * child;
for (child = ((BrowserNode *)parent())->firstChild(); child != 0; child = child->nextSibling()) {
if ((((BrowserNode *) child)->get_type() == k) &&
((BrowserNode *) child)->get_name() == s) {
// this one
(this->*set_x_of)((BrowserNode *) child);
break;
}
}
}
示例2: prepare_update_lib
void BrowserArtifact::prepare_update_lib() const
{
all.memo_id_oid(get_ident(), original_id);
for (BrowserNode * child = firstChild();
child != 0;
child = child->nextSibling())
((BrowserNode *) child)->prepare_update_lib();
}
示例3: check_inherit
// just check if the inheritance already exist
QString BrowserArtifact::check_inherit(const BrowserNode * new_parent) const
{
BrowserNode * child;
for (child = firstChild(); child != 0; child = child->nextSibling()) {
BrowserNode * ch = ((BrowserNode *) child);
if ((ch->get_type() == UmlInherit) &&
((((SimpleRelationData *) ch->get_data())->get_end_node())
== new_parent))
return QObject::tr("already exist");
}
return (new_parent != this) ? QString() : QObject::tr("circular inheritance");
}
示例4: if
PseudoStateDialog::PseudoStateDialog(PseudoStateData * ps)
: TabDialog(0, 0, FALSE, Qt::WA_DeleteOnClose), pst(ps)
{
BrowserPseudoState * bn = (BrowserPseudoState *) pst->browser_node;
BrowserState * refst;
SmallPushButton* sButton;
switch (bn->get_type()) {
case EntryPointPS:
case ExitPointPS:
if (((BrowserNode *) bn->parent())->get_type() == UmlState) {
refst = ((StateData *)((BrowserNode *) bn->parent())->get_data())->get_reference();
break;
}
// no break
default:
refst = 0;
}
bn->edit_start();
if (bn->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
QString s = stringify(bn->get_type());
int index = s.indexOf("_");
if (index != -1)
s.replace(index, 1, " ");
setCaption((s + " dialog"));
visit = !hasOkButton();
// general tab
GridBox * grid = new GridBox(2, this);
grid->setMargin(5);
grid->setSpacing(5);
grid->addWidget(new QLabel(TR("name : "), grid));
grid->addWidget(edname = new LineEdit(bn->get_name(), grid));
edname->setReadOnly(visit);
grid->addWidget(new QLabel(TR("stereotype : "), grid));
grid->addWidget(edstereotype = new QComboBox(grid));
edstereotype->setEditable(!visit);
edstereotype->addItem(toUnicode(pst->get_stereotype()));
if (! visit) {
edstereotype->addItems(BrowserPseudoState::default_stereotypes());
edstereotype->addItems(ProfiledStereotypes::defaults(bn->get_type()));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentIndex(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorizontalPolicy(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
if (refst != 0) {
connect(new SmallPushButton(TR("reference :"), grid), SIGNAL(clicked()),
this, SLOT(menu_reference()));
grid->addWidget(edreference = new QComboBox(grid));
edreference->setSizePolicy(sp);
BrowserNode * ref = ((pst->get_reference() == 0) ||
!bn->can_reference(pst->get_reference()))
? 0 : pst->get_reference();
if (visit) {
if (ref == 0)
edreference->addItem("");
else
edreference->addItem(ref->full_name(TRUE));
}
else {
edreference->addItem("");
edreference->setAutoCompletion(completion());
BrowserNode * child;
UmlCode k = bn->get_type();
for (child = refst->firstChild();
child != 0;
child = child->nextSibling()) {
if (!((BrowserNode *) child)->deletedp()) {
UmlCode kk = ((BrowserNode *) child)->get_type();
if (kk == k)
pseudostates.append((BrowserNode *) child);
else if (kk == UmlRegion) {
for (BrowserNode * schild = child->firstChild();
//.........这里部分代码省略.........
示例5: accept
void RelatedElementsDialog::accept() {
bool inh = (inh_rb != 0) && inh_rb->isChecked();
bool dep = dep_rb->isChecked();
bool assoc = (assoc_rb != 0) && assoc_rb->isChecked();
if (!inh && !dep && !assoc)
return;
bool sametype = sametype_rb->isChecked();
UmlCode k = elt->get_type();
elts.clear();
Q3PtrDict<BrowserNode> d(71);
BrowserNodeList added;
int lvl = sb_level->value();
added.append(elt);
d.insert(elt, elt);
do {
BrowserNodeList newones;
Q3PtrListIterator<BrowserNode> it(added);
for (; it.current() != 0; ++it) {
BrowserNode * e = (BrowserNode *) it.current();
BrowserNode * bn;
if (referenced_rb->isChecked()) {
for (bn = (BrowserNode *) e->firstChild();
bn != 0;
bn = (BrowserNode *) bn->nextSibling()) {
if (! bn->deletedp()) {
BrowserNode * target;
switch (bn->get_type()) {
case UmlAssociation:
case UmlDirectionalAssociation:
case UmlAggregation:
case UmlAggregationByValue:
case UmlDirectionalAggregation:
case UmlDirectionalAggregationByValue:
if (! assoc) continue;
target = ((RelationData *) bn->get_data())->get_end_class();
break;
case UmlDependency:
if (! dep) continue;
target = ((RelationData *) bn->get_data())->get_end_class();
break;
case UmlGeneralisation:
case UmlRealize:
if (! inh) continue;
target = ((RelationData *) bn->get_data())->get_end_class();
break;
case UmlDependOn:
if (! dep) continue;
target = ((SimpleRelationData *) bn->get_data())->get_end_node();
break;
case UmlInherit:
if (! inh) continue;
target = ((SimpleRelationData *) bn->get_data())->get_end_node();
break;
default:
continue;
}
if ((sametype && (target->get_type() != k)) ||
(d[target] != 0))
continue;
d.insert(target, target);
newones.append(target);
}
}
}
if (referencing_rb->isChecked()) {
if (e->get_type() == UmlClass)
BrowserRelation::get_relating(e, d, newones, inh, dep, assoc);
BrowserSimpleRelation::get_relating(e, d, newones, inh, dep, sametype, k);
}
}
added = newones;
} while (--lvl != 0);
d.remove(elt);
Q3PtrDictIterator<BrowserNode> it(d);
while (it.current()) {
elts.append(it.current());
++it;
}
QDialog::accept();
}