Skip to content
GitLab
Menu
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
33b11f23
Commit
33b11f23
authored
May 19, 2009
by
Roberto Raggi
Browse files
Fixed prettyprint of template types.
parent
339cb434
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/Overview.cpp
View file @
33b11f23
...
...
@@ -39,12 +39,23 @@ Overview::Overview()
_showArgumentNames
(
false
),
_showReturnTypes
(
false
),
_showFunctionSignatures
(
true
),
_showFullyQualifiedNames
(
false
)
_showFullyQualifiedNames
(
false
),
_richText
(
false
)
{
}
Overview
::~
Overview
()
{
}
bool
Overview
::
richText
()
const
{
return
_richText
;
}
void
Overview
::
setRichText
(
bool
richText
)
{
_richText
=
richText
;
}
bool
Overview
::
showArgumentNames
()
const
{
return
_showArgumentNames
;
...
...
src/libs/cplusplus/Overview.h
View file @
33b11f23
...
...
@@ -44,6 +44,9 @@ public:
Overview
();
~
Overview
();
bool
richText
()
const
;
void
setRichText
(
bool
richText
);
bool
showArgumentNames
()
const
;
void
setShowArgumentNames
(
bool
showArgumentNames
);
...
...
@@ -77,6 +80,7 @@ private:
bool
_showReturnTypes
:
1
;
bool
_showFunctionSignatures
:
1
;
bool
_showFullyQualifiedNames
:
1
;
bool
_richText
:
1
;
};
}
// end of namespace CPlusPlus
...
...
src/libs/cplusplus/TypePrettyPrinter.cpp
View file @
33b11f23
...
...
@@ -35,6 +35,7 @@
#include <Scope.h>
#include <QStringList>
#include <QtDebug>
#include <QTextDocument> // Qt::escape()
using
namespace
CPlusPlus
;
...
...
@@ -54,7 +55,7 @@ static QString fullyQualifiedName(Symbol *symbol, const Overview *overview)
}
if
(
!
owner
->
name
())
nestedNameSpecifier
.
prepend
(
QLatin1String
(
"
<
anonymous
>
"
));
nestedNameSpecifier
.
prepend
(
QLatin1String
(
"
$
anonymous"
));
else
{
const
QString
name
=
overview
->
prettyName
(
owner
->
name
());
...
...
@@ -325,7 +326,7 @@ void TypePrettyPrinter::visit(Function *type)
if
(
Argument
*
arg
=
type
->
argumentAt
(
index
)
->
asArgument
())
{
if
(
index
+
1
==
_overview
->
markArgument
())
out
(
QLatin1String
(
"<b>"
));
out
Plain
(
QLatin1String
(
"<b>"
));
Name
*
name
=
0
;
...
...
@@ -335,7 +336,7 @@ void TypePrettyPrinter::visit(Function *type)
out
(
argumentText
(
arg
->
type
(),
name
));
if
(
index
+
1
==
_overview
->
markArgument
())
out
(
QLatin1String
(
"</b>"
));
out
Plain
(
QLatin1String
(
"</b>"
));
}
}
...
...
@@ -367,9 +368,17 @@ void TypePrettyPrinter::space()
_text
+=
QLatin1Char
(
' '
);
}
void
TypePrettyPrinter
::
out
(
const
QString
&
text
)
void
TypePrettyPrinter
::
out
Plain
(
const
QString
&
text
)
{
_text
+=
text
;
}
void
TypePrettyPrinter
::
out
(
const
QString
&
text
)
{
if
(
overview
()
->
richText
())
_text
+=
Qt
::
escape
(
text
);
else
_text
+=
text
;
}
void
TypePrettyPrinter
::
out
(
const
QChar
&
ch
)
{
_text
+=
ch
;
}
...
...
src/libs/cplusplus/TypePrettyPrinter.h
View file @
33b11f23
...
...
@@ -72,6 +72,7 @@ protected:
virtual
void
visit
(
Enum
*
type
);
void
space
();
void
outPlain
(
const
QString
&
text
);
void
out
(
const
QString
&
text
);
void
out
(
const
QChar
&
ch
);
void
outCV
(
const
FullySpecifiedType
&
ty
);
...
...
src/plugins/cpptools/cppcodecompletion.cpp
View file @
33b11f23
...
...
@@ -382,6 +382,7 @@ bool FunctionArgumentWidget::eventFilter(QObject *obj, QEvent *e)
void
FunctionArgumentWidget
::
updateHintText
()
{
Overview
overview
;
overview
.
setRichText
(
true
);
overview
.
setShowReturnTypes
(
true
);
overview
.
setShowArgumentNames
(
true
);
overview
.
setMarkArgument
(
m_currentarg
+
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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