本文整理汇总了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;
}
示例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());
}
}
示例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;
}
示例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);
}
示例5: beginPaint
void QFbBackingStore::beginPaint(const QRegion ®ion)
{
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);
}
}
示例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;
}
示例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);}
示例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);
}
}
}
示例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);
}
}
示例10: GetFreeGroupId
int LJProfile::GetFreeGroupId () const
{
QVector<int> baseVector (30);
int current = 0;
std::generate (baseVector.begin (), baseVector.end (),
[¤t] () {
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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
}
}
示例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;
}