Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
915ba478
Commit
915ba478
authored
Jul 16, 2010
by
Denis Mingulov
Committed by
Kai Koehne
Jul 16, 2010
Browse files
CPlusPlus::Icons - modify to support icon's id additionally
Merge-request: 2167 Reviewed-by:
Kai Koehne
<
kai.koehne@nokia.com
>
parent
8519ca11
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/Icons.cpp
View file @
915ba478
...
...
@@ -58,6 +58,21 @@ Icons::Icons()
}
QIcon
Icons
::
iconForSymbol
(
const
Symbol
*
symbol
)
const
{
return
iconForType
(
iconTypeForSymbol
(
symbol
));
}
QIcon
Icons
::
keywordIcon
()
const
{
return
_keywordIcon
;
}
QIcon
Icons
::
macroIcon
()
const
{
return
_macroIcon
;
}
Icons
::
IconType
Icons
::
iconTypeForSymbol
(
const
Symbol
*
symbol
)
{
FullySpecifiedType
symbolType
=
symbol
->
type
();
if
(
symbol
->
isFunction
()
||
(
symbol
->
isDeclaration
()
&&
symbolType
&&
...
...
@@ -69,58 +84,89 @@ QIcon Icons::iconForSymbol(const Symbol *symbol) const
if
(
function
->
isSlot
())
{
if
(
function
->
isPublic
())
{
return
_s
lotPublicIcon
;
return
S
lotPublicIcon
Type
;
}
else
if
(
function
->
isProtected
())
{
return
_s
lotProtectedIcon
;
return
S
lotProtectedIcon
Type
;
}
else
if
(
function
->
isPrivate
())
{
return
_s
lotPrivateIcon
;
return
S
lotPrivateIcon
Type
;
}
}
else
if
(
function
->
isSignal
())
{
return
_s
ignalIcon
;
return
S
ignalIcon
Type
;
}
else
if
(
symbol
->
isPublic
())
{
return
_f
uncPublicIcon
;
return
F
uncPublicIcon
Type
;
}
else
if
(
symbol
->
isProtected
())
{
return
_f
uncProtectedIcon
;
return
F
uncProtectedIcon
Type
;
}
else
if
(
symbol
->
isPrivate
())
{
return
_f
uncPrivateIcon
;
return
F
uncPrivateIcon
Type
;
}
}
else
if
(
symbol
->
scope
()
&&
symbol
->
scope
()
->
isEnumScope
())
{
return
_e
numeratorIcon
;
return
E
numeratorIcon
Type
;
}
else
if
(
symbol
->
isDeclaration
()
||
symbol
->
isArgument
())
{
if
(
symbol
->
isPublic
())
{
return
_v
arPublicIcon
;
return
V
arPublicIcon
Type
;
}
else
if
(
symbol
->
isProtected
())
{
return
_v
arProtectedIcon
;
return
V
arProtectedIcon
Type
;
}
else
if
(
symbol
->
isPrivate
())
{
return
_v
arPrivateIcon
;
return
V
arPrivateIcon
Type
;
}
}
else
if
(
symbol
->
isEnum
())
{
return
_e
numIcon
;
return
E
numIcon
Type
;
}
else
if
(
symbol
->
isClass
()
||
symbol
->
isForwardClassDeclaration
())
{
return
_c
lassIcon
;
return
C
lassIcon
Type
;
}
else
if
(
symbol
->
isObjCClass
()
||
symbol
->
isObjCForwardClassDeclaration
())
{
return
_c
lassIcon
;
return
C
lassIcon
Type
;
}
else
if
(
symbol
->
isObjCProtocol
()
||
symbol
->
isObjCForwardProtocolDeclaration
())
{
return
_c
lassIcon
;
return
C
lassIcon
Type
;
}
else
if
(
symbol
->
isObjCMethod
())
{
return
_f
uncPublicIcon
;
return
F
uncPublicIcon
Type
;
}
else
if
(
symbol
->
isNamespace
())
{
return
_n
amespaceIcon
;
return
N
amespaceIcon
Type
;
}
else
if
(
symbol
->
isUsingNamespaceDirective
()
||
symbol
->
isUsingDeclaration
())
{
// TODO: Might be nice to have a different icons for these things
return
_n
amespaceIcon
;
return
N
amespaceIcon
Type
;
}
return
QIcon
();
}
QIcon
Icons
::
keywordIcon
()
const
{
return
_keywordIcon
;
return
UnknownIconType
;
}
QIcon
Icons
::
macroIcon
(
)
const
QIcon
Icons
::
iconForType
(
IconType
type
)
const
{
return
_macroIcon
;
switch
(
type
)
{
case
ClassIconType
:
return
_classIcon
;
case
EnumIconType
:
return
_enumIcon
;
case
EnumeratorIconType
:
return
_enumeratorIcon
;
case
FuncPublicIconType
:
return
_funcPublicIcon
;
case
FuncProtectedIconType
:
return
_funcProtectedIcon
;
case
FuncPrivateIconType
:
return
_funcPrivateIcon
;
case
NamespaceIconType
:
return
_namespaceIcon
;
case
VarPublicIconType
:
return
_varPublicIcon
;
case
VarProtectedIconType
:
return
_varProtectedIcon
;
case
VarPrivateIconType
:
return
_varPrivateIcon
;
case
SignalIconType
:
return
_signalIcon
;
case
SlotPublicIconType
:
return
_slotPublicIcon
;
case
SlotProtectedIconType
:
return
_slotProtectedIcon
;
case
SlotPrivateIconType
:
return
_slotPrivateIcon
;
case
KeywordIconType
:
return
_keywordIcon
;
case
MacroIconType
:
return
_macroIcon
;
default:
break
;
}
return
QIcon
();
}
src/libs/cplusplus/Icons.h
View file @
915ba478
...
...
@@ -48,6 +48,29 @@ public:
QIcon
keywordIcon
()
const
;
QIcon
macroIcon
()
const
;
enum
IconType
{
ClassIconType
=
0
,
EnumIconType
,
EnumeratorIconType
,
FuncPublicIconType
,
FuncProtectedIconType
,
FuncPrivateIconType
,
NamespaceIconType
,
VarPublicIconType
,
VarProtectedIconType
,
VarPrivateIconType
,
SignalIconType
,
SlotPublicIconType
,
SlotProtectedIconType
,
SlotPrivateIconType
,
KeywordIconType
,
MacroIconType
,
UnknownIconType
};
static
IconType
iconTypeForSymbol
(
const
Symbol
*
symbol
);
QIcon
iconForType
(
IconType
type
)
const
;
private:
QIcon
_classIcon
;
QIcon
_enumIcon
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment