Set XrefsDialog Parent (#4)

This commit is contained in:
Florian Märkl 2020-11-26 15:46:07 +01:00
parent a80221641e
commit b6ec01a7b0
No known key found for this signature in database
GPG Key ID: 125BC8A5A6A1E857
5 changed files with 8 additions and 8 deletions

View File

@ -8,7 +8,7 @@
#include <QJsonArray>
XrefsDialog::XrefsDialog(MainWindow *main, QWidget *parent, bool hideXrefFrom) :
XrefsDialog::XrefsDialog(MainWindow *parent, bool hideXrefFrom) :
QDialog(parent),
addr(0),
toModel(this),
@ -18,8 +18,8 @@ XrefsDialog::XrefsDialog(MainWindow *main, QWidget *parent, bool hideXrefFrom) :
ui->setupUi(this);
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
ui->toTreeWidget->setMainWindow(main);
ui->fromTreeWidget->setMainWindow(main);
ui->toTreeWidget->setMainWindow(parent);
ui->fromTreeWidget->setMainWindow(parent);
ui->toTreeWidget->setModel(&toModel);
ui->fromTreeWidget->setModel(&fromModel);

View File

@ -44,7 +44,7 @@ class XrefsDialog : public QDialog
Q_OBJECT
public:
explicit XrefsDialog(MainWindow *main, QWidget *parent, bool hideXrefFrom=false);
explicit XrefsDialog(MainWindow *parent, bool hideXrefFrom=false);
~XrefsDialog();
void fillRefsForAddress(RVA addr, QString name, bool whole_function);

View File

@ -85,7 +85,7 @@ void AddressableItemContextMenu::onActionCopyAddress()
void AddressableItemContextMenu::onActionShowXrefs()
{
emit xrefsTriggered();
XrefsDialog dialog(mainWindow, nullptr, true);
XrefsDialog dialog(mainWindow, true);
QString tmpName = name;
if (name.isEmpty()) {
name = RAddressString(offset);

View File

@ -469,7 +469,7 @@ void DecompilerContextMenu::actionXRefsTriggered()
if (!isReference()) {
return;
}
XrefsDialog dialog(mainWindow, nullptr);
XrefsDialog dialog(mainWindow);
QString displayString = (annotationHere->type == RZ_CODE_ANNOTATION_TYPE_FUNCTION_NAME) ? QString(
annotationHere->reference.name) : RAddressString(annotationHere->reference.offset);
dialog.fillRefsForAddress(annotationHere->reference.offset, displayString, false);

View File

@ -875,7 +875,7 @@ void DisassemblyContextMenu::on_actionSetFunctionVarTypes_triggered()
void DisassemblyContextMenu::on_actionXRefs_triggered()
{
XrefsDialog dialog(mainWindow, nullptr);
XrefsDialog dialog(mainWindow);
dialog.fillRefsForAddress(offset, RAddressString(offset), false);
dialog.exec();
}
@ -883,7 +883,7 @@ void DisassemblyContextMenu::on_actionXRefs_triggered()
void DisassemblyContextMenu::on_actionXRefsForVariables_triggered()
{
if (isHighlightedWordLocalVar()) {
XrefsDialog dialog(mainWindow, nullptr);
XrefsDialog dialog(mainWindow);
dialog.fillRefsForVariable(curHighlightedWord, offset);
dialog.exec();
}