本文整理汇总了C++中Q3PtrList类的典型用法代码示例。如果您正苦于以下问题:C++ Q3PtrList类的具体用法?C++ Q3PtrList怎么用?C++ Q3PtrList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Q3PtrList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: slotCursorLeft
// -----------------------------------------------------------
void QucsApp::slotCursorLeft(bool left)
{
int sign = 1;
if(left){
sign = -1;
}
if(!editText->isHidden()) return; // for edit of component property ?
Q3PtrList<Element> movingElements;
Schematic *Doc = (Schematic*)DocumentTab->currentWidget();
int markerCount = Doc->copySelectedElements(&movingElements);
if((movingElements.count() - markerCount) < 1) {
if(markerCount > 0) { // only move marker if nothing else selected
Doc->markerLeftRight(left, &movingElements);
} else if(left) {
if(Doc->scrollLeft(Doc->horizontalScrollBar()->singleStep()))
Doc->scrollBy(-Doc->horizontalScrollBar()->singleStep(), 0);
}else{ // right
if(Doc->scrollRight(-Doc->horizontalScrollBar()->singleStep()))
Doc->scrollBy(Doc->horizontalScrollBar()->singleStep(), 0);
}
Doc->viewport()->update();
view->drawn = false;
return;
} else { // random selection. move all of them
view->moveElements(&movingElements, sign*Doc->GridX, 0);
view->MAx3 = 1; // sign for moved elements
view->endElementMoving(Doc, &movingElements);
}
}
示例3: get_actuals
void ClassData::get_actuals(Q3PtrList<ActualParamData> & l, BrowserClass * parent)
{
if (((BrowserNode *) parent->parent())->get_type() == UmlClass)
get_actuals(l, (BrowserClass *) parent->parent());
ActualParamData * actual;
int n = ((ClassData *) parent->get_data())->nformals;
if (n != 0) {
// search the first associated actual
for (actual = actuals.first(); actual != 0; actual = actuals.next()) {
if ((actual->get_class() == parent) &&
(l.findRef(actual) == -1))
// find;
break;
}
int nth = 0;
// progress on still present formals
while (actual && (nth < n) && (actual->get_class() == parent)) {
// actual ok
l.append(actual);
actual = actuals.next();
nth += 1;
}
}
}
示例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: 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();
}
示例6: 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();
}
示例7: 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);
}
}
示例8: children
void UmlJunctionPseudoState::generate(UmlClass * machine, UmlClass * anystate, UmlState * state) {
// create an operation because a priori shared
if (_oper.isEmpty())
_oper.sprintf("_junction%d", ++_rank);
UmlClass * cl = state->assocClass();
UmlOperation * junction;
if (((junction = (UmlOperation *) cl->getChild(anOperation, _oper)) == 0) &&
((junction = UmlBaseOperation::create(cl, _oper)) == 0)) {
UmlCom::trace("Error : cannot create operation '" + _oper
+ "' in class '" + cl->name() + "'<br>");
throw 0;
}
junction->defaultDef();
junction->setComment("implement a junction, through an operation because shared, internal");
junction->setType("void", "${type}");
junction->addParam(0, InputOutputDirection, "stm", machine);
junction->setParams("${t0} & ${p0}");
Q3CString body;
const Q3PtrVector<UmlItem> ch = children();
Q3PtrList<UmlTransition> trs;
unsigned index;
for (index = 0; index != ch.count(); index += 1)
if (ch[index]->kind() == aTransition)
// theo mandatory
trs.append((UmlTransition *) ch[index]);
UmlTransition::generate(trs, machine, anystate, state, body, " ", FALSE);
junction->set_CppBody(body);
}
示例9: MultiCommand
void DOMTreeView::slotMovedItems(Q3PtrList<QTreeWidgetItem> &items, Q3PtrList<QTreeWidgetItem> &/*afterFirst*/, Q3PtrList<QTreeWidgetItem> &afterNow)
{
MultiCommand *cmd = new MultiCommand(i18n("Move Nodes"));
_refreshed = false;
Q3PtrList<QTreeWidgetItem>::Iterator it = items.begin();
Q3PtrList<QTreeWidgetItem>::Iterator anit = afterNow.begin();
for (; it != items.end(); ++it, ++anit) {
DOMListViewItem *item = static_cast<DOMListViewItem *>(*it);
DOMListViewItem *anitem = static_cast<DOMListViewItem *>(*anit);
DOM::Node parent = static_cast<DOMListViewItem *>(item->parent())->node();
Q_ASSERT(!parent.isNull());
// kDebug(90180) << " afternow " << anitem << " node " << (anitem ? anitem->node().nodeName().string() : QString()) << "=" << (anitem ? anitem->node().nodeValue().string() : QString());
cmd->addCommand(new MoveNodeCommand(item->node(), parent,
anitem ? anitem->node().nextSibling() : parent.firstChild())
);
}
mainWindow()->executeAndAddCommand(cmd);
// refresh *anyways*, otherwise consistency is disturbed
if (!_refreshed) refresh();
slotShowNode(current_node);
}
示例10: slotCursorRight
// -----------------------------------------------------------
void QucsApp::slotCursorRight()
{
if(!editText->isHidden()) return; // for edit of component property ?
Q3PtrList<Element> movingElements;
Schematic *Doc = (Schematic*)DocumentTab->currentPage();
int markerCount = Doc->copySelectedElements(&movingElements);
if((movingElements.count() - markerCount) < 1) {
if(markerCount > 0) { // only move marker if nothing else selected
Doc->markerLeftRight(false, &movingElements);
movingElements.clear();
}
else {
if(Doc->scrollRight(-Doc->horizontalScrollBar()->lineStep()))
Doc->scrollBy(Doc->horizontalScrollBar()->lineStep(), 0);
}
Doc->viewport()->update();
view->drawn = false;
return;
}
view->moveElements(&movingElements, Doc->GridX, 0); // move "GridX" to right
view->MAx3 = 1; // sign for moved elements
view->endElementMoving(Doc, &movingElements);
}
示例11: getSINWAV
PlotLine * SINWAV::calculateCustom (QString &, Q3PtrList<PlotLine> &)
{
Q3PtrList<PlotLine> pll;
pll.setAutoDelete(FALSE);
getSINWAV(pll);
pll.remove(1);
return pll.at(0);
}
示例12: it
void UmlClass::extend(WrapperStr mcl)
{
if (parent()->parent()->kind() != aPackage)
return;
int index = mcl.find('#');
if (index == -1)
return;
WrapperStr path = mcl.left(index);
const char * defltpath0 = "http://schema.omg.org/spec/UML/2.0/uml.xml";
const char * defltpath1 = "http://schema.omg.org/spec/UML/2.1/uml.xml";
bool dflt = ((path == defltpath0) || (path == defltpath1));
mcl = mcl.mid(index + 1);
static Q3PtrList<UmlClass> metaclasses;
Q3PtrListIterator<UmlClass> it(metaclasses);
UmlClass * metacl = UmlClass::get(mcl, 0);
WrapperStr s;
if ((metacl == 0) ||
(metacl->stereotype() != "metaclass") ||
!((dflt) ? (!metacl->propertyValue("metaclassPath", s) ||
(s == defltpath0) ||
(s == defltpath1))
: (metacl->propertyValue("metaclassPath", s) &&
(path == s)))) {
metacl = 0;
if (dflt) {
for (; (metacl = it.current()) != 0; ++it) {
if (!strcmp(mcl, metacl->name()) &&
(!metacl->propertyValue("metaclassPath", s) ||
(s == defltpath0) ||
(s == defltpath1)))
break;
}
}
else {
for (; (metacl = it.current()) != 0; ++it) {
if (!strcmp(mcl, metacl->name()) &&
metacl->propertyValue("metaclassPath", s) &&
(path == s))
break;
}
}
if (metacl == 0) {
metacl = addMetaclass(mcl, (dflt) ? 0 : (const char *)path); //[rageek] different types for ? :
metaclasses.append(metacl);
}
}
UmlRelation::create(aDirectionalAssociation, this, metacl);
}
示例13: change_rel
bool ClassInstanceData::change_rel(ToolCom * com, const char * args,
bool isadd) {
com->get_unsigned(args); // 2
BrowserRelation * r = (BrowserRelation *) com->get_id(args);
BrowserClassInstance * other = (BrowserClassInstance *) com->get_id(args);
if (r->deletedp() || other->deletedp()) {
com->write_ack(FALSE);
return FALSE;
}
RelationData * rd = (RelationData *) r->get_data();
Q3ValueList<SlotRel>::Iterator it;
for (it = relations.begin(); it != relations.end(); ++it) {
const SlotRel & slot_rel = *it;
if ((slot_rel.value == other) &&
(r == ((slot_rel.is_a) ? rd->get_start() : rd->get_end())))
break;
}
if (isadd) {
if (it == relations.end()) {
// not yet present
Q3PtrList<BrowserRelation> l;
cl->get_rels(((ClassInstanceData *)other->get_data())->cl, l);
if ((l.findRef(r) == -1) ||
(!other->is_writable() && !root_permission())) {
// illegal
com->write_ack(FALSE);
return FALSE;
}
// add it
if (rd->is_a(r))
add(other, rd);
else
((ClassInstanceData *)other->get_data())
->add((BrowserClassInstance *) browser_node, rd);
}
}
else if (it != relations.end()) {
// remove it
if (!other->is_writable() && !root_permission()) {
// illegal
com->write_ack(FALSE);
return FALSE;
}
replace(other, rd, 0, (*it).is_a, 0);
}
return TRUE;
}
示例14: 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";
}
示例15: generate
void UmlTransition::generate(UmlClass * machine, UmlClass * anystate, UmlState * state, Q3CString & body, Q3CString indent)
{
if (!cppTrigger().isEmpty()) {
UmlCom::trace("Error : transition from a pseudo state can't have trigger<br>");
throw 0;
}
Q3PtrList<UmlTransition> l;
l.append(this);
generate(l, machine, anystate, state, body, indent, FALSE);
}