本文整理汇总了C++中QmakeProFileNode::displayName方法的典型用法代码示例。如果您正苦于以下问题:C++ QmakeProFileNode::displayName方法的具体用法?C++ QmakeProFileNode::displayName怎么用?C++ QmakeProFileNode::displayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QmakeProFileNode
的用法示例。
在下文中一共展示了QmakeProFileNode::displayName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateContextActions
void QmakeProjectManagerPluginPrivate::updateContextActions()
{
const Node *node = ProjectTree::findCurrentNode();
Project *project = ProjectTree::currentProject();
const ContainerNode *containerNode = node ? node->asContainerNode() : nullptr;
const auto *proFileNode = dynamic_cast<const QmakeProFileNode *>(containerNode ? containerNode->rootProjectNode() : node);
m_addLibraryActionContextMenu->setEnabled(proFileNode);
auto *qmakeProject = qobject_cast<QmakeProject *>(QmakeManager::contextProject());
QmakeProFileNode *subProjectNode = nullptr;
disableBuildFileMenus();
if (node) {
auto subPriFileNode = dynamic_cast<const QmakePriFileNode *>(node);
if (!subPriFileNode)
subPriFileNode = dynamic_cast<QmakePriFileNode *>(node->parentProjectNode());
subProjectNode = subPriFileNode ? subPriFileNode->proFileNode() : nullptr;
if (const FileNode *fileNode = node->asFileNode())
enableBuildFileMenus(fileNode->filePath());
}
bool subProjectActionsVisible = false;
if (qmakeProject && subProjectNode) {
if (ProjectNode *rootNode = qmakeProject->rootProjectNode())
subProjectActionsVisible = subProjectNode != rootNode;
}
QString subProjectName;
if (subProjectActionsVisible)
subProjectName = subProjectNode->displayName();
m_buildSubProjectAction->setParameter(subProjectName);
m_rebuildSubProjectAction->setParameter(subProjectName);
m_cleanSubProjectAction->setParameter(subProjectName);
m_buildSubProjectContextMenu->setParameter(proFileNode ? proFileNode->displayName() : QString());
auto buildConfiguration = (qmakeProject && qmakeProject->activeTarget()) ?
static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration()) : nullptr;
bool isProjectNode = qmakeProject && proFileNode && buildConfiguration;
bool isBuilding = BuildManager::isBuilding(project);
bool enabled = subProjectActionsVisible && !isBuilding;
m_buildSubProjectAction->setVisible(subProjectActionsVisible);
m_rebuildSubProjectAction->setVisible(subProjectActionsVisible);
m_cleanSubProjectAction->setVisible(subProjectActionsVisible);
m_buildSubProjectContextMenu->setVisible(subProjectActionsVisible && isProjectNode);
m_subProjectRebuildSeparator->setVisible(subProjectActionsVisible && isProjectNode);
m_rebuildSubProjectContextMenu->setVisible(subProjectActionsVisible && isProjectNode);
m_cleanSubProjectContextMenu->setVisible(subProjectActionsVisible && isProjectNode);
m_buildSubProjectAction->setEnabled(enabled);
m_rebuildSubProjectAction->setEnabled(enabled);
m_cleanSubProjectAction->setEnabled(enabled);
m_buildSubProjectContextMenu->setEnabled(enabled && isProjectNode);
m_rebuildSubProjectContextMenu->setEnabled(enabled && isProjectNode);
m_cleanSubProjectContextMenu->setEnabled(enabled && isProjectNode);
m_runQMakeActionContextMenu->setEnabled(isProjectNode && !isBuilding
&& buildConfiguration->qmakeStep());
}