mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 16:47:26 +00:00
RelocsWidget: Change from QTableView to QTreeView (#439)
This commit is contained in:
parent
e1f17db235
commit
05fe4e60ea
@ -77,7 +77,7 @@ RelocsWidget::RelocsWidget(MainWindow *main, QAction *action) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->relocsTableView->setModel(model);
|
ui->relocsTreeView->setModel(model);
|
||||||
|
|
||||||
setScrollMode();
|
setScrollMode();
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ RelocsWidget::RelocsWidget(MainWindow *main, QAction *action) :
|
|||||||
|
|
||||||
RelocsWidget::~RelocsWidget() {}
|
RelocsWidget::~RelocsWidget() {}
|
||||||
|
|
||||||
void RelocsWidget::on_relocsTableView_doubleClicked(const QModelIndex &index)
|
void RelocsWidget::on_relocsTreeView_doubleClicked(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
Core()->seek(index.data(RelocsModel::AddressRole).toLongLong());
|
Core()->seek(index.data(RelocsModel::AddressRole).toLongLong());
|
||||||
}
|
}
|
||||||
@ -96,10 +96,10 @@ void RelocsWidget::refreshRelocs()
|
|||||||
model->beginReload();
|
model->beginReload();
|
||||||
relocs = Core()->getAllRelocs();
|
relocs = Core()->getAllRelocs();
|
||||||
model->endReload();
|
model->endReload();
|
||||||
ui->relocsTableView->resizeColumnsToContents();
|
qhelpers::adjustColumns(ui->relocsTreeView, 3, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RelocsWidget::setScrollMode()
|
void RelocsWidget::setScrollMode()
|
||||||
{
|
{
|
||||||
qhelpers::setVerticalScrollMode(ui->relocsTableView);
|
qhelpers::setVerticalScrollMode(ui->relocsTreeView);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
~RelocsWidget();
|
~RelocsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_relocsTableView_doubleClicked(const QModelIndex &index);
|
void on_relocsTreeView_doubleClicked(const QModelIndex &index);
|
||||||
void refreshRelocs();
|
void refreshRelocs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -28,9 +28,9 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableView" name="relocsTableView">
|
<widget class="QTreeView" name="relocsTreeView">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QTableView::item
|
<string notr="true">QTreeView::item
|
||||||
{
|
{
|
||||||
padding-top: 1px;
|
padding-top: 1px;
|
||||||
padding-bottom: 1px;
|
padding-bottom: 1px;
|
||||||
@ -39,18 +39,12 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="showGrid">
|
<property name="indentation">
|
||||||
<bool>false</bool>
|
<number>8</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="sortingEnabled">
|
<property name="sortingEnabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="horizontalHeaderStretchLastSection">
|
|
||||||
<bool>true</bool>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="verticalHeaderVisible">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user