本文整理汇总了C++中Q3PtrList::next方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3PtrList::next方法的具体用法?C++ Q3PtrList::next怎么用?C++ Q3PtrList::next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3PtrList
的用法示例。
在下文中一共展示了Q3PtrList::next方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_actuals
// returns the actuals forms associated to inheritence of 'parent'
QString ClassData::get_actuals(BrowserClass * parent)
{
Q3PtrList<ActualParamData> l;
get_actuals(l, parent);
Q3PtrList<BrowserNode> parents = parent->parents();
for (parent = (BrowserClass *) parents.first();
parent != 0;
parent = (BrowserClass *) parents.next())
get_actuals(l, parent);
QString s;
const char * sep = "<";
ActualParamData * actual;
QString arrow = "->";
for (actual = l.first(); actual != 0; actual = l.next()) {
QString v = actual->get_value().get_type();
if (!v.isEmpty()) {
s += sep + actual->get_name(FALSE) + arrow + v;
sep = ", ";
}
}
return (s.isEmpty()) ? s : s + ">";
}
示例2: compute
void ReferenceDialog::compute() {
QApplication::setOverrideCursor(Qt::waitCursor);
Q3PtrList<BrowserNode> l;
BrowserNode * bn;
nodes.clear();
results->clear();
target->referenced_by(l);
for (bn = l.first(); bn; bn = l.next())
nodes.append(bn);
nodes.sort();
// remove duplicats
nodes.first();
while ((bn = nodes.current()) != 0)
if (bn == nodes.next())
nodes.remove();
QStringList names;
nodes.full_names(names);
QStringList::Iterator it;
for (bn = nodes.first(), it = names.begin();
bn;
bn = nodes.next(), ++it)
results->insertItem(*(bn->pixmap(0)), *it);
selected((nodes.isEmpty()) ? -1 : 0);
QApplication::restoreOverrideCursor();
}
示例3: recursiveSaveData
void QueueEditor::recursiveSaveData(KFTPQueue::TransferDir *parent, const KUrl &srcUrl, const KUrl &dstUrl)
{
KFTPQueue::QueueObject *o;
Q3PtrList<KFTPQueue::QueueObject> children = parent->getChildrenList();
KUrl sUrl, dUrl;
for (o = children.first(); o; o = children.next()) {
KFTPQueue::Transfer *i = static_cast<KFTPQueue::Transfer*>(o);
// Modify the urls
sUrl = srcUrl;
dUrl = dstUrl;
sUrl.addPath(i->getSourceUrl().fileName());
dUrl.addPath(i->getDestUrl().fileName());
// Set the urls
i->setSourceUrl(sUrl);
i->setDestUrl(dUrl);
i->setTransferType(m_lastTransferType);
i->emitUpdate();
if (i->isDir())
recursiveSaveData(static_cast<KFTPQueue::TransferDir*>(i), sUrl, dUrl);
}
}
示例4: send
void SubjectCanvas::send(ToolCom * com, Q3CanvasItemList & all)
{
Q3PtrList<SubjectCanvas> subjects;
Q3CanvasItemList::Iterator cit;
for (cit = all.begin(); cit != all.end(); ++cit) {
DiagramItem *di = QCanvasItemToDiagramItem(*cit);
if ((di != 0) &&
(*cit)->visible() &&
(di->type() == UmlSubject))
subjects.append((SubjectCanvas *) di);
}
com->write_unsigned(subjects.count());
SubjectCanvas * sc;
for (sc = subjects.first(); sc != 0; sc = subjects.next()) {
Q3CString s = fromUnicode(sc->name);
com->write_string((const char *) s);
com->write(sc->rect());
}
}
示例5: merge
void SdDurationCanvas::merge(Q3PtrList<SdDurationCanvas> & l) {
l.removeRef(this);
QRect r = rect();
int vmin = r.top();
int vmax = r.bottom();
SdDurationCanvas * d;
for (d = l.first(); d != 0; d = l.next()) {
QRect dr = d->rect();
if (dr.top() < vmin)
vmin = dr.top();
if (dr.bottom() > vmax)
vmax = dr.bottom();
collapse(d);
}
if (vmin < r.top())
Q3CanvasItem::moveBy(0, vmin - r.top());
resize(r.width(), vmax - vmin + 1);
update_self();
}
示例6: update_actuals
void ClassData::update_actuals()
{
if (DontUpdateActuals)
return;
// an inherited parent was modified/deleted, updates all actuals
Q3PtrList<BrowserNode> parents = browser_node->parents();
Q3PtrList<ActualParamData> new_actuals;
Q3PtrList<ActualParamData> managed;
BrowserClass * parent;
for (parent = (BrowserClass *) parents.first();
parent != 0;
parent = (BrowserClass *) parents.next())
update_actuals(parent, new_actuals, managed);
if (!(actuals == new_actuals)) {
ActualParamData * actual;
for (actual = actuals.first(); actual != 0; actual = actuals.next())
if (new_actuals.findRef(actual) == -1)
delete actual;
actuals = new_actuals;
browser_node->package_modified();
}
// note : even if actuals == new_actuals to take
// into account change in already existing formal and actual
emit actuals_changed();
}
示例7: push
void RuleStack::push( Q3PtrList<KScoringRule> &l )
{
kDebug(5100) <<"RuleStack::push pushing list with" << l.count() <<" rules";
KScoringManager::ScoringRuleList *l1 = new KScoringManager::ScoringRuleList;
for ( KScoringRule *r=l.first(); r != 0; r=l.next() ) {
l1->append( new KScoringRule( *r ) );
}
stack.push( l1 );
kDebug(5100) <<"now there are" << stack.count() <<" lists on the stack";
}
示例8: update_global_settings
void UmlCanvas::update_global_settings()
{
UmlCanvas * c;
for (c = All.first(); c != 0; c = All.next()) {
c->br_diagram->update_drawing_settings();
c->show_shadow = c->br_diagram->get_shadow();
c->draw_all_relations = c->br_diagram->get_draw_all_relations();
}
}
示例9: force_ref
void CppRefType::force_ref(UmlClass * cl, Q3PtrList<CppRefType> & l)
{
CppRefType * ref;
WrapperStr t = cl->name();
for (ref = l.first(); ref; ref = l.next()) {
// don't use ref->type.toString() because of synonymous
// in several namespaces
if ((ref->type.type != 0)
? (ref->type.type == cl)
: (ref->type.explicit_type == t)) {
ref->included = FALSE;
return;
}
}
}
示例10: bs
OperationListDialog::OperationListDialog(const char * m,
Q3PtrList<BrowserOperation> & l)
: QDialog(0, m, TRUE) {
setCaption(m);
move(QCursor::pos());
Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
Q3HBoxLayout * hbox;
vbox->setMargin(5);
cb = new Q3ComboBox(FALSE, this);
vbox->addWidget(cb);
for (BrowserOperation * oper = l.first(); oper; oper = l.next()) {
QString s = ((BrowserNode *) oper->parent())->get_name() +
QString("::") + oper->get_data()->definition(TRUE, FALSE);
if (((OperationData *) oper->get_data())->get_is_abstract())
cb->insertItem("[a] " + s);
else
cb->insertItem(s);
}
hbox = new Q3HBoxLayout(vbox);
hbox->setMargin(5);
QPushButton * ok = new QPushButton(TR("&OK"), this);
QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
QSize bs(cancel->sizeHint());
ok->setDefault(TRUE);
ok->setFixedSize(bs);
cancel->setFixedSize(bs);
hbox->addWidget(ok);
hbox->addWidget(cancel);
UmlDesktop::limitsize_center(this, previous_size, 0.8, 0.8);
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
示例11: add
bool CppRefType::add(const WrapperStr & t, Q3PtrList<CppRefType> & l, bool incl)
{
if (t.isEmpty())
return FALSE;
static Q3Dict<char> cpp_builtin_types;
if (cpp_builtin_types.count() == 0) {
cpp_builtin_types.insert("unsigned", " ");
cpp_builtin_types.insert("signed", " ");
cpp_builtin_types.insert("char", " ");
cpp_builtin_types.insert("short", " ");
cpp_builtin_types.insert("int", " ");
cpp_builtin_types.insert("long", " ");
cpp_builtin_types.insert("float", " ");
cpp_builtin_types.insert("double", " ");
cpp_builtin_types.insert("bool", " ");
cpp_builtin_types.insert("void", " ");
}
if (cpp_builtin_types[t] != 0)
return TRUE;
CppRefType * ref;
Weight w = (incl) ? Medium : Low;
for (ref = l.first(); ref; ref = l.next()) {
if (ref->type.toString() == t) {
if (w > ref->weight)
ref->included = incl;
return TRUE;
}
}
l.append(new CppRefType(t, incl, w));
return TRUE;
}
示例12: send
void SdLifeLineCanvas::send(ToolCom * com, const Q3CanvasItemList & l,
Q3PtrList<FragmentCanvas> & fragments,
Q3PtrList<FragmentCanvas> & refs)
{
int api_format = com->api_format();
Q3PtrDict<SdLifeLineCanvas> used_refs; // the key is the fragment ref
Q3PtrList<SdLifeLineCanvas> lls;
Q3CanvasItemList::ConstIterator cit;
unsigned n = 0;
// count msgs
for (cit = l.begin(); cit != l.end(); ++cit) {
DiagramItem * it = QCanvasItemToDiagramItem(*cit);
if ((it != 0) && // an uml canvas item
(*cit)->visible() &&
(it->type() == UmlLifeLine)) {
SdLifeLineCanvas * ll = (SdLifeLineCanvas *) it;
lls.append(ll);
Q3PtrListIterator<SdDurationCanvas> iter(ll->durations);
// standard msgs
for (; iter.current(); ++iter)
n += iter.current()->count_msg(api_format);
if (com->api_format() >= 41) {
if (ll->end != LIFE_LINE_HEIGHT)
// deletion message, ll can't masked by user
n += 1;
FragmentCanvas * f;
for (f = refs.first(); f != 0; f = refs.next()) {
if (f->collidesWith(ll)) {
// interaction use message
if (used_refs.find((void *) f) == 0) {
n += 1;
used_refs.insert((void *) f, ll);
}
}
}
}
}
}
// write messages
com->write_unsigned(n);
SdLifeLineCanvas * ll;
for (ll = lls.first(); ll != 0; ll = lls.next()) {
int id = ll->obj->get_ident();
Q3PtrListIterator<SdDurationCanvas> iter(ll->durations);
// write standard messages
for (; iter.current(); ++iter)
iter.current()->send(com, id);
if ((ll->end != LIFE_LINE_HEIGHT) && (com->api_format() >= 41)) {
// deletion message, lf can't masked by user
int m = ll->width()/2;
SdMsgBaseCanvas::send(com, id, (unsigned) ll->x() + m,
(unsigned) ll->end + m, aDestruction, "", "", "");
}
}
if (com->api_format() >= 41) {
// interaction use messages
Q3PtrDictIterator<SdLifeLineCanvas>itref(used_refs);
while ((ll = itref.current()) != 0) {
FragmentCanvas * f = (FragmentCanvas *) itref.currentKey();
int m = ll->width()/2;
SdMsgBaseCanvas::send(com, ll->obj->get_ident(),
(unsigned) ll->x() + m, (unsigned) f->center().y(),
anInteractionUse, "", "", f->arguments());
++itref;
}
// send life lines covered by fragment
FragmentCanvas * f;
for (f = fragments.first(); f != 0; f = fragments.next()) {
Q3PtrList<SdLifeLineCanvas> covered;
for (ll = lls.first(); ll != 0; ll = lls.next())
if (f->collidesWith(ll))
covered.append(ll);
com->write_unsigned(covered.count());
for (ll = covered.first(); ll != 0; ll = covered.next())
com->write_unsigned((unsigned) ll->obj->get_ident());
//.........这里部分代码省略.........
示例13: if
//.........这里部分代码省略.........
}
else if (!have_const_copy) {
g = new Q3HGroupBox(this);
vbox->addWidget(g);
labels.append(new QLabel("the class doesn't have copy contructor ",
g));
Q3VBox * v = new Q3VBox(g);
add_const_copy = new QCheckBox("add copy constructor\nwith const argument",
v);
add_copy = new QCheckBox("add copy constructor\nwith non const argument",
v);
}
else {
g = new Q3HGroupBox(this);
vbox->addWidget(g);
labels.append(new QLabel("the class doesn't have copy contructor \nwith non const argument ",
g));
add_copy = new QCheckBox("add copy constructor\nwith non const argument",
g);
add_const_copy = 0;
}
// assignment
if (have_assignment) {
add_assign = 0;
if (!have_const_assignment) {
g = new Q3HGroupBox(this);
vbox->addWidget(g);
labels.append(new QLabel("the class doesn't have assignment\noperator with const argument ",
g));
add_const_assign = new QCheckBox("add assignment\nwith const argument",
g);
}
else
add_const_assign = 0;
}
else if (!have_const_assignment) {
g = new Q3HGroupBox(this);
vbox->addWidget(g);
labels.append(new QLabel("the class doesn't have assignment operator ", g));
Q3VBox * v = new Q3VBox(g);
add_const_assign = new QCheckBox("add assignment\nwith const argument",
v);
add_assign = new QCheckBox("add assignment\nwith non const argument",
v);
}
else {
g = new Q3HGroupBox(this);
vbox->addWidget(g);
labels.append(new QLabel("the class doesn't have assignment operator \nwith non const argument ",
g));
add_assign = new QCheckBox("add assignment\nwith non const argument",
g);
add_const_assign = 0;
}
// use the same width for all the labels on the first column
QSize sz(labels.first()->sizeHint());
while ((lbl = labels.next()) != 0) {
if (lbl->sizeHint().width() > sz.width())
sz.setWidth(lbl->sizeHint().width());
}
for (lbl = labels.first(); lbl != 0; lbl = labels.next()) {
sz.setHeight(lbl->sizeHint().height());
lbl->setFixedSize(sz);
}
// ok & cancel buttons
Q3HBox * hbox = new Q3HBox(this);
vbox->addWidget(hbox);
QPushButton * ok = new QPushButton("&OK", hbox);
QPushButton * cancel = new QPushButton("&Cancel", hbox);
QSize bs(cancel->sizeHint());
ok->setDefault(TRUE);
ok->setFixedSize(bs);
cancel->setFixedSize(bs);
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
示例14: compute
void CppRefType::compute(Q3PtrList<CppRefType> & dependencies,
const WrapperStr & hdef, const WrapperStr & srcdef,
WrapperStr & h_incl, WrapperStr & decl, WrapperStr & src_incl,
UmlArtifact * who)
{
UmlPackage * pack = who->package();
WrapperStr hdir;
WrapperStr srcdir;
if (CppSettings::isRelativePath()) {
WrapperStr empty;
hdir = pack->header_path(empty);
srcdir = pack->source_path(empty);
}
else if (CppSettings::isRootRelativePath())
hdir = srcdir = UmlPackage::rootDir();
// aze.cpp includes aze.h
src_incl += "#include \"";
if (CppSettings::includeWithPath())
src_incl += pack->header_path(who->name(), srcdir);
else {
src_incl += who->name();
src_incl += '.';
src_incl += CppSettings::headerExtension();
}
src_incl += "\"\n";
h_incl = ""; // to not be WrapperStr::null
decl = ""; // to not be WrapperStr::null
CppRefType * ref;
for (ref = dependencies.first(); ref != 0; ref = dependencies.next())
{
UmlClass * cl = (ref->type.type)
? ref->type.type
: UmlBaseClass::get(ref->type.explicit_type, 0);
bool included = ref->included;
WrapperStr hform; // form in header
WrapperStr srcform; // form in source
if (cl == 0) {
WrapperStr in = CppSettings::include(ref->type.explicit_type);
if (!in.isEmpty())
hform = srcform = in + '\n';
else
// doesn't know what it is
continue;
}
else if (cl->isCppExternal())
{
QString className = cl->name();
hform = cl->cppDecl();
int index;
if ((index = hform.find('\n')) == -1)
// wrong form
continue;
hform = hform.mid(index + 1) + '\n';
for (;;) {
if ((index = hform.find("${name}")) != -1)
hform.replace(index, 7, cl->name());
else if ((index = hform.find("${Name}")) != -1)
hform.replace(index, 7, capitalize(cl->name()));
else if ((index = hform.find("${NAME}")) != -1)
hform.replace(index, 7, cl->name().upper());
else if ((index = hform.find("${nAME}")) != -1)
hform.replace(index, 7, cl->name().lower());
else
break;
}
srcform = hform;
}
else {
QString className = cl->name();
WrapperStr st = cl->cpp_stereotype();
if ((st == "enum") || (st == "typedef"))
included = TRUE;
UmlArtifact * art = cl->associatedArtifact();
if (art != 0) {
if (art == who)
// don't include itself
continue;
if (CppSettings::includeWithPath()) {
UmlPackage * p = art->package();
hform = "#include \"" + p->header_path(art->name(), hdir) + "\"\n";
//.........这里部分代码省略.........
示例15: generate
void UmlTransition::generate(Q3PtrList<UmlTransition> trs, UmlClass * machine, UmlClass * anystate, UmlState * state, Q3CString & body, Q3CString indent, bool completion)
{
UmlTransition * tr;
bool guard = FALSE;
for (tr = trs.first(); tr != 0; tr = trs.next()) {
body += indent;
if (!tr->cppGuard().isEmpty()) {
// manage guard
body += ((tr == trs.getFirst()) ? "if (" : "else if (")
+ tr->cppGuard() + ") {\n";
guard = TRUE;
}
else
// no gard : it is the last transition, may be the first
body += ((tr == trs.getFirst()) ? "{\n" : "else {\n");
// the target state
UmlItem * tg = tr->target();
bool self_external = (state == tg) && tr->isExternal();
while (tg->kind() != aState)
tg = tg->parent();
// the parent common to the current and the target state
UmlState * common = state;
if (self_external) {
// execute exit behavior
if (!state->cppExitBehavior().isEmpty())
body += indent + " _doexit(stm);\n";
}
else {
bool fromExit =
// the exit behavior is made entering in the exit point
(tr->parent()->kind() == anExitPointPseudoState);
// compute common parent and manage exit behavior
if (tr->target()->kind() != aTerminatePseudoState) {
while (!((UmlState *) tg)->inside(common)) {
if (!fromExit && !common->cppExitBehavior().isEmpty())
body += indent + " stm" + common->path() + "._doexit(stm);\n";
fromExit = FALSE;
switch (common->parent()->kind()) {
case aState:
common = (UmlState *) common->parent();
break;
case aRegion:
common = (UmlState *) common->parent()->parent();
break;
default:
UmlCom::trace("Error : transition from '" + state->name()
+ "' goes outside the state machine");
throw 0;
}
}
}
}
// manage transition activity
if (!tr->cppActivity().isEmpty())
body += "#ifdef VERBOSE_STATE_MACHINE\n" + indent +
" puts(\"DEBUG : execute activity of transition " + tr->name() +
"\");\n#endif\n" + tr->cppActivity();
// manage entry behavior
if (self_external) {
if (state->needCreate())
body += indent + " create(stm);\n";
}
else if (tr->target()->kind() != aTerminatePseudoState) {
if (tg != common) {
Q3CString enter;
UmlState * tg_parent;
// the enter behavior of the target state will be managed
// generating a call to create
for (tg_parent = (UmlState *) tg->parent();
tg_parent != common;
tg_parent = (UmlState *) tg_parent->parent())
if (!tg_parent->cppEntryBehavior().isEmpty())
enter.insert(0,
(const char *)(indent + " stm" + tg_parent->path() + "._doentry(stm);\n")); //[rageek] ambiguous
if (!enter.isEmpty())
body += enter;
}
// set the current state if needed
if (tg != state)
body += indent + " stm._set_currentState(stm"
+ ((UmlState *) tg)->path() + ");\n#ifdef VERBOSE_STATE_MACHINE\n" +
indent + " puts(\"DEBUG : current state is now " + ((UmlState *) tg)->prettyPath() +
"\");\n#endif\n";
}
//.........这里部分代码省略.........