本文整理汇总了C++中FolderNode::supportedActions方法的典型用法代码示例。如果您正苦于以下问题:C++ FolderNode::supportedActions方法的具体用法?C++ FolderNode::supportedActions怎么用?C++ FolderNode::supportedActions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FolderNode
的用法示例。
在下文中一共展示了FolderNode::supportedActions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateContextActions
void ResourceEditorPlugin::updateContextActions(Node *node, Project *)
{
bool isResourceNode = dynamic_cast<ResourceTopLevelNode *>(node);
m_addPrefix->setEnabled(isResourceNode);
m_addPrefix->setVisible(isResourceNode);
bool enableRename = false;
bool enableRemove = false;
if (isResourceNode) {
FolderNode *parent = node ? node->parentFolderNode() : 0;
enableRename = parent && parent->supportedActions(node).contains(Rename);
enableRemove = parent && parent->supportedActions(node).contains(RemoveFile);
}
m_renameResourceFile->setEnabled(isResourceNode && enableRename);
m_renameResourceFile->setVisible(isResourceNode && enableRename);
m_removeResourceFile->setEnabled(isResourceNode && enableRemove);
m_removeResourceFile->setVisible(isResourceNode && enableRemove);
m_openInEditor->setEnabled(isResourceNode);
m_openInEditor->setVisible(isResourceNode);
bool isResourceFolder = dynamic_cast<ResourceFolderNode *>(node);
m_removePrefix->setEnabled(isResourceFolder);
m_removePrefix->setVisible(isResourceFolder);
m_renamePrefix->setEnabled(isResourceFolder);
m_renamePrefix->setVisible(isResourceFolder);
m_removeNonExisting->setEnabled(isResourceNode);
m_removeNonExisting->setVisible(isResourceNode);
if (isResourceNode)
Core::EditorManager::populateOpenWithMenu(m_openWithMenu, node->path().toString());
else
m_openWithMenu->clear();
m_openWithMenu->menuAction()->setVisible(!m_openWithMenu->actions().isEmpty());
bool isResourceFile = dynamic_cast<ResourceFileNode *>(node);
m_copyPath->setEnabled(isResourceFile);
m_copyPath->setVisible(isResourceFile);
m_copyUrl->setEnabled(isResourceFile);
m_copyUrl->setVisible(isResourceFile);
if (isResourceFile) {
ResourceFileNode *fileNode = static_cast<ResourceFileNode *>(node);
QString qrcPath = fileNode->qrcPath();
m_copyPath->setParameter(QLatin1String(resourcePrefix) + qrcPath);
m_copyUrl->setParameter(QLatin1String(urlPrefix) + qrcPath);
}
}