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


C++ UiObjectMember::lastSourceLocation方法代码示例

本文整理汇总了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);
}
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:15,代码来源:qmljsrewriter.cpp

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

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

示例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);
}
开发者ID:gidlbn,项目名称:dlbn_02,代码行数:18,代码来源:addarraymembervisitor.cpp

示例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);
}
开发者ID:AltarBeastiful,项目名称:qt-creator,代码行数:20,代码来源:changepropertyvisitor.cpp


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