forked from qt-creator/qt-creator
CppTypeHierarchy: Don't create/store QIcon in non-GUI thread
Store Utils::CodeModelIcon::Type enum instead. Drop unneeded CPlusPlus::Symbol *declaration from CppDeclarableElement. Remove unused CppClass::operator==(). Task-number: QTCREATORBUG-28529 Change-Id: Ie3487fa5f73d714ef375c42f1e64023ccc4194ee Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -94,8 +94,7 @@ public:
|
||||
// CppDeclarableElement
|
||||
CppDeclarableElement::CppDeclarableElement(Symbol *declaration)
|
||||
: CppElement()
|
||||
, declaration(declaration)
|
||||
, icon(Icons::iconForSymbol(declaration))
|
||||
, iconType(Icons::iconTypeForSymbol(declaration))
|
||||
{
|
||||
Overview overview;
|
||||
overview.showArgumentNames = true;
|
||||
@@ -135,11 +134,6 @@ CppClass::CppClass(Symbol *declaration) : CppDeclarableElement(declaration)
|
||||
tooltip = qualifiedName;
|
||||
}
|
||||
|
||||
bool CppClass::operator==(const CppClass &other)
|
||||
{
|
||||
return this->declaration == other.declaration;
|
||||
}
|
||||
|
||||
CppClass *CppClass::toCppClass()
|
||||
{
|
||||
return this;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <coreplugin/helpitem.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <cplusplus/CppDocument.h>
|
||||
|
||||
@@ -76,11 +77,10 @@ public:
|
||||
explicit CppDeclarableElement(CPlusPlus::Symbol *declaration);
|
||||
|
||||
public:
|
||||
CPlusPlus::Symbol *declaration;
|
||||
Utils::CodeModelIcon::Type iconType;
|
||||
QString name;
|
||||
QString qualifiedName;
|
||||
QString type;
|
||||
QIcon icon;
|
||||
};
|
||||
|
||||
class CppClass : public CppDeclarableElement
|
||||
@@ -89,8 +89,6 @@ public:
|
||||
CppClass();
|
||||
explicit CppClass(CPlusPlus::Symbol *declaration);
|
||||
|
||||
bool operator==(const CppClass &other);
|
||||
|
||||
CppClass *toCppClass() final;
|
||||
|
||||
void lookupBases(QFutureInterfaceBase &futureInterface,
|
||||
|
||||
@@ -44,7 +44,7 @@ QStandardItem *itemForClass(const CppClass &cppClass)
|
||||
item->setData(cppClass.name, Qt::DisplayRole);
|
||||
if (cppClass.name != cppClass.qualifiedName)
|
||||
item->setData(cppClass.qualifiedName, AnnotationRole);
|
||||
item->setData(cppClass.icon, Qt::DecorationRole);
|
||||
item->setData(iconForType(cppClass.iconType), Qt::DecorationRole);
|
||||
QVariant link;
|
||||
link.setValue(Link(cppClass.link));
|
||||
item->setData(link, LinkRole);
|
||||
|
||||
Reference in New Issue
Block a user