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


C++ QList::cend方法代码示例

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


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

示例1: loadAudioDevices

void DevSetup::loadAudioDevices (AudioDevices const& d, QComboBox * cb, QAudioDeviceInfo const& device, QAudioDeviceInfo const& defaultDevice)
{
  using std::copy;
  using std::back_inserter;

  int currentIndex = -1;
  int defaultIndex = 0;
  for (AudioDevices::const_iterator p = d.cbegin (); p != d.cend (); ++p)
    {
      // convert supported channel counts into something we can store in the item model
      QList<QVariant> channelCounts;
      QList<int> scc (p->supportedChannelCounts ());
      copy (scc.cbegin (), scc.cend (), back_inserter (channelCounts));

      cb->addItem (p->deviceName (), channelCounts);
      if (*p == device)
	{
	  currentIndex = p - d.cbegin ();
	}
      else if (*p == defaultDevice)
	{
	  defaultIndex = p - d.cbegin ();
	}
    }
  cb->setCurrentIndex (currentIndex != -1 ? currentIndex : defaultIndex);
}
开发者ID:BackupTheBerlios,项目名称:wsjt-svn,代码行数:26,代码来源:devsetup.cpp

示例2: sources

OsmAnd::RoutePlannerContext::RoutePlannerContext(
    const QList< std::shared_ptr<ObfReader> >& sources,
    const std::shared_ptr<RoutingConfiguration>& routingConfig,
    const QString& vehicle,
    bool useBasemap,
    float initialHeading /*= std::numeric_limits<float>::quiet_NaN()*/,
    QHash<QString, QString>* options /*=nullptr*/,
    size_t memoryLimit  )
    : _useBasemap(useBasemap)
    , _memoryUsageLimit(memoryLimit)
    , _loadedTiles(0)
    , _initialHeading(initialHeading)
    , sources(sources)
    , configuration(routingConfig)
    , _routeStatistics(new RouteStatistics)
    , profileContext(new RoutingProfileContext(configuration->routingProfiles[vehicle], options))
{
    _partialRecalculationDistanceLimit = Utilities::parseArbitraryFloat(configuration->resolveAttribute(vehicle, "recalculateDistanceHelp"), 10000.0f);
    _heuristicCoefficient = Utilities::parseArbitraryFloat(configuration->resolveAttribute(vehicle, "heuristicCoefficient"), 1.0f);
    _planRoadDirection = Utilities::parseArbitraryInt(configuration->resolveAttribute(vehicle, "planRoadDirection"), 0);
    _roadTilesLoadingZoomLevel = Utilities::parseArbitraryUInt(configuration->resolveAttribute(vehicle, "zoomToLoadTiles"), DefaultRoadTilesLoadingZoomLevel);

    for(auto itSource = sources.cbegin(); itSource != sources.cend(); ++itSource)
    {
        const auto& source = *itSource;

        const auto& obfInfo = source->obtainInfo();
        for(auto itRoutingSection = obfInfo->routingSections.cbegin(); itRoutingSection != obfInfo->routingSections.cend(); ++itRoutingSection)
            _sourcesLUT.insert((*itRoutingSection).get(), source);
    }
}
开发者ID:Congle,项目名称:OsmAnd-core,代码行数:31,代码来源:RoutePlannerContext.cpp

示例3: fileDump

bool Library::fileDump(QChar key, QList<QString> &keysList, QFlags<QIODevice::OpenModeFlag> openFlags) {
    QString path, val;
    QList<QString>::const_iterator cat_i = keysList.cbegin();
    QHash<QString, int> * res = catalogs -> value(key);

    path = libraryPath() + "cat_" + key;
    qDebug() << "SSave list "<< keysList;

    QFile f(path);
    if (f.open(openFlags)) {
        QTextStream out(&f);
        out.setCodec("UTF-8");

        while(cat_i != keysList.cend()) {
            val = *cat_i;
            qDebug() << "Curr val " << val;
            out << QString::number(res -> value(val)) << val.toUtf8() << "\n";
            cat_i++;
        }

        f.close();

        return true;
    }

    return false;
}
开发者ID:jeyboy,项目名称:palyo2,代码行数:27,代码来源:library.cpp

