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