mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 08:37:26 +00:00
parent
efc7a7e90e
commit
17f7c0b593
@ -1,4 +1,5 @@
|
||||
#include <QShortcut>
|
||||
#include <QModelIndex>
|
||||
|
||||
#include "VTablesWidget.h"
|
||||
#include "ui_VTablesWidget.h"
|
||||
@ -48,6 +49,8 @@ QVariant VTableModel::data(const QModelIndex &index, int role) const
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case VTableDescriptionRole:
|
||||
return QVariant::fromValue(res);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -65,6 +68,11 @@ QVariant VTableModel::data(const QModelIndex &index, int role) const
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case VTableDescriptionRole:
|
||||
{
|
||||
const VTableDescription &res = vtables->at(index.row());
|
||||
return QVariant::fromValue(res);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -177,3 +185,12 @@ void VTablesWidget::refreshVTables()
|
||||
|
||||
ui->vTableTreeView->setColumnWidth(0, 200);
|
||||
}
|
||||
|
||||
void VTablesWidget::on_vTableTreeView_doubleClicked(const QModelIndex &index)
|
||||
{
|
||||
QModelIndex parent = index.parent();
|
||||
if(parent.isValid())
|
||||
CutterCore::getInstance()->seek(index.data(VTableModel::VTableDescriptionRole).value<ClassMethodDescription>().addr);
|
||||
else
|
||||
CutterCore::getInstance()->seek(index.data(VTableModel::VTableDescriptionRole).value<VTableDescription>().addr);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ private:
|
||||
|
||||
public:
|
||||
enum Columns { NAME = 0, ADDRESS, COUNT };
|
||||
static const int VTableDescriptionRole = Qt::UserRole;
|
||||
|
||||
VTableModel(QList<VTableDescription> *vtables, QObject* parent = nullptr);
|
||||
|
||||
@ -58,6 +59,7 @@ public:
|
||||
|
||||
private slots:
|
||||
void refreshVTables();
|
||||
void on_vTableTreeView_doubleClicked(const QModelIndex &index);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::VTablesWidget> ui;
|
||||
|
Loading…
Reference in New Issue
Block a user