示例4: psInitSize

void PsMainWindow::psInitSize() {
	setMinimumWidth(st::wndMinWidth);
	setMinimumHeight(st::wndMinHeight);

	TWindowPos pos(cWindowPos());
	QRect avail(QDesktopWidget().availableGeometry());
	bool maximized = false;
	QRect geom(avail.x() + (avail.width() - st::wndDefWidth) / 2, avail.y() + (avail.height() - st::wndDefHeight) / 2, st::wndDefWidth, st::wndDefHeight);
	if (pos.w && pos.h) {
		QList<QScreen*> screens = App::app()->screens();
		for (QList<QScreen*>::const_iterator i = screens.cbegin(), e = screens.cend(); i != e; ++i) {
			QByteArray name = (*i)->name().toUtf8();
			if (pos.moncrc == hashCrc32(name.constData(), name.size())) {
				QRect screen((*i)->geometry());
				int32 w = screen.width(), h = screen.height();
				if (w >= st::wndMinWidth && h >= st::wndMinHeight) {
					if (pos.w > w) pos.w = w;
					if (pos.h > h) pos.h = h;
					pos.x += screen.x();
					pos.y += screen.y();
					if (pos.x < screen.x() + screen.width() - 10 && pos.y < screen.y() + screen.height() - 10) {
						geom = QRect(pos.x, pos.y, pos.w, pos.h);
					}
				}
				break;
			}
		}

		if (pos.y < 0) pos.y = 0;
		maximized = pos.maximized;
	}
	setGeometry(geom);
}
开发者ID:0ps,项目名称:telegram,代码行数:33,代码来源:pspecific_mac.cpp

示例5: setData

void AWDataAggregator::setData(const QString &source, float value,
                               const float extremum)
{
    qCDebug(LOG_AW) << "Source" << source << "to value" << value
                    << "with extremum" << extremum;

    if (data[source].count() == 0)
        data[source].append(0.0);
    else if (data[source].count()
             > configuration[QString("tooltipNumber")].toInt())
        data[source].removeFirst();
    if (isnan(value))
        value = 0.0;

    // notifications
    checkValue(source, value, extremum);

    data[source].append(value);
    if (source == QString("downTooltip")) {
        QList<float> netValues
            = data[QString("downTooltip")] + data[QString("upTooltip")];
        boundaries[QString("downTooltip")]
            = 1.2 * *std::max_element(netValues.cbegin(), netValues.cend());
        boundaries[QString("upTooltip")] = boundaries[QString("downTooltip")];
    }
}
开发者ID:wlemuel,项目名称:awesome-widgets,代码行数:26,代码来源:awdataaggregator.cpp

示例6: addToCartOutbound

void MainWindow::addToCartOutbound()
{
    QModelIndexList selection = ui->tvOutboundFlights->selectionModel()->selectedRows();
    if (selection.count() != 1)
    {
        return;
    }

    QJsonObject selectedFlight = mOutboundFlights->jsonData(selection.first());

    QString airlineName = selectedFlight["name"].toString();
    QList<QJsonObject> inbound = mInboundFlights->jsonData();
    QList<QJsonObject> inboundCleaned;
    for (QList<QJsonObject>::const_iterator it = inbound.cbegin(); it != inbound.cend(); ++it)
    {
        if (it->value("name") == airlineName)
        {
            inboundCleaned.append(*it);
        }
    }
    mInboundFlights->setData(inboundCleaned);

    mUser.addToCart(selectedFlight);
    updateShoppingCart();
}
开发者ID:RamyElkest,项目名称:cb-workshop-cpp,代码行数:25,代码来源:mainwindow.cpp

