mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-30 00:05:05 +00:00
Change column oreder in xrefs (#2068)
This commit is contained in:
parent
e38ff14bac
commit
c93681649b
@ -25,7 +25,7 @@ XrefsDialog::XrefsDialog(MainWindow *main, QWidget *parent) :
|
||||
ui->fromTreeWidget->setModel(&fromModel);
|
||||
|
||||
// Modify the splitter's location to show more Disassembly instead of empty space. Not possible via Designer
|
||||
ui->splitter->setSizes(QList<int>() << 100 << 200);
|
||||
ui->splitter->setSizes(QList<int>() << 300 << 400);
|
||||
|
||||
// Increase asm text edit margin
|
||||
QTextDocument *asm_docu = ui->previewTextEdit->document();
|
||||
@ -212,14 +212,14 @@ QVariant XrefModel::data(const QModelIndex &index, int role) const
|
||||
switch (index.column()) {
|
||||
case OFFSET:
|
||||
return to ? xref.from_str : xref.to_str;
|
||||
case TYPE:
|
||||
return xrefTypeString(xref.type);
|
||||
case CODE:
|
||||
if (to || xref.type != "DATA") {
|
||||
return Core()->disassembleSingleInstruction(xref.from);
|
||||
} else {
|
||||
return QString();
|
||||
}
|
||||
case TYPE:
|
||||
return xrefTypeString(xref.type);
|
||||
}
|
||||
return QVariant();
|
||||
case FlagDescriptionRole:
|
||||
@ -239,10 +239,10 @@ QVariant XrefModel::headerData(int section, Qt::Orientation orientation, int rol
|
||||
switch (section) {
|
||||
case OFFSET:
|
||||
return tr("Address");
|
||||
case CODE:
|
||||
return tr("Code");
|
||||
case TYPE:
|
||||
return tr("Type");
|
||||
case CODE:
|
||||
return tr("Code");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ private:
|
||||
QList<XrefDescription> xrefs;
|
||||
bool to;
|
||||
public:
|
||||
enum Columns { OFFSET = 0, CODE, TYPE, COUNT };
|
||||
enum Columns { OFFSET = 0, TYPE, CODE, COUNT };
|
||||
static const int FlagDescriptionRole = Qt::UserRole;
|
||||
|
||||
XrefModel(QObject *parent = nullptr);
|
||||
|
@ -60,6 +60,9 @@
|
||||
<property name="indentation">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -80,6 +83,9 @@
|
||||
<property name="indentation">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user