diff options
| author | Peter LaFosse <peter@vector35.com> | 2020-09-15 11:30:55 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2020-09-15 12:54:02 -0400 |
| commit | 7bca065af179f88e47d547cbfeff3009bbcd8c22 (patch) | |
| tree | 14d5cafa2eec929e1efa49018f5dc631e4eea7f1 | |
| parent | eb0aed7c4b15c37c46b15b5d9e32ceb93f2e1e95 (diff) | |
Fix symbol list perf issue
| -rw-r--r-- | ui/symbollist.h | 14 |
1 files changed, 14 insertions, 0 deletions
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 <QtCore/QAbstractItemModel> #include <QtCore/QTimer> #include <QtWidgets/QLineEdit> +#include <QtWidgets/QStyledItemDelegate> #include <vector> #include <deque> #include <set> @@ -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; |
