本文整理汇总了C++中QPtrList::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ QPtrList::contains方法的具体用法?C++ QPtrList::contains怎么用?C++ QPtrList::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPtrList
的用法示例。
在下文中一共展示了QPtrList::contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addBlockNeighbour
void BlockGraph::addBlockNeighbour(PinNode *source, PinNode *target,
QPtrList<PinNode> &seen)
{
if (INSTANCEOF(target->parent()->model(), MuxModel)) {
// iterate through output pins
QPtrList<PinNode> neighbours = target->neighbours();
for (QPtrListIterator<PinNode> it(neighbours); it != 0;
++it) {
Q_ASSERT(target->parent() == (*it)->parent());
if (!seen.contains(*it)) {
seen.append(*it);
QPtrList<PinNode> neighbours2 = (*it)->neighbours();
for (QPtrListIterator<PinNode> it2(neighbours2); it2 != 0;
++it2) {
addBlockNeighbour(source, *it2, seen);
}
}
}
}
else {
// qDebug(QString("added connection %1 -> %2")
// .arg(source->parent()->model()->name())
// .arg(target->parent()->model()->name()));
source->parent()->addNeighbour(target->parent());
}
}
示例2: it
//-----------------------------------------------------------------------------
QPtrList<KMMessagePart> BodyVisitor::partsToLoad()
{
QPtrListIterator<KMMessagePart> it( mParts );
QPtrList<KMMessagePart> selected;
KMMessagePart *part = 0;
bool headerCheck = false;
while ( (part = it.current()) != 0 )
{
++it;
// skip this part if the parent part is already loading
if ( part->parent() &&
selected.contains( part->parent() ) &&
part->loadPart() )
continue;
if ( part->originalContentTypeStr().contains("SIGNED") )
{
// signed messages have to be loaded completely
// so construct a new dummy part that loads the body
KMMessagePart *fake = new KMMessagePart();
fake->setPartSpecifier( "TEXT" );
fake->setOriginalContentTypeStr("");
fake->setLoadPart( true );
selected.append( fake );
break;
}
if ( headerCheck && !part->partSpecifier().endsWith(".HEADER") )
{
// this is an embedded simple message (not multipart) so we get no header part
// from imap. As we probably need to load the header (e.g. in smart or inline mode)
// we add a fake part that is not included in the message itself
KMMessagePart *fake = new KMMessagePart();
QString partId = part->partSpecifier().section( '.', 0, -2 )+".HEADER";
fake->setPartSpecifier( partId );
fake->setOriginalContentTypeStr("");
fake->setLoadPart( true );
if ( addPartToList( fake ) )
selected.append( fake );
}
if ( part->originalContentTypeStr() == "MESSAGE/RFC822" )
headerCheck = true;
else
headerCheck = false;
// check whether to load this part or not:
// look at the basic list, ask the subclass and check the parent
if ( mBasicList.contains( part->originalContentTypeStr() ) ||
parentNeedsLoading( part ) ||
addPartToList( part ) )
{
if ( part->typeStr() != "MULTIPART" ||
part->partSpecifier().endsWith(".HEADER") )
{
// load the part itself
part->setLoadPart( true );
}
}
if ( !part->partSpecifier().endsWith(".HEADER") &&
part->typeStr() != "MULTIPART" )
part->setLoadHeaders( true ); // load MIME header
if ( part->loadHeaders() || part->loadPart() )
selected.append( part );
}
return selected;
}