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


C++ QLinkedList::count方法代码示例

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


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

示例1: main

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QLinkedList<QString> linkList;
    linkList.append("Bangaluru");
    linkList.append("Mumbai");
    linkList.append("Delhi");
    linkList.append("Gandhinagara");

    qDebug() << "1-Number of Items =" << linkList.count();

    QLinkedList<QString>::iterator j = qFind(linkList.begin(),linkList.end(),"Varanasi");
    linkList.insert(j,"Bhopal");

    QLinkedList<QString>::iterator i;
    for (i = linkList.begin(); i != linkList.end(); ++i)
         qDebug() << *i << endl;

    qDebug() << "2-Number of Items =" << linkList.count();

    return a.exec();
}
开发者ID:rpolepal,项目名称:practice,代码行数:23,代码来源:main.cpp

示例2: run

void SendDataThread::run()
{
	while(true)
	{
		QMutexLocker locker(&m_DataMutex);
		m_DataCondition.wait(&m_DataMutex);

		int count = m_DataList.count();
		for(int i = 0; i < count; ++i)
		{
			const QByteArray& data = m_DataList.first();
			if(!::sendData(m_Socket, data.data(), data.size()))
			{
				qDebug()<<"Send data to server error";
				return;
			}
			m_DataList.pop_front();
		}
	}
}
开发者ID:dalinhuang,项目名称:networkprogram,代码行数:20,代码来源:commandchannel.cpp

示例3: joinConnectedFeatures

void Layer::joinConnectedFeatures()
{
  // go through all label texts
  int connectedFeaturesId = 0;
  Q_FOREACH ( const QString& labelText, mConnectedTexts )
  {
    if ( !mConnectedHashtable.contains( labelText ) )
      continue; // shouldn't happen

    connectedFeaturesId++;

    QLinkedList<FeaturePart*>* parts = mConnectedHashtable.value( labelText );

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

      FeaturePart* otherPart = _findConnectedPart( partCheck, parts );
      if ( otherPart )
      {
        // remove partCheck from r-tree
        double checkpartBMin[2], checkpartBMax[2];
        partCheck->getBoundingBox( checkpartBMin, checkpartBMax );

        double otherPartBMin[2], otherPartBMax[2];
        otherPart->getBoundingBox( otherPartBMin, otherPartBMax );

        // merge points from partCheck to p->item
        if ( otherPart->mergeWithFeaturePart( partCheck ) )
        {
          // remove the parts we are joining from the index
          mFeatureIndex->Remove( checkpartBMin, checkpartBMax, partCheck );
          mFeatureIndex->Remove( otherPartBMin, otherPartBMax, otherPart );

          // reinsert merged line to r-tree (probably not needed)
          otherPart->getBoundingBox( otherPartBMin, otherPartBMax );
          mFeatureIndex->Insert( otherPartBMin, otherPartBMax, otherPart );

          mConnectedFeaturesIds.insert( partCheck->featureId(), connectedFeaturesId );
          mConnectedFeaturesIds.insert( otherPart->featureId(), connectedFeaturesId );

          mFeatureParts.removeOne( partCheck );
          delete partCheck;
        }
      }
    }

    // we're done processing feature parts with this particular label text
    delete parts;
    mConnectedHashtable.remove( labelText );
  }

  // we're done processing connected features

  //should be empty, but clear to be safe
  qDeleteAll( mConnectedHashtable );
  mConnectedHashtable.clear();

  mConnectedTexts.clear();
}
开发者ID:V17nika,项目名称:QGIS,代码行数:62,代码来源:layer.cpp

示例4: undo

void CmdCreateTransition::undo() {
	QLinkedList<Item*> items = mPetriNet->removeItem(mId);
	Q_ASSERT(items.count() == 1);
	qDeleteAll(items);
}
开发者ID:zettdaymond,项目名称:opulus,代码行数:5,代码来源:cmdcreatetransition.cpp


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