示例7: addGroupFilter

        void addGroupFilter(const std::shared_ptr<MapStyleRule>& rule)
        {
            for(auto itChild = children.cbegin(); itChild != children.cend(); ++itChild)
            {
                auto child = *itChild;

                child->_d->_ifChildren.push_back(rule);
            }

            for(auto itSubgroup = subgroups.cbegin(); itSubgroup != subgroups.cend(); ++itSubgroup)
            {
                auto subgroup = *itSubgroup;

                assert(subgroup->type == Lexeme::Group);
                std::static_pointer_cast<Group>(subgroup)->addGroupFilter(rule);
            }
        }
开发者ID:Congle,项目名称:OsmAnd-core,代码行数:17,代码来源:MapStyle_P.cpp

示例8: printDifference

void printDifference(const LogOutput &actual, const LogOutput &expected)
{
    QTextStream out(stderr);

    const QList<QByteArray> actualLines = actual.text.split('\n');
    const QList<QByteArray> expectedLines = expected.text.split('\n');

    out << "-- ACTUAL:\n";
    printRawLines(out, actualLines);
    out << "-- EXPECTED:\n";
    printRawLines(out, expectedLines);

    if (actualLines.size() != expectedLines.size()) {
        out << "-- DIFFERENCE IN LINE COUNT:\n"
            << "    actual lines:" << actualLines.size() << '\n'
            << "  expected lines:" << expectedLines.size() << '\n';
    }

    out << "-- FIRST LINE THAT DIFFERS:\n";
    auto actualLineIt = actualLines.cbegin();
    auto expectedLineIt = expectedLines.cbegin();
    int line = 1;
    forever {
        if (actualLineIt == actualLines.cend() && expectedLineIt != expectedLines.cend()) {
            out << "      line: " << line << '\n';
            out << "    actual: <none>\n";
            out << "  expected: \"" << *expectedLineIt << "\"\n";
        } else if (actualLineIt != actualLines.cend() && expectedLineIt == expectedLines.cend()) {
            out << "      line: " << line << '\n';
            out << "    actual: \"" << *actualLineIt << "\"\n";
            out << "  expected: <none>\n";
        } else {
            if (*actualLineIt != *expectedLineIt) {
                out << "      line: " << line << '\n';
                out << "    actual: \"" << *actualLineIt << "\"\n";
                out << "  expected: \"" << *expectedLineIt << "\"\n";
                return;
            }
        }

        ++line;
        ++actualLineIt;
        ++expectedLineIt;
    }
}
开发者ID:NamiStudio,项目名称:qt-creator,代码行数:45,代码来源:clangcodecompletion_test.cpp

示例9: switch

void OsmAnd::ObfPoiSectionReader_P::readAmenities(
    const std::unique_ptr<ObfReader_P>& reader, const std::shared_ptr<const ObfPoiSectionInfo>& section,
    QSet<uint32_t>* desiredCategories,
    QList< std::shared_ptr<const Model::Amenity> >* amenitiesOut,
    const ZoomLevel& zoom, uint32_t zoomDepth, const AreaI* bbox31,
    std::function<bool (const std::shared_ptr<const Model::Amenity>&)> visitor,
    IQueryController* controller)
{
    auto cis = reader->_codedInputStream.get();
    QList< std::shared_ptr<Tile> > tiles;
    for(;;)
    {
        auto tag = cis->ReadTag();
        switch(gpb::internal::WireFormatLite::GetTagFieldNumber(tag))
        {
        case 0:
            return;
        case OBF::OsmAndPoiIndex::kBoxesFieldNumber:
            {
                auto length = ObfReaderUtilities::readBigEndianInt(cis);
                auto oldLimit = cis->PushLimit(length);
                readTile(reader, section, tiles, nullptr, desiredCategories, zoom, zoomDepth, bbox31, controller, nullptr);
                cis->PopLimit(oldLimit);
                if(controller && controller->isAborted())
                    return;
            }
            break;
        case OBF::OsmAndPoiIndex::kPoiDataFieldNumber:
            {
                // Sort tiles byte data offset, to all cache-friendly with I/O system
                qSort(tiles.begin(), tiles.end(), [](const std::shared_ptr<Tile>& l, const std::shared_ptr<Tile>& r) -> bool
                {
                    return l->_hash < r->_hash;
                });

                for(auto itTile = tiles.cbegin(); itTile != tiles.cend(); ++itTile)
                {
                    const auto& tile = *itTile;

                    cis->Seek(section->_offset + tile->_offset);
                    auto length = ObfReaderUtilities::readBigEndianInt(cis);
                    auto oldLimit = cis->PushLimit(length);
                    readAmenitiesFromTile(reader, section, tile.get(), desiredCategories, amenitiesOut, zoom, zoomDepth, bbox31, visitor, controller, nullptr);
                    cis->PopLimit(oldLimit);
                    if(controller && controller->isAborted())
                        return;
                }
                cis->Skip(cis->BytesUntilLimit());
            }
            return;
        default:
            ObfReaderUtilities::skipUnknownField(cis, tag);
            break;
        }
    }
}
开发者ID:668hkjz,项目名称:OsmAnd-core,代码行数:56,代码来源:ObfPoiSectionReader_P.cpp

