本文整理汇总了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;
}
示例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;
}
示例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;
}