本文整理汇总了C++中QDir::current方法的典型用法代码示例。如果您正苦于以下问题:C++ QDir::current方法的具体用法?C++ QDir::current怎么用?C++ QDir::current使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDir
的用法示例。
在下文中一共展示了QDir::current方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseScenarios
ComplexUserActionList ComplexUserActionParser::parseScenarios()
{
ComplexUserActionList scenarios;
QDir dir;
dir.current().cdUp();
dir.cdUp();
dir.setPath("userAction/userScenario");
QStringList filters;
filters << "*.xml";
QStringList const scenarioFileNames = dir.entryList(filters);
QStringList scenarioFiles;
for (const QString &actionFileName: scenarioFileNames) {
scenarioFiles << dir.absolutePath() + "/" + actionFileName;
}
for (const QString &actionFile: scenarioFiles) {
ComplexUserAction *scenario = parseAction(actionFile, true);
if (scenario != nullptr) {
scenarios << scenario;
}
}
return scenarios;
}
示例2: parse
ComplexUserActionList ComplexUserActionParser::parse()
{
ComplexUserActionList complexActions;
QDir dir;
dir.current().cdUp();
dir.cdUp();
dir.setPath("userAction/complexUserAction/XMLcomplexUserActions");
QStringList filters;
filters << "*.xml";
QStringList const complexActionFileNames = dir.entryList(filters);
QStringList complexActionFiles;
for (const QString &actionFileName: complexActionFileNames) {
complexActionFiles << dir.absolutePath() + "/" + actionFileName;
}
for (const QString &actionFile: complexActionFiles) {
ComplexUserAction *complexUserAction = parseAction(actionFile);
if (complexUserAction != nullptr) {
complexActions << complexUserAction;
}
}
return complexActions;
}