本文整理汇总了C++中Q3PtrDict::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3PtrDict::insert方法的具体用法?C++ Q3PtrDict::insert怎么用?C++ Q3PtrDict::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3PtrDict
的用法示例。
在下文中一共展示了Q3PtrDict::insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compareItems
int BrowserNodeList::compareItems(Q3PtrCollection::Item item1, Q3PtrCollection::Item item2)
{
QString s1 = ((BrowserNode *) item1)->get_name();
QString s2 = ((BrowserNode *) item2)->get_name();
if (s1 != s2) {
s1 += " ";
s2 += " ";
}
else {
QString * ps1 = SynonymousPath[(BrowserNode *) item1];
QString * ps2 = SynonymousPath[(BrowserNode *) item2];
if (ps1 == 0) {
s1 = ((BrowserNode *) item1)->full_name(TRUE);
ps1 = new QString(s1);
SynonymousPath.insert((BrowserNode *) item1, ps1);
}
else
s1 = *ps1;
if (ps2 == 0) {
s2 = ((BrowserNode *) item2)->full_name(TRUE);
ps2 = new QString(s2);
SynonymousPath.insert((BrowserNode *) item2, ps2);
}
else
s2 = *ps2;
}
return s1.compare(s2);
}
示例2: read_
void UmlBaseCollaborationDiagramDefinition::read_()
{
Q3PtrDict<UmlClassInstanceReference> instances;
unsigned n;
unsigned rank;
n = UmlCom::read_unsigned();
_instances.resize(n);
for (rank = 0; rank != n; rank += 1) {
UmlClassInstanceReference * i = new UmlClassInstanceReference();
_instances.insert(rank, i);
instances.insert((void *) UmlCom::read_unsigned(), i);
i->read_();
}
_instances.setAutoDelete(TRUE);
n = UmlCom::read_unsigned();
_messages.resize(n);
for (rank = 0; rank != n; rank += 1) {
UmlCollaborationMessage * m = new UmlCollaborationMessage();
_messages.insert(rank, m);
m->read_(instances);
}
_messages.setAutoDelete(TRUE);
}
示例3: save_list
void ColMsgTable::save_list(ColMsgList & l, Q3PtrDict<ColMsgList> & saved) {
if (saved.find(&l) == 0) {
saved.insert(&l, new ColMsgList(l));
Q3PtrListIterator<ColMsg> it(l);
for (; it.current(); ++it) {
ColMsg * m = it.current();
save_list(m->get_msgs(), saved);
save_list(m->in->get_msgs(), saved);
}
}
}
示例4: update_relations
void ArtifactCanvas::update_relations() {
// 'this' is a non source, check its associations
const Q3PtrDict<BrowserArtifact> * associated =
((ArtifactData *) browser_node->get_data())->get_associated();
Q3PtrDict<BrowserArtifact> associations;
Q3PtrListIterator<ArrowCanvas> it(lines);
while (it.current()) {
if ((it.current()->type() == UmlContain) &&
(((AssocContainCanvas *) it.current())->get_start() == this)) {
DiagramItem * adi = ((AssocContainCanvas *) it.current())->get_end();
if ((adi->type() == UmlArtifact) &&
(associated != 0) &&
(associated->find((BrowserArtifact *)
((ArtifactCanvas *) adi)->browser_node) != 0)) {
// association must exist
BrowserArtifact * c = (BrowserArtifact *)
((ArtifactCanvas *) adi)->browser_node;
associations.insert(c, c);
++it;
}
else
// association must not exist
it.current()->delete_it();
}
else
++it;
}
if (associated != 0) {
Q3PtrDictIterator<BrowserArtifact> it(*associated);
while (it.current()) {
if (associations.find(it.current()) == 0) {
// the association to 'it.current()' is not yet drawn
// search 'it.current()' cancas
Q3CanvasItemList all = canvas()->allItems();
Q3CanvasItemList::Iterator cit;
for (cit = all.begin(); cit != all.end(); ++cit) {
if ((*cit)->visible()) {
DiagramItem * adi = QCanvasItemToDiagramItem(*cit);
if ((adi != 0) && // an uml canvas item
(adi->type() == UmlArtifact) &&
(((ArtifactCanvas *) adi)->browser_node == it.current())) {
// find
(new AssocContainCanvas(the_canvas(), this, adi, 0, -1.0, -1.0))
->show();
break;
}
}
}
}
++it;
}
}
}