本文整理汇总了C++中QVector::crbegin方法的典型用法代码示例。如果您正苦于以下问题:C++ QVector::crbegin方法的具体用法?C++ QVector::crbegin怎么用?C++ QVector::crbegin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVector
的用法示例。
在下文中一共展示了QVector::crbegin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: appendMessage
void appendMessage(const QString &text, OutputFormat format) final
{
const bool isTrace = (format == StdErrFormat
|| format == StdErrFormatSameLine)
&& (text.startsWith("Traceback (most recent call last):")
|| text.startsWith("\nTraceback (most recent call last):"));
if (!isTrace) {
OutputFormatter::appendMessage(text, format);
return;
}
const QTextCharFormat frm = charFormat(format);
const Core::Id id(PythonErrorTaskCategory);
QVector<Task> tasks;
const QStringList lines = text.split('\n');
unsigned taskId = unsigned(lines.size());
for (const QString &line : lines) {
const QRegularExpressionMatch match = filePattern.match(line);
if (match.hasMatch()) {
QTextCursor tc = plainTextEdit()->textCursor();
tc.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
tc.insertText('\n' + match.captured(1));
tc.insertText(match.captured(2), linkFormat(frm, match.captured(2)));
const auto fileName = FileName::fromString(match.captured(3));
const int lineNumber = match.capturedRef(4).toInt();
Task task(Task::Warning,
QString(), fileName, lineNumber, id);
task.taskId = --taskId;
tasks.append(task);
} else {
if (!tasks.isEmpty()) {
Task &task = tasks.back();
if (!task.description.isEmpty())
task.description += ' ';
task.description += line.trimmed();
}
OutputFormatter::appendMessage('\n' + line, format);
}
}
if (!tasks.isEmpty()) {
tasks.back().type = Task::Error;
for (auto rit = tasks.crbegin(), rend = tasks.crend(); rit != rend; ++rit)
TaskHub::addTask(*rit);
}
}