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


C++ CellAddress类代码示例

本文整理汇总了C++中CellAddress的典型用法代码示例。如果您正苦于以下问题:C++ CellAddress类的具体用法?C++ CellAddress怎么用?C++ CellAddress使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CellAddress类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateCell

void SheetView::updateCell(const App::Property *prop)
{
    try {
        CellAddress address;

        sheet->getCellAddress(prop, address);

        if (currentIndex().row() == address.row() && currentIndex().column() == address.col() )
            updateContentLine();
    }
    catch (...) {
        // Property is not a cell
        return;
    }
}
开发者ID:AjinkyaDahale,项目名称:FreeCAD,代码行数:15,代码来源:SpreadsheetView.cpp

示例2: clear

void Sheet::clear(CellAddress address, bool /*all*/)
{
    Cell * cell = getCell(address);
    std::string addr = address.toString();
    Property * prop = props.getDynamicPropertyByName(addr.c_str());

    // Remove alias, if defined
    std::string aliasStr;
    if (cell && cell->getAlias(aliasStr))
        this->removeDynamicProperty(aliasStr.c_str());

    cells.clear(address);

    // Update dependencies
    std::set<DocumentObject*> ds(cells.getDocDeps());

    // Make sure we don't reference ourselves
    ds.erase(this);

    std::vector<DocumentObject*> dv(ds.begin(), ds.end());
    docDeps.setValues(dv);

    propAddress.erase(prop);
    this->removeDynamicProperty(addr.c_str());
}
开发者ID:pgilfernandez,项目名称:FreeCAD,代码行数:25,代码来源:Sheet.cpp

示例3: recomputeCell

void Sheet::recomputeCell(CellAddress p)
{
    Cell * cell = cells.getValue(p);
    std::string docName = getDocument()->Label.getValue();
    std::string docObjName = std::string(getNameInDocument());
    std::string name = docName + "#" + docObjName + "." + p.toString();

    try {
        if (cell) {
            cell->clearException();
            cell->clearResolveException();
        }
        updateProperty(p);
        cells.clearDirty(p);
        cellErrors.erase(p);
    }
    catch (const Base::Exception & e) {
        QString msg = QString::fromUtf8("ERR: %1").arg(QString::fromUtf8(e.what()));

        setStringProperty(p, Base::Tools::toStdString(msg));
        if (cell)
            cell->setException(e.what());

        // Mark as erroneous
        cellErrors.insert(p);
    }

    updateAlias(p);

    if (!cell || cell->spansChanged())
        cellSpanChanged(p);
}
开发者ID:pgilfernandez,项目名称:FreeCAD,代码行数:32,代码来源:Sheet.cpp

示例4: updateAlias

void Sheet::updateAlias(CellAddress key)
{
    std::string alias;
    Property * prop = props.getDynamicPropertyByName(key.toString().c_str());

    if (!prop)
        return;

    Cell * cell = getCell(key);

    if (cell && cell->getAlias(alias)) {
        Property * aliasProp = props.getDynamicPropertyByName(alias.c_str());

        /* Update or create alias? */
        if (aliasProp) {
            // Type of alias and property must always be the same
            if (aliasProp->getTypeId() != prop->getTypeId()) {
                this->removeDynamicProperty(alias.c_str());
                aliasProp = 0;
            }
        }

        if (!aliasProp)
            aliasProp = props.addDynamicProperty(prop->getTypeId().getName(), alias.c_str(), 0, 0, Prop_ReadOnly | Prop_Transient);

        aliasProp->Paste(*prop);
    }
}
开发者ID:pgilfernandez,项目名称:FreeCAD,代码行数:28,代码来源:Sheet.cpp

示例5: clear

void Sheet::clear(CellAddress address, bool all)
{
    Cell * cell = getCell(address);
    std::string addr = address.toString();
    Property * prop = props.getDynamicPropertyByName(addr.c_str());

    // Remove alias, if defined
    std::string aliasStr;
    if (cell && cell->getAlias(aliasStr))
        props.removeDynamicProperty(aliasStr.c_str());

    cells.clear(address);

    propAddress.erase(prop);
    props.removeDynamicProperty(addr.c_str());
}
开发者ID:DanielDTR,项目名称:FreeCAD_sf_master,代码行数:16,代码来源:Sheet.cpp

示例6: setAlias

void Sheet::setAlias(CellAddress address, const std::string &alias)
{
    std::string existingAlias = getAddressFromAlias(alias);

    if (existingAlias.size() > 0) {
        if (existingAlias == address.toString()) // Same as old?
            return;
        else
            throw Base::Exception("Alias already defined");
    }
    else if (alias.size() == 0) // Empty?
        cells.setAlias(address, "");
    else if (isValidAlias(alias)) // Valid?
        cells.setAlias(address, alias);
    else
        throw Base::Exception("Invalid alias");
}
开发者ID:pgilfernandez,项目名称:FreeCAD,代码行数:17,代码来源:Sheet.cpp

示例7: providesTo

void Sheet::providesTo(CellAddress address, std::set<CellAddress> & result) const
{
    const char * docName = getDocument()->Label.getValue();
    const char * docObjName = getNameInDocument();
    std::string fullName = std::string(docName) + "#" + std::string(docObjName) + "." + address.toString();
    result = cells.getDeps(fullName);
}
开发者ID:pgilfernandez,项目名称:FreeCAD,代码行数:7,代码来源:Sheet.cpp

示例8: getDocument

void Sheet::providesTo(CellAddress address, std::set<std::string> & result) const
{
    const char * docName = getDocument()->Label.getValue();
    const char * docObjName = getNameInDocument();
    std::string fullName = std::string(docName) + "#" + std::string(docObjName) + "." + address.toString();
    std::set<CellAddress> tmpResult = cells.getDeps(fullName);

    for (std::set<CellAddress>::const_iterator i = tmpResult.begin(); i != tmpResult.end(); ++i)
        result.insert(std::string(docName) + "#" + std::string(docObjName) + "." + i->toString());
}
开发者ID:pgilfernandez,项目名称:FreeCAD,代码行数:10,代码来源:Sheet.cpp

示例9: cellUpdated

void SheetModel::cellUpdated(CellAddress address)
{
    QModelIndex i = index(address.row(), address.col());

    dataChanged(i, i);
}
开发者ID:Jonham,项目名称:FreeCAD,代码行数:6,代码来源:SheetModel.cpp


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