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


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

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


在下文中一共展示了QStringList::cend方法的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();
            }
        }
    }
}
开发者ID:WecodezFox,项目名称:FoxFramework,代码行数:34,代码来源:maplemanager.cpp

示例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); });
}
开发者ID:wlemuel,项目名称:awesome-widgets,代码行数:7,代码来源:extscript.cpp

示例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;
}
开发者ID:arcan1s,项目名称:queued,代码行数:29,代码来源:QueuedProcess.cpp

示例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;
}
开发者ID:kendzi,项目名称:OsmAnd-core,代码行数:29,代码来源:Verifier.cpp

示例5: 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;
}
开发者ID:yudjin87,项目名称:tour_du_monde,代码行数:16,代码来源:JsScriptingComponent.cpp

示例6: 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);
    });
}
开发者ID:qbittorrent,项目名称:qBittorrent,代码行数:8,代码来源:downloadmanager.cpp

示例7: 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();
}
开发者ID:cntysoft,项目名称:corelib_cplusplus,代码行数:10,代码来源:settings.cpp

示例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();
	}
}
开发者ID:ACoolMoose,项目名称:tdesktop,代码行数:54,代码来源:countryinput.cpp

示例9: 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;
}
开发者ID:KDE,项目名称:kleopatra,代码行数:11,代码来源:path-helper.cpp

示例10: 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);
    }
}
开发者ID:FlyingTarrasque,项目名称:freeablo,代码行数:13,代码来源:mainwindow.cpp

示例11: 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();
}
开发者ID:09120898371,项目名称:tdesktop,代码行数:14,代码来源:localimageloader.cpp

示例12: 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;
}
开发者ID:power-electro,项目名称:phantomjs-Gohstdriver-DIY-openshift,代码行数:15,代码来源:cesdkhandler.cpp

示例13: 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;
}
开发者ID:xaikal,项目名称:taffy,代码行数:15,代码来源:removetagquery.cpp

示例14: 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;
}
开发者ID:kendzi,项目名称:OsmAnd-core,代码行数:48,代码来源:Inspector.cpp

示例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);
}
开发者ID:ChanJLee,项目名称:ChanIDE,代码行数:16,代码来源:chanCompilerModule.cpp


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