示例10: writeFrames

/*!
    \internal
 */
qint64 QWebSocketPrivate::writeFrames(const QList<QByteArray> &frames)
{
    qint64 written = 0;
    if (Q_LIKELY(m_pSocket)) {
        QList<QByteArray>::const_iterator it;
        for (it = frames.cbegin(); it < frames.cend(); ++it)
            written += writeFrame(*it);
    }
    return written;
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:13,代码来源:qwebsocket_p.cpp

示例11: registerGlobalRules

        bool registerGlobalRules(const MapStyleRulesetType type)
        {
            for(auto itChild = children.cbegin(); itChild != children.cend(); ++itChild)
            {
                auto child = *itChild;

                if(!style->registerRule(type, child))
                    return false;
            }

            for(auto itSubgroup = subgroups.cbegin(); itSubgroup != subgroups.cend(); ++itSubgroup)
            {
                auto subgroup = *itSubgroup;

                assert(subgroup->type == Lexeme::Group);
                if(!std::static_pointer_cast<Group>(subgroup)->registerGlobalRules(type))
                    return false;
            }

            return true;
        }
开发者ID:Congle,项目名称:OsmAnd-core,代码行数:21,代码来源:MapStyle_P.cpp

示例12: printPOIDetailInfo

void printPOIDetailInfo(std::ostream& output, const OsmAnd::Inspector::Configuration& cfg, const std::shared_ptr<OsmAnd::ObfReader>& reader, const std::shared_ptr<const OsmAnd::ObfPoiSectionInfo>& section)
#endif
{
    output << xT("\tBounds ") << formatBounds(section->area31.left, section->area31.right, section->area31.top, section->area31.bottom) << std::endl;
    QList< std::shared_ptr<const OsmAnd::Model::AmenityCategory> > categories;
    OsmAnd::ObfPoiSectionReader::loadCategories(reader, section, categories);
    output << xT("\tCategories:") << std::endl;
    for(auto itCategory = categories.cbegin(); itCategory != categories.cend(); ++itCategory)
    {
        auto category = *itCategory;
        output << xT("\t\t") << QStringToStlString(category->name) << std::endl;
        for(auto itSubcategory = category->subcategories.cbegin(); itSubcategory != category->subcategories.cend(); ++itSubcategory)
            output << xT("\t\t\t") << QStringToStlString(*itSubcategory) << std::endl;
    }

    QList< std::shared_ptr<const OsmAnd::Model::Amenity> > amenities;
    OsmAnd::AreaI bbox31;
    bbox31.top = OsmAnd::Utilities::get31TileNumberY(cfg.bbox.top);
    bbox31.bottom = OsmAnd::Utilities::get31TileNumberY(cfg.bbox.bottom);
    bbox31.left = OsmAnd::Utilities::get31TileNumberX(cfg.bbox.left);
    bbox31.right = OsmAnd::Utilities::get31TileNumberX(cfg.bbox.right);
    OsmAnd::ObfPoiSectionReader::loadAmenities(reader, section, cfg.zoom, 3, &bbox31, nullptr, &amenities);
    output << xT("\tAmenities, ") << amenities.count() << xT(" item(s)");
    if(!cfg.verboseAmenities)
    {
        output << std::endl;
        return;
    }
    output << ":" << std::endl;;
    for(auto itAmenity = amenities.cbegin(); itAmenity != amenities.cend(); ++itAmenity)
    {
        auto amenity = *itAmenity;

        output << xT("\t\t") <<
            QStringToStlString(amenity->latinName) << xT(" [") << amenity->id << xT("], ") <<
            QStringToStlString(categories[amenity->categoryId]->name) << xT(":") << QStringToStlString(categories[amenity->categoryId]->subcategories[amenity->subcategoryId]) <<
            xT(", lat ") << OsmAnd::Utilities::get31LatitudeY(amenity->point31.y) << xT(" lon ") << OsmAnd::Utilities::get31LongitudeX(amenity->point31.x) << std::endl;
    }
}
开发者ID:kendzi,项目名称:OsmAnd-core,代码行数:39,代码来源:Inspector.cpp

示例13: createArenaCards

void WebUploader::createArenaCards(QList<DeckCard> &deckCardList)
{
    for (QList<DeckCard>::const_iterator it = deckCardList.cbegin(); it != deckCardList.cend(); it++)
    {
        if(it->total > 0)
        {
            QString name = (*cardsJson)[it->code].value("name").toString();
            arenaCards.append(QString::number(it->total) + " " + name + "\n");
        }
    }

    qDebug() << "WebUploader: Building Deck string: "<< endl << arenaCards;
}
开发者ID:ottodevs,项目名称:Arena-Tracker,代码行数:13,代码来源:webuploader.cpp

示例14: EnregistrerPred

void AjoutPrecedence::EnregistrerPred(){
    //attribut modele à la classe ajoutPrecedence
    QMap<QString, Tache*> pred;
    for(int nb=0; nb<modele.rowCount(); nb++){
        QList<QString>* liste = new QList<QString>;
        testChecked(modele.item(nb), liste);

        for(QList<QString>::const_iterator i = liste->cbegin(); i< liste->cend(); i++){
            Projet* p =ProjetManager::getInstance().trouverProjet(modele.item(nb)->text());
            Tache* t= p->trouverTache(*i);
            pred.insert(t->getId(), t);
        }
    }
    EditeurTache::predecesseurs=pred;
    close();
}
开发者ID:TheoJD,项目名称:ApplicationGestionDeProjets,代码行数:16,代码来源:menutache.cpp

示例15: requestPeers

void ApiWrap::requestPeers(const QList<PeerData*> &peers) {
	QVector<MTPint> chats;
	QVector<MTPInputUser> users;
	chats.reserve(peers.size());
	users.reserve(peers.size());
	for (QList<PeerData*>::const_iterator i = peers.cbegin(), e = peers.cend(); i != e; ++i) {
		if (!*i || _fullPeerRequests.contains(*i) || _peerRequests.contains(*i)) continue;
		if ((*i)->chat) {
			chats.push_back(MTP_int(App::chatFromPeer((*i)->id)));
		} else {
			users.push_back((*i)->asUser()->inputUser);
		}
	}
	if (!chats.isEmpty()) MTP::send(MTPmessages_GetChats(MTP_vector<MTPint>(chats)), rpcDone(&ApiWrap::gotChats));
	if (!users.isEmpty()) MTP::send(MTPusers_GetUsers(MTP_vector<MTPInputUser>(users)), rpcDone(&ApiWrap::gotUsers));
}
开发者ID:noikiy,项目名称:tdesktop,代码行数:16,代码来源:apiwrap.cpp


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