#ifndef EXPORTSWIDGET_H #define EXPORTSWIDGET_H #include #include "core/Cutter.h" #include "CutterDockWidget.h" #include "widgets/ListDockWidget.h" #include #include class MainWindow; class QTreeWidget; class ExportsWidget; namespace Ui { class ExportsWidget; } class ExportsModel : public AddressableItemModel { Q_OBJECT friend ExportsWidget; private: QList *exports; public: enum Column { OffsetColumn = 0, SizeColumn, TypeColumn, NameColumn, ColumnCount }; enum Role { ExportDescriptionRole = Qt::UserRole }; ExportsModel(QList *exports, QObject *parent = nullptr); int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; RVA address(const QModelIndex &index) const override; QString name(const QModelIndex &index) const override; }; class ExportsProxyModel : public AddressableFilterProxyModel { Q_OBJECT public: ExportsProxyModel(ExportsModel *source_model, QObject *parent = nullptr); protected: bool filterAcceptsRow(int row, const QModelIndex &parent) const override; bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; }; class ExportsWidget : public ListDockWidget { Q_OBJECT public: explicit ExportsWidget(MainWindow *main); ~ExportsWidget(); private slots: void refreshExports(); private: ExportsModel *exportsModel; ExportsProxyModel *exportsProxyModel; QList exports; }; #endif // EXPORTSWIDGET_H