From 7bca065af179f88e47d547cbfeff3009bbcd8c22 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Tue, 15 Sep 2020 11:30:55 -0400 Subject: Fix symbol list perf issue --- ui/symbollist.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ui/symbollist.h b/ui/symbollist.h index 21f30d0b..ae2ee7ff 100644 --- a/ui/symbollist.h +++ b/ui/symbollist.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -19,6 +20,18 @@ class SymbolsView; static std::string emptyArch; +class BINARYNINJAUIAPI SymbolListDelegate: public QStyledItemDelegate +{ + Q_OBJECT + QFont m_font; + int m_height, m_charWidth; + +public: + SymbolListDelegate(QWidget* parent); + void updateFonts(); + virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; +}; + class BINARYNINJAUIAPI SymbolListModel: public QAbstractItemModel, public BinaryNinja::BinaryDataNotification { Q_OBJECT @@ -276,6 +289,7 @@ class BINARYNINJAUIAPI SymbolList: public QListView, public FilterTarget BinaryViewRef m_data; SymbolsView* m_functionsView; SymbolListModel* m_list; + SymbolListDelegate* m_delegate; QTimer* m_updateTimer; bool m_disableScrollToFunction; -- cgit v1.3.1