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


C++ QVector::end方法代码示例

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


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

示例1: isRight

bool QgsTriangle::isRight( double angleTolerance ) const
{
  QVector<double> a = angles();
  QVector<double>::iterator ita = a.begin();
  while ( ita != a.end() )
  {
    if ( qgsDoubleNear( *ita, M_PI_2, angleTolerance ) )
      return true;
    ita++;
  }
  return false;
}
开发者ID:GeoCat,项目名称:QGIS,代码行数:12,代码来源:qgstriangle.cpp

示例2: populateUserSelector

void EditFood::populateUserSelector(QComboBox* cboOwner)
{
  // TODO: Maybe only load all users for administrator?

  QVector<QSharedPointer<User> > allUsers = User::getAllUsers();

  for (QVector<QSharedPointer<User> >::const_iterator i = allUsers.begin();
       i != allUsers.end(); ++i)
  {
    cboOwner->addItem((*i)->getDisplayName(), (*i)->getId());
  }
}
开发者ID:tylermchenry,项目名称:nutrition_tracker,代码行数:12,代码来源:edit_food.cpp

示例3: symbolPairIntensity

QVector<symbolPair> patternDockWidget::
sortHashByIntensity(const QHash<QRgb, QPixmap>& hash) const {

  QVector<symbolPair> returnVector;
  returnVector.reserve(hash.size());
  for (QHash<QRgb, QPixmap>::const_iterator it = hash.begin(),
         end = hash.end(); it != end; ++it) {
    returnVector.push_back(symbolPair(it.key(), it.value()));
  }
  std::sort(returnVector.begin(), returnVector.end(), symbolPairIntensity());
  return returnVector;
}
开发者ID:angelagabereau,项目名称:Cstitch,代码行数:12,代码来源:patternDockWidget.cpp

示例4: Export

