本文整理汇总了C++中UiObjectMember::lastSourceLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ UiObjectMember::lastSourceLocation方法的具体用法?C++ UiObjectMember::lastSourceLocation怎么用?C++ UiObjectMember::lastSourceLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UiObjectMember
的用法示例。
在下文中一共展示了UiObjectMember::lastSourceLocation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: appendToArrayBinding
void Rewriter::appendToArrayBinding(UiArrayBinding *arrayBinding,
const QString &content)
{
UiObjectMember *lastMember = 0;
for (UiArrayMemberList *iter = arrayBinding->members; iter; iter = iter->next)
if (iter->member)
lastMember = iter->member;
if (!lastMember)
return; // an array binding cannot be empty, so there will (or should) always be a last member.
const int insertionPoint = lastMember->lastSourceLocation().end();
m_changeSet->insert(insertionPoint, QLatin1String(",\n") + content);
}
示例2: appendToArray
void appendToArray(UiArrayBinding *ast)
{
UiObjectMember *lastMember = 0;
for (UiArrayMemberList *iter = ast->members; iter; iter = iter->next) {
if (iter->member)
lastMember = iter->member;
}
if (!lastMember)
Q_ASSERT(!"Invalid QML: empty array found.");
moveInfo.destination = lastMember->lastSourceLocation().end();
moveInfo.suffixToInsert = QLatin1String(",\n");
move(moveInfo);
}
示例3: insertIntoArray
void Rewriter::insertIntoArray(UiArrayBinding *ast, const QString &newValue)
{
if (!ast)
return;
UiObjectMember *lastMember = 0;
for (UiArrayMemberList *iter = ast->members; iter; iter = iter->next) {
lastMember = iter->member;
}
if (!lastMember)
return;
const int insertionPoint = lastMember->lastSourceLocation().end();
m_changeSet->insert(insertionPoint, QLatin1String(",\n") + newValue);
}
示例4: insertInto
// FIXME: duplicate code in the QmlJS::Rewriter class, remove this
void AddArrayMemberVisitor::insertInto(QmlJS::AST::UiArrayBinding *arrayBinding)
{
UiObjectMember *lastMember = 0;
for (UiArrayMemberList *iter = arrayBinding->members; iter; iter = iter->next)
if (iter->member)
lastMember = iter->member;
if (!lastMember)
return; // an array binding cannot be empty, so there will (or should) always be a last member.
const int insertionPoint = lastMember->lastSourceLocation().end();
const int indentDepth = calculateIndentDepth(lastMember->firstSourceLocation());
replace(insertionPoint, 0, QLatin1String(",\n") + addIndentation(m_content, indentDepth));
setDidRewriting(true);
}
示例5: insertIntoArray
// FIXME: duplicate code in the QmlJS::Rewriter class, remove this
void ChangePropertyVisitor::insertIntoArray(QmlJS::AST::UiArrayBinding *ast)
{
if (!ast)
return;
UiObjectMember *lastMember = 0;
for (UiArrayMemberList *iter = ast->members; iter; iter = iter->next) {
lastMember = iter->member;
}
if (!lastMember)
return;
const int insertionPoint = lastMember->lastSourceLocation().end();
const int depth = calculateIndentDepth(lastMember->firstSourceLocation());
const QString indentedArrayMember = addIndentation(m_value, depth);
replace(insertionPoint, 0, QStringLiteral(",\n") + indentedArrayMember);
setDidRewriting(true);
}