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::CppDeclarableElement(Symbol *declaration)
|
CppDeclarableElement::CppDeclarableElement(Symbol *declaration)
|
||||||
: CppElement()
|
: CppElement()
|
||||||
, declaration(declaration)
|
, iconType(Icons::iconTypeForSymbol(declaration))
|
||||||
, icon(Icons::iconForSymbol(declaration))
|
|
||||||
{
|
{
|
||||||
Overview overview;
|
Overview overview;
|
||||||
overview.showArgumentNames = true;
|
overview.showArgumentNames = true;
|
||||||
@@ -135,11 +134,6 @@ CppClass::CppClass(Symbol *declaration) : CppDeclarableElement(declaration)
|
|||||||
tooltip = qualifiedName;
|
tooltip = qualifiedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CppClass::operator==(const CppClass &other)
|
|
||||||
{
|
|
||||||
return this->declaration == other.declaration;
|
|
||||||
}
|
|
||||||
|
|
||||||
CppClass *CppClass::toCppClass()
|
CppClass *CppClass::toCppClass()
|
||||||
{
|
{
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/helpitem.h>
|
#include <coreplugin/helpitem.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <cplusplus/CppDocument.h>
|
#include <cplusplus/CppDocument.h>
|
||||||
|
|
||||||
@@ -76,11 +77,10 @@ public:
|
|||||||
explicit CppDeclarableElement(CPlusPlus::Symbol *declaration);
|
explicit CppDeclarableElement(CPlusPlus::Symbol *declaration);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CPlusPlus::Symbol *declaration;
|
Utils::CodeModelIcon::Type iconType;
|
||||||
QString name;
|
QString name;
|
||||||
QString qualifiedName;
|
QString qualifiedName;
|
||||||
QString type;
|
QString type;
|
||||||
QIcon icon;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CppClass : public CppDeclarableElement
|
class CppClass : public CppDeclarableElement
|
||||||
@@ -89,8 +89,6 @@ public:
|
|||||||
CppClass();
|
CppClass();
|
||||||
explicit CppClass(CPlusPlus::Symbol *declaration);
|
explicit CppClass(CPlusPlus::Symbol *declaration);
|
||||||
|
|
||||||
bool operator==(const CppClass &other);
|
|
||||||
|
|
||||||
CppClass *toCppClass() final;
|
CppClass *toCppClass() final;
|
||||||
|
|
||||||
void lookupBases(QFutureInterfaceBase &futureInterface,
|
void lookupBases(QFutureInterfaceBase &futureInterface,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ QStandardItem *itemForClass(const CppClass &cppClass)
|
|||||||
item->setData(cppClass.name, Qt::DisplayRole);
|
item->setData(cppClass.name, Qt::DisplayRole);
|
||||||
if (cppClass.name != cppClass.qualifiedName)
|
if (cppClass.name != cppClass.qualifiedName)
|
||||||
item->setData(cppClass.qualifiedName, AnnotationRole);
|
item->setData(cppClass.qualifiedName, AnnotationRole);
|
||||||
item->setData(cppClass.icon, Qt::DecorationRole);
|
item->setData(iconForType(cppClass.iconType), Qt::DecorationRole);
|
||||||
QVariant link;
|
QVariant link;
|
||||||
link.setValue(Link(cppClass.link));
|
link.setValue(Link(cppClass.link));
|
||||||
item->setData(link, LinkRole);
|
item->setData(link, LinkRole);
|
||||||
|
|||||||
Reference in New Issue
Block a user