本文整理汇总了C++中QStringList::cbegin方法的典型用法代码示例。如果您正苦于以下问题:C++ QStringList::cbegin方法的具体用法?C++ QStringList::cbegin怎么用?C++ QStringList::cbegin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStringList
的用法示例。
在下文中一共展示了QStringList::cbegin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void MapleManager::init()
{
//Load script extensions
const QStringList availableExtensions = m_engine->availableExtensions();
//Load "Qt" extensions first
for(auto it = availableExtensions.cbegin(); it!= availableExtensions.cend(); ++it)
{
if((*it).startsWith("qt",Qt::CaseInsensitive))
{
QScriptValue imported = m_engine->importExtension(*it);
if(imported.isUndefined())
{
if(m_engine->hasUncaughtException())
qDebug() << m_engine->uncaughtException().toString();
}
}
}
//Load custom "server" extensions
for(auto it = availableExtensions.cbegin(); it!= availableExtensions.cend(); ++it)
{
if(!(*it).contains(Packets::client_tag))
{
QScriptValue imported = m_engine->importExtension(*it);
if(imported.isUndefined())
{
if(m_engine->hasUncaughtException())
qDebug() << m_engine->uncaughtException().toString();
}
}
}
}
示例2: setFilters
void ExtScript::setFilters(const QStringList _filters)
{
qCDebug(LOG_LIB) << "Filters" << _filters;
std::for_each(_filters.cbegin(), _filters.cend(),
[this](QString filter) { return updateFilter(filter); });
}
示例3: statFile
/**
* @fn childrenPids
*/
QList<Q_PID> QueuedProcess::childrenPids() const
{
QStringList allDirectories
= QDir("/proc").entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
QStringList directories = allDirectories.filter(QRegExp("(\\d+)"));
QList<Q_PID> pids
= std::accumulate(directories.cbegin(), directories.cend(), QList<Q_PID>(),
[this](QList<Q_PID> &list, const QString &dir) {
QFile statFile(QString("/proc/%1/stat").arg(dir));
if (!statFile.open(QIODevice::ReadOnly | QIODevice::Text))
return list;
QString output = statFile.readAll();
output.remove(QRegExp("\\d+ \\(.*\\) . "));
Q_PID ppid = output.split(' ').first().toLongLong();
if (ppid == pid())
list.append(dir.toLongLong());
statFile.close();
return list;
});
return pids;
}
示例4: if
OSMAND_CORE_UTILS_API bool OSMAND_CORE_UTILS_CALL OsmAnd::Verifier::parseCommandLineArguments( const QStringList& cmdLineArgs, Configuration& cfg, QString& error )
{
cfg.action = Configuration::Action::Invalid;
for(auto itArg = cmdLineArgs.cbegin(); itArg != cmdLineArgs.cend(); ++itArg)
{
auto arg = *itArg;
if(arg.startsWith("-obfsDir="))
cfg.obfDirs.append(arg.mid(strlen("-obfsDir=")));
if(arg.startsWith("-obf="))
cfg.obfFiles.append(arg.mid(strlen("-obf=")));
else if(arg == "-uniqueMapObjectIds")
cfg.action = Configuration::Action::UniqueMapObjectIds;
}
if(cfg.obfDirs.isEmpty() && cfg.obfFiles.isEmpty())
{
error = "no input given";
return false;
}
if(cfg.action == Configuration::Action::Invalid)
{
error = "no command given";
return false;
}
return true;
}
示例5: any_of
bool Net::DownloadManager::hasSupportedScheme(const QString &url)
{
const QStringList schemes = instance()->m_networkManager.supportedSchemes();
return std::any_of(schemes.cbegin(), schemes.cend(), [&url](const QString &scheme)
{
return url.startsWith((scheme + QLatin1Char(':')), Qt::CaseInsensitive);
});
}
示例6: enterGroup
int Settings::enterGroup(const QString& path)
{
QStringList parts = path.split('.');
auto it = parts.cbegin();
while(it != parts.cend()){
m_settings->beginGroup(*it);
it++;
}
return parts.count();
}
示例7: makeRelativeTo
QStringList Kleo::makeRelativeTo(const QDir &baseDir, const QStringList &fileNames)
{
QStringList rv;
rv.reserve(fileNames.size());
std::transform(fileNames.cbegin(), fileNames.cend(),
std::back_inserter(rv),
[&baseDir](const QString &file) {
return baseDir.relativeFilePath(file);
});
return rv;
}
示例8: updateFilter
void CountrySelectInner::updateFilter(QString filter) {
filter = textSearchKey(filter);
QStringList f;
if (!filter.isEmpty()) {
QStringList filterList = filter.split(cWordSplit(), QString::SkipEmptyParts);
int l = filterList.size();
f.reserve(l);
for (int i = 0; i < l; ++i) {
QString filterName = filterList[i].trimmed();
if (filterName.isEmpty()) continue;
f.push_back(filterName);
}
filter = f.join(' ');
}
if (_filter != filter) {
_filter = filter;
if (_filter.isEmpty()) {
countriesNow = &countriesAll;
} else {
QChar first = _filter[0].toLower();
CountriesIds &ids(countriesByLetter[first]);
QStringList::const_iterator fb = f.cbegin(), fe = f.cend(), fi;
countriesFiltered.clear();
for (CountriesIds::const_iterator i = ids.cbegin(), e = ids.cend(); i != e; ++i) {
int index = *i;
CountryNames &names(countriesNames[index]);
CountryNames::const_iterator nb = names.cbegin(), ne = names.cend(), ni;
for (fi = fb; fi != fe; ++fi) {
QString filterName(*fi);
for (ni = nb; ni != ne; ++ni) {
if (ni->startsWith(*fi)) {
break;
}
}
if (ni == ne) {
break;
}
}
if (fi == fe) {
countriesFiltered.push_back(countriesAll[index]);
}
}
countriesNow = &countriesFiltered;
}
refresh();
_sel = countriesNow->isEmpty() ? -1 : 0;
update();
}
}
示例9: listFiles
void MainWindow::listFiles()
{
QStringList fileList;
listFilesDetails("cel", fileList);
listFilesDetails("cl2", fileList);
fileList.sort();
for (QStringList::const_iterator it = fileList.cbegin(); it != fileList.cend(); it++)
{
ui->listView->addItem(*it);
}
}
示例10: append
void LocalImageLoader::append(const QStringList &files, const PeerId &peer, MsgId replyTo, ToPrepareMediaType t) {
{
QMutexLocker lock(toPrepareMutex());
for (QStringList::const_iterator i = files.cbegin(), e = files.cend(); i != e; ++i) {
toPrepare.push_back(ToPrepareMedia(*i, peer, t, false, replyTo));
}
}
if (!thread) {
thread = new QThread();
priv = new LocalImageLoaderPrivate(MTP::authedId(), this, thread);
thread->start();
}
emit needToPrepare();
}
示例11: getMsBuildToolPaths
QStringList CeSdkHandler::getMsBuildToolPaths() const
{
QSettings msbuildEntries("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\MSBuild\\ToolsVersions",
QSettings::NativeFormat);
const QStringList allKeys = msbuildEntries.allKeys();
QStringList toolVersionKeys;
toolVersionKeys.push_back(QStringLiteral("c:\\Program Files\\MSBuild\\"));
std::remove_copy_if(allKeys.cbegin(), allKeys.cend(),
std::back_inserter(toolVersionKeys), ContainsPathKey());
QStringList toolVersionValues;
std::transform(toolVersionKeys.constBegin(), toolVersionKeys.constEnd(),
std::back_inserter(toolVersionValues),
ValueFromKey(&msbuildEntries));
return toolVersionValues;
}
示例12: exec
bool RemoveTagQuery::exec(TaffyDB *db)
{
Tag t(tag);
QStringList files = this->getFiles();
for (auto i = files.cbegin(); i != files.cend(); i++) {
File f(*i);
if (!f.exists()) {
QString msg("File '%1' does not exist.");
msg = msg.arg(*i);
postWarning(msg);
}
db->removeTagFromFile(t, f);
}
return true;
}
示例13: if
OSMAND_CORE_UTILS_API bool OSMAND_CORE_UTILS_CALL OsmAnd::Inspector::parseCommandLineArguments( const QStringList& cmdLineArgs, Configuration& cfg, QString& error )
{
for(auto itArg = cmdLineArgs.cbegin(); itArg != cmdLineArgs.cend(); ++itArg)
{
auto arg = *itArg;
if(arg == "-vaddress")
cfg.verboseAddress = true;
else if(arg == "-vstreets")
cfg.verboseStreets = true;
else if(arg == "-vstreetgroups")
cfg.verboseStreetGroups = true;
else if(arg == "-vbuildings")
cfg.verboseBuildings = true;
else if(arg == "-vintersections")
cfg.verboseIntersections = true;
else if(arg == "-vmap")
cfg.verboseMap = true;
else if(arg == "-vmapObjects")
cfg.verboseMapObjects = true;
else if(arg == "-vpoi")
cfg.verbosePoi = true;
else if(arg == "-vamenities")
cfg.verboseAmenities = true;
else if(arg == "-vtransport")
cfg.verboseTrasport = true;
else if(arg.startsWith("-zoom="))
cfg.zoom = static_cast<ZoomLevel>(arg.mid(strlen("-zoom=")).toInt());
else if(arg.startsWith("-bbox="))
{
auto values = arg.mid(strlen("-bbox=")).split(",");
cfg.bbox.left = values[0].toDouble();
cfg.bbox.top = values[1].toDouble();
cfg.bbox.right = values[2].toDouble();
cfg.bbox.bottom = values[3].toDouble();
}
else if(arg.startsWith("-obf="))
{
cfg.fileName = arg.mid(strlen("-obf="));
}
}
if(cfg.fileName.isEmpty())
{
error = "OBF file not defined";
return false;
}
return true;
}
示例14: getStartedScriptFromAgrs
QString JsScriptingComponent::getStartedScriptFromAgrs() const
{
// TODO: Handle optional argument ... may be it should be one more extension
QStringList args = definition()->arguments();
auto it = std::find(args.cbegin(), args.cend(), "--start-script");
if (it == args.cend())
return QString();
++it;
if (it == args.cend()) {
Log.e("Wrong parameters. Usage [--start-script <scriptFilePath>]");
return QString();
}
return *it;
}
示例15: build
void chanCompilerModule::build(const QStringList& fileNames, const QString& dec){
//默认 gcc
QStringList arg;
std::for_each(fileNames.cbegin(), fileNames.cend(), [&](const QString& fileName){
arg << fileName;
});
arg << "-o" << dec;
m_successCount = fileNames.size();
m_errorCount = 0;
m_process.start("g++",arg);
}