本文整理汇总了C++中ProjectExplorer::Task方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectExplorer::Task方法的具体用法?C++ ProjectExplorer::Task怎么用?C++ ProjectExplorer::Task使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectExplorer
的用法示例。
在下文中一共展示了ProjectExplorer::Task方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QString
void QtSupportPlugin::testQtOutputParser_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QList<ProjectExplorer::Task> >("tasks");
QTest::addColumn<QString>("outputLines");
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("pass-through gcc infos")
<< QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n"
"../../scriptbug/main.cpp: At global scope:\n"
"../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n"
"../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n"
"../../scriptbug/main.cpp:22: instantiated from here")
<< OutputParserTester::STDERR
<< QString()
<< QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n"
"../../scriptbug/main.cpp: At global scope:\n"
"../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n"
"../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n"
"../../scriptbug/main.cpp:22: instantiated from here\n")
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("moc warning")
<< QString::fromLatin1("..\\untitled\\errorfile.h:0: Warning: No relevant classes found. No output generated.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("No relevant classes found. No output generated."),
QLatin1String("..\\untitled\\errorfile.h"), 0,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< QString();
QTest::newRow("moc warning 2")
<< QString::fromLatin1("c:\\code\\test.h(96): Warning: Property declaration ) has no READ accessor function. The property will be invalid.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("Property declaration ) has no READ accessor function. The property will be invalid."),
QLatin1String("c:\\code\\test.h"), 96,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< QString();
}
示例2: stdError
void QMakeParser::stdError(const QString &line)
{
QString lne = rightTrimmed(line);
if (lne.startsWith(QLatin1String("Project ERROR:"))) {
const QString description = lne.mid(15);
emit addTask(Task(Task::Error,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return;
}
if (lne.startsWith(QLatin1String("Project WARNING:"))) {
const QString description = lne.mid(17);
emit addTask(Task(Task::Warning,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return;
}
if (m_error.indexIn(lne) > -1) {
QString fileName = m_error.cap(1);
Task::TaskType type = Task::Error;
if (fileName.startsWith(QLatin1String("WARNING: "))) {
type = Task::Warning;
fileName = fileName.mid(9);
} else if (fileName.startsWith(QLatin1String("ERROR: "))) {
fileName = fileName.mid(7);
}
emit addTask(Task(type,
m_error.cap(3) /* description */,
Utils::FileName::fromUserInput(fileName),
m_error.cap(2).toInt() /* line */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return;
}
IOutputParser::stdError(line);
}
示例3: QString
void QtSupportPlugin::testQtOutputParser_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QList<ProjectExplorer::Task> >("tasks");
QTest::addColumn<QString>("outputLines");
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("pass-through gcc infos")
<< QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n"
"../../scriptbug/main.cpp: At global scope:\n"
"../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n"
"../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n"
"../../scriptbug/main.cpp:22: instantiated from here")
<< OutputParserTester::STDERR
<< QString()
<< QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n"
"../../scriptbug/main.cpp: At global scope:\n"
"../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n"
"../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n"
"../../scriptbug/main.cpp:22: instantiated from here\n")
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("qdoc warning")
<< QString::fromLatin1("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp:295: warning: Can't create link to 'Object Trees & Ownership'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("Can't create link to 'Object Trees & Ownership'"),
Utils::FileName::fromUserInput(QLatin1String("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp")), 295,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< QString();
QTest::newRow("moc warning")
<< QString::fromLatin1("..\\untitled\\errorfile.h:0: Warning: No relevant classes found. No output generated.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("No relevant classes found. No output generated."),
Utils::FileName::fromUserInput(QLatin1String("..\\untitled\\errorfile.h")), 0,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< QString();
QTest::newRow("moc warning 2")
<< QString::fromLatin1("c:\\code\\test.h(96): Warning: Property declaration ) has no READ accessor function. The property will be invalid.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("Property declaration ) has no READ accessor function. The property will be invalid."),
Utils::FileName::fromUserInput(QLatin1String("c:\\code\\test.h")), 96,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< QString();
QTest::newRow("ninja with moc")
<< QString::fromLatin1("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h(54): Error: Undefined interface")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Error,
QLatin1String("Undefined interface"),
Utils::FileName::fromUserInput(QLatin1String("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h")), 54,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE))
<< QString();
}
示例4: QString
void QmakeProjectManagerPlugin::testQmakeOutputParsers_data()
{
const Core::Id categoryBuildSystem = Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QList<ProjectExplorer::Task> >("tasks");
QTest::addColumn<QString>("outputLines");
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("qMake error")
<< QString::fromLatin1("Project ERROR: undefined file")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>()
<< Task(Task::Error,
QLatin1String("undefined file"),
Utils::FileName(), -1,
categoryBuildSystem))
<< QString();
QTest::newRow("qMake Parse Error")
<< QString::fromLatin1("e:\\project.pro:14: Parse Error ('sth odd')")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>()
<< Task(Task::Error,
QLatin1String("Parse Error ('sth odd')"),
Utils::FileName::fromUserInput(QLatin1String("e:\\project.pro")),
14,
categoryBuildSystem))
<< QString();
QTest::newRow("qMake warning")
<< QString::fromLatin1("Project WARNING: bearer module might require ReadUserData capability")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>()
<< Task(Task::Warning,
QLatin1String("bearer module might require ReadUserData capability"),
Utils::FileName(), -1,
categoryBuildSystem))
<< QString();
QTest::newRow("qMake warning with location")
<< QString::fromLatin1("WARNING: e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl:1: Unescaped backslashes are deprecated.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>()
<< Task(Task::Warning,
QLatin1String("Unescaped backslashes are deprecated."),
Utils::FileName::fromUserInput(QLatin1String("e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl")), 1,
categoryBuildSystem))
<< QString();
}