mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 05:45:27 +00:00
parent
085b858bb6
commit
ba3f655a9f
@ -363,7 +363,11 @@ void CutterCore::seek(ut64 offset)
|
|||||||
|
|
||||||
void CutterCore::seek(QString offset)
|
void CutterCore::seek(QString offset)
|
||||||
{
|
{
|
||||||
seek(offset.toULongLong());
|
bool converted;
|
||||||
|
auto s = offset.toULongLong(&converted, 16);
|
||||||
|
if (!converted)
|
||||||
|
s = offset.toULongLong();
|
||||||
|
seek(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CutterCore::seekPrev()
|
void CutterCore::seekPrev()
|
||||||
|
@ -378,7 +378,7 @@ FunctionsWidget::FunctionsWidget(MainWindow *main, QWidget *parent) :
|
|||||||
connect(ui->functionsTreeView, SIGNAL(customContextMenuRequested(const QPoint &)),
|
connect(ui->functionsTreeView, SIGNAL(customContextMenuRequested(const QPoint &)),
|
||||||
this, SLOT(showFunctionsContextMenu(const QPoint &)));
|
this, SLOT(showFunctionsContextMenu(const QPoint &)));
|
||||||
|
|
||||||
connect(ui->functionsTreeView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(functionsTreeView_doubleClicked(const QModelIndex &)));
|
connect(ui->functionsTreeView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(onFunctionsDoubleClicked(const QModelIndex &)));
|
||||||
|
|
||||||
// Use a custom context menu on the dock title bar
|
// Use a custom context menu on the dock title bar
|
||||||
//this->title_bar = this->titleBarWidget();
|
//this->title_bar = this->titleBarWidget();
|
||||||
@ -411,10 +411,10 @@ void FunctionsWidget::refreshTree()
|
|||||||
ui->functionsTreeView->resizeColumnToContents(2);
|
ui->functionsTreeView->resizeColumnToContents(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FunctionsWidget::functionsTreeView_doubleClicked(const QModelIndex &index)
|
void FunctionsWidget::onFunctionsDoubleClicked(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
FunctionDescription function = index.data(FunctionModel::FunctionDescriptionRole).value<FunctionDescription>();
|
FunctionDescription function = index.data(FunctionModel::FunctionDescriptionRole).value<FunctionDescription>();
|
||||||
CutterCore::getInstance()->seek(function.offset);
|
Core()->seek(function.offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FunctionsWidget::showFunctionsContextMenu(const QPoint &pt)
|
void FunctionsWidget::showFunctionsContextMenu(const QPoint &pt)
|
||||||
|
@ -92,7 +92,7 @@ public:
|
|||||||
~FunctionsWidget();
|
~FunctionsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void functionsTreeView_doubleClicked(const QModelIndex &index);
|
void onFunctionsDoubleClicked(const QModelIndex &index);
|
||||||
void showFunctionsContextMenu(const QPoint &pt);
|
void showFunctionsContextMenu(const QPoint &pt);
|
||||||
|
|
||||||
void on_actionDisasAdd_comment_triggered();
|
void on_actionDisasAdd_comment_triggered();
|
||||||
|
@ -16,6 +16,8 @@ SectionsWidget::SectionsWidget(MainWindow *main, QWidget *parent) :
|
|||||||
setupViews();
|
setupViews();
|
||||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||||
|
|
||||||
|
connect(this->tree, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(onSectionsDoubleClicked(const QModelIndex &)));
|
||||||
|
|
||||||
tree->sortByColumn(0, Qt::AscendingOrder);
|
tree->sortByColumn(0, Qt::AscendingOrder);
|
||||||
|
|
||||||
connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshSections()));
|
connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshSections()));
|
||||||
@ -92,3 +94,10 @@ void SectionsWidget::fillSections(int row, const SectionDescription §ion)
|
|||||||
tempItem->setData(0, Qt::DecorationRole, colors[row % colors.size()]);
|
tempItem->setData(0, Qt::DecorationRole, colors[row % colors.size()]);
|
||||||
this->tree->insertTopLevelItem(0, tempItem);
|
this->tree->insertTopLevelItem(0, tempItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SectionsWidget::onSectionsDoubleClicked(const QModelIndex &index)
|
||||||
|
{
|
||||||
|
QTreeWidgetItem* section = tree->topLevelItem(index.row());
|
||||||
|
auto addr = section->text(2);
|
||||||
|
Core()->seek(addr);
|
||||||
|
}
|
||||||
|
@ -26,6 +26,8 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void refreshSections();
|
void refreshSections();
|
||||||
|
|
||||||
|
void onSectionsDoubleClicked(const QModelIndex &index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QAbstractItemView *pieChart;
|
QAbstractItemView *pieChart;
|
||||||
QItemSelectionModel *selectionModel;
|
QItemSelectionModel *selectionModel;
|
||||||
|
Loading…
Reference in New Issue
Block a user