当前位置: 首页>>代码示例>>C++>>正文


C++ QLinkedList类代码示例

本文整理汇总了C++中QLinkedList的典型用法代码示例。如果您正苦于以下问题:C++ QLinkedList类的具体用法?C++ QLinkedList怎么用?C++ QLinkedList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QLinkedList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getMetaNodes

void SeparateNodesExecutor::execute_server()
{

	int count, id;

	*stream >>count;

	Data::Graph* currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
	QMap<qlonglong, osg::ref_ptr<Data::Node> >* nodes = currentGraph -> getMetaNodes();

	QLinkedList<osg::ref_ptr<Data::Node> >* selectedNodes = new QLinkedList<osg::ref_ptr<Data::Node> >();

	for ( int i = 0; i < count; i++ ) {
		*stream >> id;
		if ( nodes->contains( id ) ) {
			selectedNodes->append( *nodes->find( id ) );
		}
	}

	Server* server = Server::getInstance();
	currentGraph->separateNodes( selectedNodes );

	server->sendSeparateNodes( selectedNodes );

	if ( ( ( QOSG::CoreWindow* )server->getCoreWindowReference() )->playing() ) {
		server->getLayoutThread()->play();
	}
	return;

}
开发者ID:kapecp,项目名称:3dsoftviz,代码行数:30,代码来源:SeparateNodesExecutor.cpp

示例2: skip

qint64 SetSrcAction::skip(QLinkedList<Action*> &list, QLinkedList<Action*>::iterator &it)
{
    bool metSD = false;
    qint64 skipCost = cost;
    delete this;
    it = list.erase(it);
    while (it != list.end() && (*it)->type() != ActionType::SetSrc)
        if ((*it)->type() == ActionType::SetDest)
            if (metSD)
            {
                --it;
                skipCost += (*it)->actionCost();
                delete *it;
                it = list.erase(it);
                ++it;
            }
            else
            {
                metSD = true;
                ++it;
            }
        else
        {
            skipCost += (*it)->actionCost();
            delete *it;
            it = list.erase(it);
        }
    return skipCost;
}
开发者ID:Scomip,项目名称:course-fm,代码行数:29,代码来源:setsrcaction.cpp

示例3: main

int main ()
{
    QLinkedList<QString> list;
    list << "A" << "B" << "C" << "D" << "E" << "F";
    assert(list.takeFirst() == "A");
    assert(list.size() == 5);
  return 0;
}
开发者ID:xsery,项目名称:benchmarks-esbmc-qt,代码行数:8,代码来源:main.cpp

示例4:

const QLinkedList< QPair<QVariant,QString> > NfcTarget::getContentList()
{
  QLinkedList< QPair<QVariant,QString> > ll;
  for(int i=0;i<_targetContent.size();i++) {
    ll.append ( QPair<QVariant,QString> ( _targetContent.at(i)->getId(),
      _targetContent.at(i)->getType() ) );
  }
  return ll;
}
开发者ID:glocklueng,项目名称:mfoc,代码行数:9,代码来源:NfcTarget.cpp

示例5:

QLinkedList<QED2KHandle> QED2KSession::getTransfers() const {
    std::vector<libed2k::transfer_handle> handles = m_session->get_transfers();
    QLinkedList<QED2KHandle> transfers;

    for (std::vector<libed2k::transfer_handle>::iterator i = handles.begin();
         i != handles.end(); ++i)
        transfers.push_back(QED2KHandle(*i));

    return transfers;
}
开发者ID:nesterov,项目名称:qDonkey,代码行数:10,代码来源:qed2ksession.cpp

示例6: getActiveTransfers

bool QED2KSession::hasActiveTransfers() const
{
    QLinkedList<QED2KHandle> torrents = getActiveTransfers();
    QLinkedList<QED2KHandle>::iterator torrentIT;
    for (torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
        const QED2KHandle h(*torrentIT);
        if (h.is_valid() && !h.is_seed() && !h.is_paused() )
            return true;
    }
    return false;
}
开发者ID:nesterov,项目名称:qDonkey,代码行数:11,代码来源:qed2ksession.cpp

示例7: getContentListStrings

