本文整理汇总了C++中ProjectTreeItem::getRemoveCandidate方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectTreeItem::getRemoveCandidate方法的具体用法?C++ ProjectTreeItem::getRemoveCandidate怎么用?C++ ProjectTreeItem::getRemoveCandidate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectTreeItem
的用法示例。
在下文中一共展示了ProjectTreeItem::getRemoveCandidate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shaderRemoved
/**
* @brief ProjectManagerTreeModel::shaderRemoved Call this method when shader was removed.
* @param name Name of the removed shader.
*/
void ProjectManagerTreeModel::shaderRemoved(QString name, MetaShader::SHADERTYPE type)
{
ProjectTreeItem* item;
MetaProject* proj = dynamic_cast<MetaProject*>(sender());
if(proj == NULL)
return;
//convert path to -> projectName '/' path
QString projName = proj->getName();
name.insert(0,projName + '/');
if(type == MetaShader::FRAGMENT)
//item = root->findLastCreated(name.split(QDir::separator()),ProjectTreeItem::FRAGMENT);
item = root->findLastCreated(name.split('/'),ProjectTreeItem::FRAGMENT);
else
//item = root->findLastCreated(name.split(QDir::separator()),ProjectTreeItem::VERTEX);
item = root->findLastCreated(name.split('/'),ProjectTreeItem::VERTEX);
ProjectTreeItem* candidate = item->getRemoveCandidate();
int row = candidate->getRow();
insertData = name;
insertType = ProjectTreeItem::SHADER;
QModelIndex index = createIndex(candidate->getParent()->getRow(), 0, candidate->getParent());
removeRows(row,1,index);
emit dataChanged(index,index);
}