From ad4cae6e2ca1a9c7e58253335b614eada4e25d67 Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Fri, 3 May 2024 20:16:26 +0200 Subject: [PATCH] no need for `setVisible(true)` right after creating. Added some initial tree update, other minor things --- src/QtHelpers/WidgetDatabaseView.cpp | 3 - src/Views/ViewCharacterDB.cpp | 2 +- src/Views/ViewEntities.cpp | 18 ++-- src/Views/ViewEntity.cpp | 126 ++++++++++++--------------- src/Views/ViewJournalPage.cpp | 5 +- src/Views/ViewLevelGen.cpp | 27 ++---- src/Views/ViewParticleDB.cpp | 2 +- src/Views/ViewStdMap.cpp | 10 +-- src/Views/ViewStdVector.cpp | 6 +- src/Views/ViewStringsTable.cpp | 4 +- src/Views/ViewStruct.cpp | 5 +- src/Views/ViewVirtualFunctions.cpp | 1 - 12 files changed, 84 insertions(+), 125 deletions(-) diff --git a/src/QtHelpers/WidgetDatabaseView.cpp b/src/QtHelpers/WidgetDatabaseView.cpp index 1e8be09..a4ff08c 100644 --- a/src/QtHelpers/WidgetDatabaseView.cpp +++ b/src/QtHelpers/WidgetDatabaseView.cpp @@ -60,7 +60,6 @@ S2Plugin::WidgetDatabaseView::WidgetDatabaseView(MemoryFieldType type, QWidget* mSearchLineEdit->setPlaceholderText("Search"); topLayout->addWidget(mSearchLineEdit); QObject::connect(mSearchLineEdit, &QLineEdit::returnPressed, this, &WidgetDatabaseView::searchFieldReturnPressed); - mSearchLineEdit->setVisible(false); auto labelButton = new QPushButton("Label", this); QObject::connect(labelButton, &QPushButton::clicked, this, &WidgetDatabaseView::label); @@ -128,9 +127,7 @@ S2Plugin::WidgetDatabaseView::WidgetDatabaseView(MemoryFieldType type, QWidget* tabCompare->layout()->addWidget(mCompareTreeWidget); } - mSearchLineEdit->setVisible(true); mSearchLineEdit->setFocus(); - mMainTreeView->setVisible(true); } QSize S2Plugin::WidgetDatabaseView::minimumSizeHint() const diff --git a/src/Views/ViewCharacterDB.cpp b/src/Views/ViewCharacterDB.cpp index 2bb8d56..9a8d747 100644 --- a/src/Views/ViewCharacterDB.cpp +++ b/src/Views/ViewCharacterDB.cpp @@ -46,7 +46,7 @@ void S2Plugin::ViewCharacterDB::label() const auto& characterDB = Spelunky2::get()->get_CharacterDB(); auto offset = characterDB.addressOfIndex(0); // ptr uintptr_t indexOffset = model->data(model->index(0, gsColField), gsRoleMemoryAddress).toULongLong(); - size_t index = (indexOffset - offset) / characterDB.characterSize(); + uint8_t index = static_cast((indexOffset - offset) / characterDB.characterSize()); if (index < characterDB.charactersCount()) { name = '[' + characterDB.characterNamesStringList()[index].toStdString() + ']'; diff --git a/src/Views/ViewEntities.cpp b/src/Views/ViewEntities.cpp index 17821cd..5e01e8b 100644 --- a/src/Views/ViewEntities.cpp +++ b/src/Views/ViewEntities.cpp @@ -14,8 +14,11 @@ S2Plugin::ViewEntities::ViewEntities(QWidget* parent) : QWidget(parent) { - auto mainLayout = new QVBoxLayout(this); + setWindowIcon(getCavemanIcon()); + setWindowTitle("Entities"); + auto mainLayout = new QVBoxLayout(this); + mainLayout->setMargin(5); auto config = Configuration::get(); mLayer0Offset = config->offsetForField(MemoryFieldType::State, "layer0", Spelunky2::get()->get_StatePtr()); mLayer1Offset = config->offsetForField(MemoryFieldType::State, "layer1", Spelunky2::get()->get_StatePtr()); @@ -66,19 +69,12 @@ S2Plugin::ViewEntities::ViewEntities(QWidget* parent) : QWidget(parent) horLayout->addStretch(); mainLayout->addLayout(horLayout); } - mMainTreeView = new TreeViewMemoryFields(this); mMainTreeView->setEnableChangeHighlighting(false); - mainLayout->addWidget(mMainTreeView); - - setWindowIcon(getCavemanIcon()); - - mainLayout->setMargin(5); + mMainTreeView->activeColumns.disable(gsColComparisonValue).disable(gsColComparisonValueHex).disable(gsColMemoryAddressDelta).disable(gsColMemoryAddress).disable(gsColComment); - setWindowTitle("Entities"); - mMainTreeView->setVisible(true); + mainLayout->addWidget(mMainTreeView); - mMainTreeView->activeColumns.disable(gsColComparisonValue).disable(gsColComparisonValueHex).disable(gsColMemoryAddressDelta).disable(gsColMemoryAddress).disable(gsColComment); refreshEntities(); mFilterLineEdit->setFocus(); } @@ -206,11 +202,9 @@ void S2Plugin::ViewEntities::refreshEntities() checkbox.mCheckbox->setText(QString(checkbox.name + " (%1)").arg(field_count)); } setWindowTitle(QString("%1 Entities").arg(totalEntities)); - mMainTreeView->updateTableHeader(); mMainTreeView->setColumnWidth(gsColField, 145); mMainTreeView->setColumnWidth(gsColValueHex, 125); - mMainTreeView->setColumnWidth(gsColMemoryAddress, 125); mMainTreeView->setColumnWidth(gsColType, 100); mMainTreeView->setColumnWidth(gsColValue, 300); mMainTreeView->updateTree(); diff --git a/src/Views/ViewEntity.cpp b/src/Views/ViewEntity.cpp index ebde5f7..0401227 100644 --- a/src/Views/ViewEntity.cpp +++ b/src/Views/ViewEntity.cpp @@ -38,11 +38,7 @@ S2Plugin::ViewEntity::ViewEntity(size_t entityOffset, QWidget* parent) : QWidget initializeUI(); updateMemoryViewOffsetAndSize(); - mSpelunkyLevel->paintFloor(QColor(160, 160, 160)); - mSpelunkyLevel->paintEntity(mEntityPtr, QColor(222, 52, 235)); - mSpelunkyLevel->update(); auto entityClassName = Entity{mEntityPtr}.entityClassName(); - // the combobox is set as Entity by default, so we have to manually call interpretAsChanged if (entityClassName == "Entity") interpretAsChanged(QString::fromStdString(entityClassName)); @@ -57,7 +53,6 @@ void S2Plugin::ViewEntity::initializeUI() mainLayout->addLayout(topLayout); // TOP LAYOUT - auto autoRefresh = new WidgetAutorefresh("100", this); QObject::connect(autoRefresh, &WidgetAutorefresh::refresh, this, &ViewEntity::refreshEntity); topLayout->addWidget(autoRefresh); @@ -92,82 +87,73 @@ void S2Plugin::ViewEntity::initializeUI() QObject::connect(mMainTabWidget, &QTabWidget::currentChanged, this, &ViewEntity::tabChanged); mainLayout->addWidget(mMainTabWidget); - auto tabFields = new QWidget(); + mMainTreeView = new TreeViewMemoryFields(); auto tabMemory = new QWidget(); - auto tabLevel = new QWidget(); - auto tabCPP = new QWidget(); - tabFields->setLayout(new QVBoxLayout()); - tabFields->layout()->setMargin(0); + auto tabLevel = new QScrollArea(); + mCPPTextEdit = new QTextEdit(); + tabMemory->setLayout(new QHBoxLayout()); tabMemory->layout()->setMargin(0); - tabLevel->setLayout(new QVBoxLayout()); - tabLevel->layout()->setMargin(0); - tabCPP->setLayout(new QVBoxLayout()); - tabCPP->layout()->setMargin(0); - mMainTabWidget->addTab(tabFields, "Fields"); + mMainTabWidget->addTab(mMainTreeView, "Fields"); mMainTabWidget->addTab(tabMemory, "Memory"); mMainTabWidget->addTab(tabLevel, "Level"); - mMainTabWidget->addTab(tabCPP, "C++"); + mMainTabWidget->addTab(mCPPTextEdit, "C++"); // TAB FIELDS - mMainTreeView = new TreeViewMemoryFields(this); - mMainTreeView->setColumnWidth(gsColValue, 250); - mMainTreeView->setColumnWidth(gsColField, 175); - mMainTreeView->setColumnWidth(gsColValueHex, 125); - mMainTreeView->setColumnWidth(gsColMemoryAddress, 125); - mMainTreeView->setColumnWidth(gsColMemoryAddressDelta, 75); - mMainTreeView->setColumnWidth(gsColType, 100); - mMainTreeView->setVisible(false); - mMainTreeView->activeColumns.disable(gsColComparisonValue).disable(gsColComparisonValueHex); - mMainTreeView->updateTableHeader(); - mMainTreeView->setDragDropMode(QAbstractItemView::DragDropMode::DragDrop); - mMainTreeView->setAcceptDrops(true); - QObject::connect(mMainTreeView, &TreeViewMemoryFields::entityOffsetDropped, this, &ViewEntity::entityOffsetDropped); - tabFields->layout()->addWidget(mMainTreeView); - + { + mMainTreeView->setColumnWidth(gsColValue, 250); + mMainTreeView->setColumnWidth(gsColField, 175); + mMainTreeView->setColumnWidth(gsColValueHex, 125); + mMainTreeView->setColumnWidth(gsColMemoryAddress, 125); + mMainTreeView->setColumnWidth(gsColMemoryAddressDelta, 75); + mMainTreeView->setColumnWidth(gsColType, 100); + mMainTreeView->activeColumns.disable(gsColComparisonValue).disable(gsColComparisonValueHex); + mMainTreeView->updateTableHeader(); + mMainTreeView->setDragDropMode(QAbstractItemView::DragDropMode::DragDrop); + mMainTreeView->setAcceptDrops(true); + QObject::connect(mMainTreeView, &TreeViewMemoryFields::entityOffsetDropped, this, &ViewEntity::entityOffsetDropped); + } // TAB MEMORY - auto scroll = new QScrollArea(tabMemory); - mMemoryView = new WidgetMemoryView(scroll); - scroll->setStyleSheet("background-color: #fff;"); - scroll->setWidget(mMemoryView); - scroll->setVisible(true); - tabMemory->layout()->addWidget(scroll); - - mMemoryComparisonScrollArea = new QScrollArea(tabMemory); - mMemoryComparisonView = new WidgetMemoryView(mMemoryComparisonScrollArea); - mMemoryComparisonScrollArea->setStyleSheet("background-color: #fff;"); - mMemoryComparisonScrollArea->setWidget(mMemoryComparisonView); - mMemoryComparisonScrollArea->setVisible(true); - tabMemory->layout()->addWidget(mMemoryComparisonScrollArea); - mMemoryComparisonScrollArea->setVisible(false); - + { + auto scroll = new QScrollArea(tabMemory); + mMemoryView = new WidgetMemoryView(scroll); + scroll->setStyleSheet("background-color: #fff;"); + scroll->setWidget(mMemoryView); + tabMemory->layout()->addWidget(scroll); + + mMemoryComparisonScrollArea = new QScrollArea(tabMemory); + mMemoryComparisonView = new WidgetMemoryView(mMemoryComparisonScrollArea); + mMemoryComparisonScrollArea->setStyleSheet("background-color: #fff;"); + mMemoryComparisonScrollArea->setWidget(mMemoryComparisonView); + tabMemory->layout()->addWidget(mMemoryComparisonScrollArea); + mMemoryComparisonScrollArea->setVisible(false); + } // TAB LEVEL - scroll = new QScrollArea(tabLevel); - mSpelunkyLevel = new WidgetSpelunkyLevel(mEntityPtr, scroll); - scroll->setStyleSheet("background-color: #fff;"); - scroll->setWidget(mSpelunkyLevel); - scroll->setVisible(true); - tabLevel->layout()->addWidget(scroll); - + { + mSpelunkyLevel = new WidgetSpelunkyLevel(mEntityPtr, tabLevel); + mSpelunkyLevel->paintFloor(QColor(160, 160, 160)); + mSpelunkyLevel->paintEntity(mEntityPtr, QColor(222, 52, 235)); + tabLevel->setStyleSheet("background-color: #fff;"); + tabLevel->setWidget(mSpelunkyLevel); + } // TAB CPP - mCPPTextEdit = new QTextEdit(this); - mCPPTextEdit->setReadOnly(true); - auto font = QFont("Courier", 10); - font.setFixedPitch(true); - font.setStyleHint(QFont::Monospace); - auto fontMetrics = QFontMetrics(font); - mCPPTextEdit->setFont(font); - mCPPTextEdit->setTabStopWidth(4 * fontMetrics.width(' ')); - mCPPTextEdit->setLineWrapMode(QTextEdit::LineWrapMode::NoWrap); - QPalette palette = mCPPTextEdit->palette(); - palette.setColor(QPalette::Base, QColor("#1E1E1E")); - palette.setColor(QPalette::Text, QColor("#D4D4D4")); - mCPPTextEdit->setPalette(palette); - mCPPTextEdit->document()->setDocumentMargin(10); - mCPPSyntaxHighlighter = new CPPSyntaxHighlighter(mCPPTextEdit->document()); - - tabCPP->layout()->addWidget(mCPPTextEdit); + { + mCPPTextEdit->setReadOnly(true); + auto font = QFont("Courier", 10); + font.setFixedPitch(true); + font.setStyleHint(QFont::Monospace); + auto fontMetrics = QFontMetrics(font); + mCPPTextEdit->setFont(font); + mCPPTextEdit->setTabStopWidth(4 * fontMetrics.width(' ')); + mCPPTextEdit->setLineWrapMode(QTextEdit::LineWrapMode::NoWrap); + QPalette palette = mCPPTextEdit->palette(); + palette.setColor(QPalette::Base, QColor("#1E1E1E")); + palette.setColor(QPalette::Text, QColor("#D4D4D4")); + mCPPTextEdit->setPalette(palette); + mCPPTextEdit->document()->setDocumentMargin(10); + mCPPSyntaxHighlighter = new CPPSyntaxHighlighter(mCPPTextEdit->document()); + } mainLayout->setMargin(5); autoRefresh->toggleAutoRefresh(true); } diff --git a/src/Views/ViewJournalPage.cpp b/src/Views/ViewJournalPage.cpp index 59e2b1e..62242f1 100644 --- a/src/Views/ViewJournalPage.cpp +++ b/src/Views/ViewJournalPage.cpp @@ -16,6 +16,7 @@ S2Plugin::ViewJournalPage::ViewJournalPage(uintptr_t address, QWidget* parent) : setWindowTitle("JournalPage"); auto mainLayout = new QVBoxLayout(this); + mainLayout->setMargin(5); auto refreshLayout = new QHBoxLayout(); mainLayout->addLayout(refreshLayout); @@ -63,9 +64,7 @@ S2Plugin::ViewJournalPage::ViewJournalPage(uintptr_t address, QWidget* parent) : mMainTreeView->setColumnWidth(gsColMemoryAddressDelta, 75); mMainTreeView->setColumnWidth(gsColType, 100); mMainTreeView->updateTableHeader(); - - mainLayout->setMargin(5); - mMainTreeView->setVisible(true); + mMainTreeView->updateTree(0, 0, true); autoRefresh->toggleAutoRefresh(true); } diff --git a/src/Views/ViewLevelGen.cpp b/src/Views/ViewLevelGen.cpp index 11d3e22..6dcfa84 100644 --- a/src/Views/ViewLevelGen.cpp +++ b/src/Views/ViewLevelGen.cpp @@ -19,6 +19,7 @@ S2Plugin::ViewLevelGen::ViewLevelGen(uintptr_t address, QWidget* parent) : QWidg setWindowTitle("LevelGen"); auto mainLayout = new QVBoxLayout(this); + mainLayout->setMargin(5); auto refreshLayout = new QHBoxLayout(); mainLayout->addLayout(refreshLayout); @@ -37,22 +38,15 @@ S2Plugin::ViewLevelGen::ViewLevelGen(uintptr_t address, QWidget* parent) : QWidg mainLayout->addWidget(mMainTabWidget); // TABS - auto tabData = new QWidget(); - auto tabRooms = new QWidget(); - tabData->setLayout(new QVBoxLayout()); - tabData->layout()->setMargin(0); - tabData->setObjectName("datawidget"); - tabRooms->setLayout(new QVBoxLayout()); - tabRooms->layout()->setMargin(0); - - mMainTabWidget->addTab(tabData, "Data"); + mMainTreeView = new TreeViewMemoryFields(this); + auto tabRooms = new QScrollArea(this); + + mMainTabWidget->addTab(mMainTreeView, "Data"); mMainTabWidget->addTab(tabRooms, "Rooms"); // TAB DATA { - mMainTreeView = new TreeViewMemoryFields(this); mMainTreeView->addMemoryFields(Configuration::get()->typeFields(MemoryFieldType::LevelGen), "LevelGen", mLevelGenPtr); - tabData->layout()->addWidget(mMainTreeView); mMainTreeView->setColumnWidth(gsColValue, 250); mMainTreeView->setColumnWidth(gsColField, 125); @@ -67,10 +61,9 @@ S2Plugin::ViewLevelGen::ViewLevelGen(uintptr_t address, QWidget* parent) : QWidg // TAB ROOMS { - auto scroll = new QScrollArea(this); - scroll->setWidgetResizable(true); + tabRooms->setWidgetResizable(true); auto containerWidget = new QWidget(this); - scroll->setWidget(containerWidget); + tabRooms->setWidget(containerWidget); auto containerLayout = new QVBoxLayout(containerWidget); for (const auto& field : Configuration::get()->typeFields(MemoryFieldType::LevelGen)) @@ -86,13 +79,9 @@ S2Plugin::ViewLevelGen::ViewLevelGen(uintptr_t address, QWidget* parent) : QWidg containerLayout->addWidget(roomWidget); } } - dynamic_cast(tabRooms->layout())->addWidget(scroll); } - - mainLayout->setMargin(5); - mMainTreeView->setVisible(true); autoRefresh->toggleAutoRefresh(true); - mMainTreeView->updateTree(0, 0, true); // just initial refresh so we don't the all fields marked as just changed (red) + mMainTreeView->updateTree(0, 0, true); } void S2Plugin::ViewLevelGen::refreshLevelGen() diff --git a/src/Views/ViewParticleDB.cpp b/src/Views/ViewParticleDB.cpp index f9e2987..9a01e91 100644 --- a/src/Views/ViewParticleDB.cpp +++ b/src/Views/ViewParticleDB.cpp @@ -14,7 +14,7 @@ S2Plugin::ViewParticleDB::ViewParticleDB(QWidget* parent) : WidgetDatabaseView(M particleNameCompleter->setFilterMode(Qt::MatchContains); QObject::connect(particleNameCompleter, static_cast(&QCompleter::activated), this, &ViewParticleDB::searchFieldCompleterActivated); mSearchLineEdit->setCompleter(particleNameCompleter); - mCompareTableWidget->setRowCount(particleEmitters.count()); + mCompareTableWidget->setRowCount(static_cast(particleEmitters.count())); showID(1); } diff --git a/src/Views/ViewStdMap.cpp b/src/Views/ViewStdMap.cpp index 872e754..6aa3f71 100644 --- a/src/Views/ViewStdMap.cpp +++ b/src/Views/ViewStdMap.cpp @@ -29,6 +29,7 @@ S2Plugin::ViewStdMap::ViewStdMap(const std::string& keytypeName, const std::stri setWindowTitle(QString("std::map<%1, %2>").arg(QString::fromStdString(keytypeName), QString::fromStdString(valuetypeName))); auto mainLayout = new QVBoxLayout(this); + mainLayout->setMargin(5); auto refreshLayout = new QHBoxLayout(); mainLayout->addLayout(refreshLayout); @@ -43,9 +44,7 @@ S2Plugin::ViewStdMap::ViewStdMap(const std::string& keytypeName, const std::stri mMainTreeView = new TreeViewMemoryFields(this); mMainTreeView->setEnableChangeHighlighting(false); mMainTreeView->activeColumns.disable(gsColComparisonValue).disable(gsColComparisonValueHex).disable(gsColMemoryAddressDelta).disable(gsColComment); - mMainTreeView->setVisible(true); mainLayout->addWidget(mMainTreeView); - mainLayout->setMargin(5); autoRefresh->toggleAutoRefresh(true); refreshMapContents(); } @@ -122,21 +121,20 @@ void S2Plugin::ViewStdMap::refreshMapContents() parent_field.name = "obj_" + std::to_string(x); parent = mMainTreeView->addMemoryField(parent_field, parent_field.name, 0, 0); - mMainTreeView->addMemoryField(key_field, key_field.name, _cur.key_ptr(), 0, parent); + mMainTreeView->addMemoryField(key_field, key_field.name, _cur.key_ptr(), 0, 0, parent); if (mMapValueTypeSize == 0) // StdSet continue; - mMainTreeView->addMemoryField(value_field, value_field.name, _cur.value_ptr(), 0, parent); + mMainTreeView->addMemoryField(value_field, value_field.name, _cur.value_ptr(), 0, 0, parent); } - refreshData(); - mMainTreeView->updateTableHeader(); mMainTreeView->setColumnWidth(gsColField, 145); mMainTreeView->setColumnWidth(gsColValueHex, 125); mMainTreeView->setColumnWidth(gsColMemoryAddress, 125); mMainTreeView->setColumnWidth(gsColType, 100); mMainTreeView->setColumnWidth(gsColValue, 300); + mMainTreeView->updateTree(0, 0, true); } void S2Plugin::ViewStdMap::refreshData() diff --git a/src/Views/ViewStdVector.cpp b/src/Views/ViewStdVector.cpp index 084dcbe..9e368d8 100644 --- a/src/Views/ViewStdVector.cpp +++ b/src/Views/ViewStdVector.cpp @@ -18,6 +18,7 @@ S2Plugin::ViewStdVector::ViewStdVector(const std::string& vectorType, uintptr_t setWindowTitle(QString("std::vector<%1>").arg(QString::fromStdString(vectorType))); auto mainLayout = new QVBoxLayout(this); + mainLayout->setMargin(5); auto refreshLayout = new QHBoxLayout(); mainLayout->addLayout(refreshLayout); @@ -31,9 +32,7 @@ S2Plugin::ViewStdVector::ViewStdVector(const std::string& vectorType, uintptr_t mMainTreeView = new TreeViewMemoryFields(this); mMainTreeView->activeColumns.disable(gsColComparisonValue).disable(gsColComparisonValueHex).disable(gsColComment); - mMainTreeView->setVisible(true); mainLayout->addWidget(mMainTreeView); - mainLayout->setMargin(5); autoRefresh->toggleAutoRefresh(true); refreshVectorContents(); } @@ -86,14 +85,13 @@ void S2Plugin::ViewStdVector::refreshVectorContents() field.name = "obj_" + std::to_string(x); mMainTreeView->addMemoryField(field, field.name, vectorBegin + x * mVectorTypeSize, x * mVectorTypeSize); } - refreshData(); - mMainTreeView->updateTableHeader(); mMainTreeView->setColumnWidth(gsColField, 145); mMainTreeView->setColumnWidth(gsColValueHex, 125); mMainTreeView->setColumnWidth(gsColMemoryAddress, 125); mMainTreeView->setColumnWidth(gsColType, 100); mMainTreeView->setColumnWidth(gsColValue, 300); + mMainTreeView->updateTree(0, 0, true); } void S2Plugin::ViewStdVector::refreshData() diff --git a/src/Views/ViewStringsTable.cpp b/src/Views/ViewStringsTable.cpp index b855ef8..92d1549 100644 --- a/src/Views/ViewStringsTable.cpp +++ b/src/Views/ViewStringsTable.cpp @@ -19,8 +19,9 @@ S2Plugin::ViewStringsTable::ViewStringsTable(QWidget* parent) : QWidget(parent) setWindowTitle(QString("Strings table (%1 strings)").arg(Spelunky2::get()->get_StringsTable().count())); auto mainLayout = new QVBoxLayout(this); - auto topLayout = new QHBoxLayout(); + mainLayout->addLayout(topLayout); + auto reloadButton = new QPushButton("Reload", this); topLayout->addWidget(reloadButton); QObject::connect(reloadButton, &QPushButton::clicked, this, &ViewStringsTable::reload); @@ -29,7 +30,6 @@ S2Plugin::ViewStringsTable::ViewStringsTable(QWidget* parent) : QWidget(parent) filterLineEdit->setPlaceholderText("Search id or text"); QObject::connect(filterLineEdit, &QLineEdit::textChanged, this, &ViewStringsTable::filterTextChanged); topLayout->addWidget(filterLineEdit); - mainLayout->addLayout(topLayout); mMainTableView = new QTableView(this); mMainTableView->setAlternatingRowColors(true); diff --git a/src/Views/ViewStruct.cpp b/src/Views/ViewStruct.cpp index 8e6ea99..d334879 100644 --- a/src/Views/ViewStruct.cpp +++ b/src/Views/ViewStruct.cpp @@ -16,9 +16,9 @@ S2Plugin::ViewStruct::ViewStruct(uintptr_t address, const std::vectorsetMargin(5); auto refreshLayout = new QHBoxLayout(); mainLayout->addLayout(refreshLayout); - mainLayout->setMargin(5); auto autoRefresh = new WidgetAutorefresh("100", this); QObject::connect(autoRefresh, &WidgetAutorefresh::refresh, mMainTreeView, static_cast(&TreeViewMemoryFields::updateTree)); @@ -40,8 +40,7 @@ S2Plugin::ViewStruct::ViewStruct(uintptr_t address, const std::vectorsetColumnWidth(gsColMemoryAddressDelta, 75); mMainTreeView->setColumnWidth(gsColType, 100); mMainTreeView->updateTableHeader(); - mMainTreeView->setVisible(true); - + mMainTreeView->updateTree(0, 0, true); autoRefresh->toggleAutoRefresh(true); } diff --git a/src/Views/ViewVirtualFunctions.cpp b/src/Views/ViewVirtualFunctions.cpp index a589a5c..0328c90 100644 --- a/src/Views/ViewVirtualFunctions.cpp +++ b/src/Views/ViewVirtualFunctions.cpp @@ -16,7 +16,6 @@ S2Plugin::ViewVirtualFunctions::ViewVirtualFunctions(const std::string& typeName auto mainLayout = new QVBoxLayout(this); mainLayout->setMargin(5); - auto topLayout = new QHBoxLayout(); mainLayout->addLayout(topLayout);