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


C++ TupLayer::layerName方法代码示例

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


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

示例1: removeLayer

bool TupCommandExecutor::removeLayer(TupLayerResponse *response)
{
    #ifdef K_DEBUG
           T_FUNCINFO;
    #endif

    int scenePos = response->sceneIndex();
    int position = response->layerIndex();

    TupScene *scene = m_project->scene(scenePos);

    if (scene) {
        TupLayer *layer = scene->layer(position);
        if (layer) {
            QDomDocument document;
            document.appendChild(layer->toXml(document));
            response->setState(document.toString());
            response->setArg(layer->layerName());

            if (scene->removeLayer(position)) {
                emit responsed(response);
                return true;
            } 
        } 
    }

    return false;
}
开发者ID:nanox,项目名称:tupi,代码行数:28,代码来源:tupcommandexecutor_layers.cpp

示例2: renameLayer

bool TupCommandExecutor::renameLayer(TupLayerResponse *response)
{
    int scenePos = response->sceneIndex();
    int position = response->layerIndex();
    QString newName = response->arg().toString();

    #ifdef K_DEBUG
           tWarning() << "Renamed layer: " << newName;
    #endif

    QString oldName;

    TupScene *scene = m_project->scene(scenePos);

    if (!scene)
        return false;

    TupLayer *layer = scene->layer(position);

    if (layer) {
        QString current = layer->layerName();
        layer->setLayerName(newName);

        emit responsed(response);
        response->setArg(current);

        return true;
    }

    return false;
}
开发者ID:nanox,项目名称:tupi,代码行数:31,代码来源:tupcommandexecutor_layers.cpp

示例3: tError

TupLayer *TupScene::createLayer(QString name, int position, bool loaded)
{
    // Q_CHECK_PTR(k->layers);

    if (position < 0 || position > k->layers.count()) {
        #ifdef K_DEBUG
               tError() << "TupScene::createLayer() - Invalid index -> " << position;
        #endif
        return 0;
    }

    k->layerCount++;

    TupLayer *layer = new TupLayer(this, k->layerCount);
    layer->setLayerName(name);
    k->layers.insert(position, layer);

    if (loaded)
        TupProjectLoader::createLayer(project()->visualIndexOf(this), position, layer->layerName(), project());

    return layer;
}
开发者ID:nanox,项目名称:tupi,代码行数:22,代码来源:tupscene.cpp


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