MCPcopy Create free account
hub / github.com/KDE/kdevelop / text

Method text

plugins/quickopen/duchainitemquickopen.cpp:33–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33QString DUChainItemData::text() const
34{
35 DUChainReadLocker lock;
36 Declaration* decl = m_item.m_item.data();
37 if (!decl) {
38 return i18n("Not available any more: %1", m_item.m_text);
39 }
40
41 if (auto* def = dynamic_cast<FunctionDefinition*>(decl)) {
42 if (def->declaration()) {
43 decl = def->declaration();
44 }
45 }
46
47 QString text = decl->qualifiedIdentifier().toString();
48
49 if (!decl->abstractType()) {
50 //With simplified representation, still mark functions as such by adding parens
51 if (dynamic_cast<AbstractFunctionDeclaration*>(decl)) {
52 text += QLatin1String("(...)");
53 }
54 } else if (TypePtr<FunctionType> function = decl->type<FunctionType>()) {
55 text += function->partToString(FunctionType::SignatureArguments);
56 }
57
58 return text;
59}
60
61QList<QVariant> DUChainItemData::highlighting() const
62{

Callers

nothing calls this directly

Calls 6

partToStringMethod · 0.80
dataMethod · 0.45
declarationMethod · 0.45
toStringMethod · 0.45
qualifiedIdentifierMethod · 0.45
abstractTypeMethod · 0.45

Tested by

no test coverage detected