QStringList NfcTarget::getContentListStrings()
{
  QStringList cl;
  QLinkedList< QPair<QVariant,QString> > ll = this->getContentList();
  QLinkedList< QPair<QVariant,QString> >::iterator it;
  for ( it = ll.begin(); it!= ll.end(); ++it ) {
    cl <<  QString::number ( ( *it ).first.toInt() ) + QString ( ": " )
    + ( *it ).second + QString ( "\n" );
  }
  return cl;
}
开发者ID:glocklueng,项目名称:mfoc,代码行数:11,代码来源:NfcTarget.cpp

示例8: while

void Layer::joinConnectedFeatures()
{
    // go through all label texts
    QString labelText;
    while ( !connectedTexts->isEmpty() )
    {
        labelText = connectedTexts->takeFirst();

        //std::cerr << "JOIN: " << labelText << std::endl;
        QHash< QString, QLinkedList<FeaturePart*>* >::const_iterator partsPtr = connectedHashtable->find( labelText );
        if ( partsPtr == connectedHashtable->constEnd() )
            continue; // shouldn't happen
        QLinkedList<FeaturePart*>* parts = *partsPtr;

        // go one-by-one part, try to merge
        while ( !parts->isEmpty() )
        {
            // part we'll be checking against other in this round
            FeaturePart* partCheck = parts->takeFirst();

            FeaturePart* otherPart = _findConnectedPart( partCheck, parts );
            if ( otherPart )
            {
                //std::cerr << "- connected " << partCheck << " with " << otherPart << std::endl;

                // remove partCheck from r-tree
                double bmin[2], bmax[2];
                partCheck->getBoundingBox( bmin, bmax );
                rtree->Remove( bmin, bmax, partCheck );
                featureParts->removeOne( partCheck );

                otherPart->getBoundingBox( bmin, bmax );

                // merge points from partCheck to p->item
                if ( otherPart->mergeWithFeaturePart( partCheck ) )
                {
                    // reinsert p->item to r-tree (probably not needed)
                    rtree->Remove( bmin, bmax, otherPart );
                    otherPart->getBoundingBox( bmin, bmax );
                    rtree->Insert( bmin, bmax, otherPart );
                }
            }
        }

        // we're done processing feature parts with this particular label text
        delete parts;
    }

    // we're done processing connected fetures
    delete connectedHashtable;
    connectedHashtable = NULL;
    delete connectedTexts;
    connectedTexts = NULL;
}
开发者ID:azaadhamidi,项目名称:QGIS,代码行数:54,代码来源:layer.cpp

示例9: write_grid_occupant_order

void write_grid_occupant_order(World* g, std::ostream& s)
{
    QLinkedList<int> order;
    for (int i = 0; i < g->rows * g->cols; i++)
    {
        Occupant* occ = g->occupant_grid[i];
        while (occ)
        {
            order.push_back(occ->id);
            occ = occ->next;
        }
    }
    s << order;
}
开发者ID:drewbuschhorn,项目名称:floatworld,代码行数:14,代码来源:world.cpp

示例10: process

bool VaApiPostProcessor::process(const VideoFrame &in, QLinkedList<VideoFrame> &queue) {
	if (!d->pipeline)
		return false;
	auto surface = VaApiSurfacePool::getSurface(in.mpi());
	if (!surface)
		return false;
	mp_image *out1 = nullptr, *out2 = nullptr;
	out1 = d->pipeline->render(in, d->setupDeint(in.mpi()->fields, true));
	if (d->deint.doubler && d->deint.method != DeintMethod::None)
		out2 = d->pipeline->render(in, d->setupDeint(in.mpi()->fields, false));
	if (out1)
		queue.push_back(VideoFrame(true, out1, nextPTS(), in.field() & ~VideoFrame::Interlaced));
	if (out2)
		queue.push_back(VideoFrame(true, out2, nextPTS(), in.field() & ~VideoFrame::Interlaced));
	return out1 || out2;
}
开发者ID:akhilo,项目名称:cmplayer,代码行数:16,代码来源:vaapipostprocessor.cpp

示例11: planFlashVerify

/*!
 * Memory ranges used by the bootloader firmware are excluded from the verify list.
 *
 * If the Write Config option is disabled, the FLASH Erase Block containing config
 * words is excluded from the verify list. (only for devices that store config bits in
 * FLASH memory).
 */
