cutter/src/widgets/ResourcesWidget.h

55 lines
1.4 KiB
C
Raw Normal View History

2018-02-04 14:32:18 +00:00
#ifndef RESOURCESWIDGET_H
#define RESOURCESWIDGET_H
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include "CutterTreeView.h"
#include "common/AddressableItemModel.h"
#include "widgets/ListDockWidget.h"
2018-02-04 14:32:18 +00:00
class MainWindow;
class ResourcesWidget;
class ResourcesModel : public AddressableItemModel<QAbstractListModel>
2018-02-04 14:32:18 +00:00
{
Q_OBJECT
friend ResourcesWidget;
2018-02-04 14:32:18 +00:00
private:
QList<ResourcesDescription> *resources;
public:
enum Columns { INDEX = 0, NAME, VADDR, TYPE, SIZE, LANG, COUNT };
explicit ResourcesModel(QList<ResourcesDescription> *resources, 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;
2018-03-21 20:32:32 +00:00
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
RVA address(const QModelIndex &index) const override;
2018-02-04 14:32:18 +00:00
};
class ResourcesWidget : public ListDockWidget
2018-02-04 14:32:18 +00:00
{
Q_OBJECT
private:
ResourcesModel *model;
AddressableFilterProxyModel *filterModel;
CutterTreeView *view;
2018-02-04 14:32:18 +00:00
QList<ResourcesDescription> resources;
public:
explicit ResourcesWidget(MainWindow *main, QAction *action = nullptr);
2018-02-04 14:32:18 +00:00
private slots:
void refreshResources();
};
#endif // RESOURCESWIDGET_H