QmakeProjectManager: Differentiate between different types of projects

... by using different icons in the tree.
So far, Qmake project nodes looked annoyingly uniform, which was a
hindrance to understanding their structure. We now use the same
differentiation as in qbs, that is "project" (SUBDIRS pro file),
"product" (app/lib/other) and "group" (pri file), which conveys much
more information at a quick glance.

Change-Id: I04ca2aeccb9240876c0fb5cd1310e0b199eb3e97
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Christian Kandeler
2020-04-29 17:03:26 +02:00
parent 732b17a2c4
commit ce428cfeef
10 changed files with 28 additions and 14 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -73,7 +73,7 @@ const QbsProductNode *parentQbsProductNode(const ProjectExplorer::Node *node)
QbsGroupNode::QbsGroupNode(const QJsonObject &grp) : ProjectNode(FilePath()), m_groupData(grp)
{
static QIcon groupIcon = QIcon(QString(Constants::QBS_GROUP_ICON));
static QIcon groupIcon = QIcon(QString(ProjectExplorer::Constants::FILEOVERLAY_GROUP));
setIcon(groupIcon);
setDisplayName(grp.value("name").toString());
setEnabled(grp.value("is-enabled").toBool());
@@ -109,7 +109,7 @@ QVariant QbsGroupNode::data(Core::Id role) const
QbsProductNode::QbsProductNode(const QJsonObject &prd) : ProjectNode(FilePath()), m_productData(prd)
{
static QIcon productIcon = Core::FileIconProvider::directoryIcon(
Constants::QBS_PRODUCT_OVERLAY_ICON);
ProjectExplorer::Constants::FILEOVERLAY_PRODUCT);
setIcon(productIcon);
if (prd.value("is-runnable").toBool()) {
setProductType(ProductType::App);

View File

@@ -1,9 +1,5 @@
<RCC>
<qresource prefix="/qbsprojectmanager">
<file>images/groups.png</file>
<file>images/groups@2x.png</file>
<file>images/productgear.png</file>
<file>images/productgear@2x.png</file>
<file>images/settingscategory_qbsprojectmanager.png</file>
<file>images/settingscategory_qbsprojectmanager@2x.png</file>
</qresource>

View File

@@ -73,10 +73,6 @@ const char QBS_CONFIG_QUICK_COMPILER_KEY[] = "modules.Qt.quick.useCompiler";
const char QBS_CONFIG_SEPARATE_DEBUG_INFO_KEY[] = "modules.cpp.separateDebugInformation";
const char QBS_FORCE_PROBES_KEY[] = "qbspm.forceProbes";
// Icons:
const char QBS_GROUP_ICON[] = ":/qbsprojectmanager/images/groups.png";
const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png";
// Toolchain related settings:
const char QBS_TARGETPLATFORM[] = "qbs.targetPlatform";
const char QBS_SYSROOT[] = "qbs.sysroot";