bool AGEExporter::Export(QByteArray& out)
{
    QVector<Symbol> list = symbols();
    qSort(list.begin(), list.end(), sortSymbols);

    unsigned charsCount = list.size();
    unsigned maxHeight = 0;

    foreach(const Symbol& c, list)
    {
        maxHeight = std::max<float>(maxHeight, c.placeH);
    }
开发者ID:andreyugolnik,项目名称:fontbuilder,代码行数:12,代码来源:ageexporter.cpp

示例5: beginPaint

void QFbBackingStore::beginPaint(const QRegion &region)
{
    lock();

    if (mImage.hasAlphaChannel()) {
        QPainter p(&mImage);
        p.setCompositionMode(QPainter::CompositionMode_Source);
        const QVector<QRect> rects = region.rects();
        for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it)
            p.fillRect(*it, Qt::transparent);
    }
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:12,代码来源:qfbbackingstore.cpp

示例6: filesForPiece

QStringList TorrentInfo::filesForPiece(int pieceIndex) const
{
    // no checks here because fileIndicesForPiece() will return an empty list
    QVector<int> fileIndices = fileIndicesForPiece(pieceIndex);

    QStringList res;
    res.reserve(fileIndices.size());
    std::transform(fileIndices.begin(), fileIndices.end(), std::back_inserter(res),
        [this](int i) { return filePath(i); });

    return res;
}
开发者ID:einsteinsfool,项目名称:qBittorrent,代码行数:12,代码来源:torrentinfo.cpp

示例7: on_all_search_but_clicked

void log_display::on_all_search_but_clicked()
{
    QVector<QString> logs;
    logs.clear();
    select_log_all(logs);
    QString Text="";
    for(QVector <QString>  :: iterator it = logs.end() - 1; it != logs.begin() - 1; --it)
    {
        Text+=(*it);
        Text+="\n";
    }
    ui -> log_text -> setText(Text);}
开发者ID:lwher,项目名称:Library-world,代码行数:12,代码来源:log_display.cpp

示例8: schedule_processess

void fcfs::schedule_processess(QLinkedList<process> &timeline){
    int i;
    QVector<process> processes = list;
    //Arrange processes according to arrival time
    qSort(processes.begin(), processes.end(), less_than_arrival_time_based);
    for (i = 0; i < number_of_processes; i++){
        process current_process = processes.at(i);
        if (current_process.get_burst_time() != 0){
            timeline.append(current_process);
        }
    }
}
开发者ID:ali-mohamed,项目名称:scheduler-simulator,代码行数:12,代码来源:fcfs.cpp

示例9: fillAvailableFieldList

void SortDialog::fillAvailableFieldList(
    const QVector<FieldDescriptionPtr>& availableFields)
{ 
  typedef QVector<FieldDescriptionPtr>::const_iterator iterator;
  ui_.availableFieldList->clear();
  availableFields_.clear();
  for (iterator i = availableFields.begin(), end = availableFields.end(); 
      i != end; ++i)
  {        
    addAvailableField(*i);
  }      
}
开发者ID:mabrarov,项目名称:chrono,代码行数:12,代码来源:sortdialog.cpp

示例10: GetFreeGroupId

int LJProfile::GetFreeGroupId () const
{
    QVector<int> baseVector (30);
    int current = 0;
    std::generate (baseVector.begin (), baseVector.end (),
    [&current] () {
        return ++current;
    });

    QVector<int> existingIds;
    for (const auto& group : ProfileData_.FriendGroups_)
        existingIds.append (group.Id_);

    std::sort (existingIds.begin (), existingIds.end ());
    QVector<int> result;
    std::set_difference (baseVector.begin (), baseVector.end (),
                         existingIds.begin (), existingIds.end (),
                         std::back_inserter (result));

    return result.value (0, -1);
}
开发者ID:,项目名称:,代码行数:21,代码来源:

示例11: RDFVariableLink

	RDFStatementList *RDFGraphBasic::recurseRemoveResources
			(RDFStatementList *removed_statements, RDFVariable const &res
			, QLinkedList<RDFVariable> *post_removes)
	{
		QVector<RDFProperty> const dp = res.derivedProperties();
		for(QVector<RDFProperty>::const_iterator cdpi = dp.begin(), cdpiend = dp.end()
				; cdpi != cdpiend; ++cdpi)
		{
			RDFStrategyFlags str = cdpi->strategy();
			if(!(str & (RDFStrategy::Owns | RDFStrategy::Shares)))
				continue;

			RDFVariable derived =
					( (str & RDFStrategy::NonOptionalValued) || !(str & RDFStrategy::Owns)
							? RDFVariableLink(res) : RDFVariableLink(res).optional())
					.property(cdpi->deepCopy());
			if(str & RDFStrategy::Owns)
			{
				if(str & RDFStrategy::NonMultipleValued)
					recurseRemoveResources(removed_statements, derived, post_removes);
				else
				{
					RDFStatementList derived_removes;
					executeQuery(RDFUpdate(service_context_data_->update())
							.addDeletion(*recurseRemoveResources
									(&derived_removes, derived, post_removes)));
					;
				}
			} else
			if(str & RDFStrategy::Shares)
			{
				// Expensive, but can't really be avoided unless backend supports sophisticated
				// conditional cascading delete.
				// This is because either we need to create a horribly convoluted query for
				// checking whether a shared object being deleted is shared by a resource that is
				// _not_ getting deleted, or then we get the list of shared resources for which
				// a sharer was destroyed, and then requery if all they no longer have sharers
				// after that.
				LiveNodes actual_deriveds = modelVariables(RDFVariableList() << derived);
				if(actual_deriveds->rowCount())
				{
					RDFVariable var = RDFVariable::fromContainer(actual_deriveds);
					var.setDerivedProperties(derived.derivedProperties());
					// TODO: huh.. we should have a reverseProperty here
					var.optional().subject(cdpi->deepCopy()).doesntExist();
					post_removes->push_back(var);
				}
			}
		}
		addRemoveResourceClause(removed_statements, res);
		return removed_statements;
	}
开发者ID:dudochkin-victor,项目名称:libqttracker,代码行数:52,代码来源:rdfservice_p.cpp

示例12: drawPolyColor

void cube::drawPolyColor(Polygon & poly, QColor& color)
{
    QPen pen;
    pen.setColor(color);
    pen.setStyle(Qt::SolidLine);
    m_cubePainter->setPen(pen);
    ScreenPolygonCoordsStruct tmpSCoords = poly.getScreenCords();
    QVector <QPoint> pointArr;
    pointArr.clear();
    pointArr.append(tmpSCoords.v0);
    pointArr.append(tmpSCoords.v1);
    pointArr.append(tmpSCoords.v2);

    qSort(pointArr.begin(),pointArr.end(),pointCompare);
    QPoint A = pointArr[0];
    QPoint B = pointArr[1];
    QPoint C = pointArr[2];


    int sy = A.y();
    int x1,x2;
    for (sy = A.y(); sy >= C.y(); sy--) {
        if (A.y() == C.y())
        {
            x1 = A.x();
        }
        else
        {
            x1 = (int)(A.x() + (sy - A.y()) * (C.x() - A.x()) / (C.y() - A.y()));
        }
        if (sy > B.y())
            if (A.y() == B.y())
            {
                x2 = A.x();
            }
        else
            {
                x2 = (int)(A.x() + (sy - A.y()) * (B.x() - A.x()) / (B.y() - A.y()));
            }
      else {
            if (C.y() == B.y())
            {
                x2 = B.x();
            }
        else
            {
                x2 = (int)(B.x() + (sy - B.y()) * (C.x() - B.x()) / (C.y() - B.y()));
            }
      }
        m_cubePainter->drawLine(x1,sy,x2,sy);
    }
}
开发者ID:heroboec,项目名称:cube2,代码行数:52,代码来源:cube.cpp

示例13: filterCredTokens

static QStringList filterCredTokens(QVector<Maemo::Timed::cred_modifier_io_t> &cred_modifiers, bool accrue)
{
  QStringList ret ;
  QVector<Maemo::Timed::cred_modifier_io_t>::const_iterator it ;
  for(it = cred_modifiers.begin() ; it != cred_modifiers.end() ; ++it)
  {
    if(accrue == it->accrue)
    {
      ret << it->token ;
    }
  }
  return ret;
}
开发者ID:deztructor,项目名称:timed,代码行数:13,代码来源:event-pimple.cpp

示例14: selectPoint

 void selectPoint(const QPointF &point)
 {
     int rate = 5;
     QRectF rect(point - QPointF(rate/2, rate/2) , QSizeF(rate, rate));
     
     QVector<QPointF>::const_iterator it;
     for (it = points.begin(); it != points.end(); ++it) {
          if (rect.contains(*it)) {
              currentIndex = points.indexOf(*it);
              break;
          }
     }
 }
开发者ID:hpsaturn,项目名称:tupi,代码行数:13,代码来源:tupgradientviewer.cpp

示例15: getNoteTagNames

bool QvernoteStorage::getNoteTagNames(vector<string>& tagNames, Guid noteGuid)
{
	QVector<Tag> qTagList;

	QTag::loadForNote(getDB(), noteGuid, qTagList);

	for(QVector<Tag>::iterator i = qTagList.begin(); i != qTagList.end(); i++)
	{
		tagNames.push_back((*i).name);
	}

	return true;
}
开发者ID:cas--,项目名称:Qvernote,代码行数:13,代码来源:QvernoteStorage.cpp


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