Showing different icon for class and struct in classview

Adding new slightly different icon for Struct to make it
different from Class.

Task-number: QTCREATORBUG-8574
Change-Id: I3da655adeaa05d7a590d4ec00f9749b5d86e0340
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
Libor Tomsik
2015-02-24 11:33:39 +01:00
parent acc2a5e566
commit 2404974176
5 changed files with 11 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ using CPlusPlus::Icons;
Icons::Icons()
: _classIcon(QLatin1String(":/codemodel/images/class.png")),
_structIcon(QLatin1String(":/codemodel/images/struct.png")),
_enumIcon(QLatin1String(":/codemodel/images/enum.png")),
_enumeratorIcon(QLatin1String(":/codemodel/images/enumerator.png")),
_funcPublicIcon(QLatin1String(":/codemodel/images/func.png")),
@@ -115,8 +116,10 @@ Icons::IconType Icons::iconTypeForSymbol(const Symbol *symbol)
return VarPrivateIconType;
} else if (symbol->isEnum()) {
return EnumIconType;
} else if (symbol->isClass() || symbol->isForwardClassDeclaration()) {
return ClassIconType;
} else if (symbol->isForwardClassDeclaration()) {
return ClassIconType; // TODO: Store class key in ForwardClassDeclaration
} else if (const Class *klass = symbol->asClass()) {
return klass->isStruct() ? StructIconType : ClassIconType;
} else if (symbol->isObjCClass() || symbol->isObjCForwardClassDeclaration()) {
return ClassIconType;
} else if (symbol->isObjCProtocol() || symbol->isObjCForwardProtocolDeclaration()) {
@@ -141,6 +144,8 @@ QIcon Icons::iconForType(IconType type) const
switch (type) {
case ClassIconType:
return _classIcon;
case StructIconType:
return _structIcon;
case EnumIconType:
return _enumIcon;
case EnumeratorIconType:

View File

@@ -51,6 +51,7 @@ public:
enum IconType {
ClassIconType = 0,
StructIconType,
EnumIconType,
EnumeratorIconType,
FuncPublicIconType,
@@ -74,6 +75,7 @@ public:
private:
QIcon _classIcon;
QIcon _structIcon;
QIcon _enumIcon;
QIcon _enumeratorIcon;
QIcon _funcPublicIcon;

View File

@@ -132,6 +132,7 @@ QtcLibrary {
prefix: "images/"
files: [
"class.png",
"struct.png",
"enum.png",
"enumerator.png",
"func.png",

View File

@@ -1,6 +1,7 @@
<RCC>
<qresource prefix="/codemodel" >
<file>images/class.png</file>
<file>images/struct.png</file>
<file>images/enum.png</file>
<file>images/enumerator.png</file>
<file>images/func.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B