RelocsWidget: Change from QTableView to QTreeView (#439)

This commit is contained in:
Abdel-Rahman A 2018-04-12 08:33:03 +02:00 committed by xarkes
parent e1f17db235
commit 05fe4e60ea
3 changed files with 9 additions and 15 deletions

View File

@ -77,7 +77,7 @@ RelocsWidget::RelocsWidget(MainWindow *main, QAction *action) :
{
ui->setupUi(this);
ui->relocsTableView->setModel(model);
ui->relocsTreeView->setModel(model);
setScrollMode();
@ -86,7 +86,7 @@ RelocsWidget::RelocsWidget(MainWindow *main, QAction *action) :
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());
}
@ -96,10 +96,10 @@ void RelocsWidget::refreshRelocs()
model->beginReload();
relocs = Core()->getAllRelocs();
model->endReload();
ui->relocsTableView->resizeColumnsToContents();
qhelpers::adjustColumns(ui->relocsTreeView, 3, 0);
}
void RelocsWidget::setScrollMode()
{
qhelpers::setVerticalScrollMode(ui->relocsTableView);
qhelpers::setVerticalScrollMode(ui->relocsTreeView);
}

View File

@ -45,7 +45,7 @@ public:
~RelocsWidget();
private slots:
void on_relocsTableView_doubleClicked(const QModelIndex &index);
void on_relocsTreeView_doubleClicked(const QModelIndex &index);
void refreshRelocs();
private:

View File

@ -28,9 +28,9 @@
<number>0</number>
</property>
<item>
<widget class="QTableView" name="relocsTableView">
<widget class="QTreeView" name="relocsTreeView">
<property name="styleSheet">
<string notr="true">QTableView::item
<string notr="true">QTreeView::item
{
padding-top: 1px;
padding-bottom: 1px;
@ -39,18 +39,12 @@
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="showGrid">
<bool>false</bool>
<property name="indentation">
<number>8</number>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>