void DeviceVerifyPlanner::planFlashVerify(QLinkedList<Device::MemoryRange>& verifyList, int start, int end)
{
    Device::MemoryRange block;

    block.start = start;
    block.end = end;
    verifyList.clear();
    verifyList.append(block);

    if(!writeConfig)
    {
        doNotVerifyConfigPage(verifyList);
    }

    doNotVerifyBootBlock(verifyList);
}
开发者ID:lamotriz,项目名称:motor-esferico,代码行数:23,代码来源:DeviceVerifyPlanner.cpp

示例12: bubbleLine

void MainWindow::bubbleLine()
{
    QLinkedList<QVector3D> ap;

        QVector<QVector3D> mp;

        linebs.setPoint(pt);
        linebs.toleranceFitting(15.0);

        linebs.bubbleCurves(mp);

        for(int k=0; k<mp.size(); k++)
            ap.push_back(mp[k]);

     this->glf->setPoint(ap);
}
开发者ID:linyuanxx,项目名称:splineproject,代码行数:16,代码来源:mainwindow.cpp

示例13: doNotVerifyBootBlock

void DeviceVerifyPlanner::doNotVerifyBootBlock(QLinkedList<Device::MemoryRange>& verifyList)
{
    Device::MemoryRange firstHalf;
    QLinkedList<Device::MemoryRange>::iterator it = verifyList.begin();
    while(it != verifyList.end())
    {
        //     S   E
        // S   |   E
        //     S   |  E
        // S   |   |  E
        //
        //     |   S  E
        // S   E   |
        if(!((it->start <= device->startBootloader && it->end <= device->startBootloader) ||
             (it->start >= device->endBootloader && it->end >= device->endBootloader)))
        {
            // This transaction would verify over bootloader memory, which may fail if
            // we haven't (or can't) read the device out.
            if(it->start == device->startBootloader && it->end == device->endBootloader)
            {
                it = verifyList.erase(it);
                continue;
            }
            if(it->start == device->startBootloader)
            {
                it->start = device->endBootloader;
            }
            else if(it->end == device->endBootloader)
            {
                it->end = device->startBootloader;
            }
            else
            {
                firstHalf.start = device->endBootloader;
                firstHalf.end = it->end;
                it->end = device->startBootloader;
                if(firstHalf.start < firstHalf.end)
                {
                    verifyList.insert(it, firstHalf);
                }
            }
        }
        it++;
    }
}
开发者ID:lamotriz,项目名称:motor-esferico,代码行数:45,代码来源:DeviceVerifyPlanner.cpp

示例14: modifyOrder

void modifyOrder(QLinkedList<BidOrAsk> &queue, BidOrAsk &bidOrAsk) {
    auto r = std::find(queue.begin(), queue.end(), bidOrAsk);
    if (r != queue.end()) {
        BidOrAsk original = *r;
        Q_ASSERT (original.id() == bidOrAsk.id());

        if (original.price() != bidOrAsk.price() ||
                original.volume() > bidOrAsk.volume()) {

            // remove and re-add to loose position
            queue.erase(r);

            original.setPrice(bidOrAsk.price());
            original.setVolume(bidOrAsk.volume());

            // since this simulation happens long past,
            // we can't use the current time.
            original.setTime(bidOrAsk.time());
            original.setDate(bidOrAsk.date());

            queue.insert(std::lower_bound(queue.begin(),
                                          queue.end(),
                                          bidOrAsk),
                          bidOrAsk);
        } else {
            // if only the volume has decreased, it
            // doesn't loose its position.
            original.setVolume(bidOrAsk.volume());
        }
    }
}
开发者ID:shocklateboy92,项目名称:se3011,代码行数:31,代码来源:trading-engine.cpp

示例15: ordinaryLine

void MainWindow::ordinaryLine()
{
    QLinkedList<QVector3D> ap;
//    qDebug()<<"contour.size:"<<contour.size();
//    for(int i=0; i<contour.size(); i++)
//    {
        QVector<QVector3D> mp;
       // qDebug()<<"contour size: "<<i<<contour[i].size();
        linebs.setPoint(pt);
        linebs.toleranceFitting(15.0);
        qDebug()<<"contour size: "<<contour.size();
        linebs.ordinaryCurves(mp);
        qDebug()<<"contour size: "<<mp.size();
        for(int k=0; k<mp.size(); k++)
            ap.push_back(mp[k]);
    //}
     this->glf->setPoint(ap);
}
开发者ID:linyuanxx,项目名称:splineproject,代码行数:18,代码来源:mainwindow.cpp


注:本文中的QLinkedList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。