initial StructWidget
This commit is contained in:
parent
4020845985
commit
6558b29628
|
@ -31,6 +31,9 @@ CPUMultiDump::CPUMultiDump(CPUDisassembly* disas, int nbCpuDumpTabs, QWidget* pa
|
|||
mWatch->setWindowTitle(nativeTitle);
|
||||
mWatch->loadColumnFromConfig("Watch1");
|
||||
|
||||
mStructWidget = new StructWidget(this);
|
||||
this->addTabEx(mStructWidget, mStructWidget->windowIcon(), mStructWidget->windowTitle(), "Struct");
|
||||
|
||||
connect(this, SIGNAL(currentChanged(int)), this, SLOT(updateCurrentTabSlot(int)));
|
||||
connect(tabBar(), SIGNAL(OnDoubleClickTabIndex(int)), this, SLOT(openChangeTabTitleDialogSlot(int)));
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "CPUDump.h"
|
||||
#include "TabWidget.h"
|
||||
#include "WatchView.h"
|
||||
#include "StructWidget.h"
|
||||
|
||||
class CPUDump;
|
||||
|
||||
|
@ -37,6 +38,7 @@ private:
|
|||
uint mMaxCPUDumpTabs;
|
||||
|
||||
WatchView* mWatch;
|
||||
StructWidget* mStructWidget;
|
||||
|
||||
int GetDumpWindowIndex(int dump);
|
||||
int GetWatchWindowIndex();
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
#include "StructWidget.h"
|
||||
#include "ui_StructWidget.h"
|
||||
|
||||
StructWidget::StructWidget(QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::StructWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
showTree();
|
||||
}
|
||||
|
||||
StructWidget::~StructWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void StructWidget::showTree()
|
||||
{
|
||||
ui->treeWidget->clear();
|
||||
QTreeWidgetItem* t = new QTreeWidgetItem(ui->treeWidget, QStringList() << "struct TEST");
|
||||
new QTreeWidgetItem(t, QStringList() << "int a" << "00000000" << "0xA");
|
||||
new QTreeWidgetItem(t, QStringList() << "char b" << "00000004" << "0xB");
|
||||
QTreeWidgetItem* e = new QTreeWidgetItem(t, QStringList() << "struct BLUB");
|
||||
new QTreeWidgetItem(e, QStringList() << "short c" << "00000005" << "0xC");
|
||||
QTreeWidgetItem* d = new QTreeWidgetItem(e, QStringList() << "int[2]");
|
||||
new QTreeWidgetItem(d, QStringList() << "int d[0]" << "00000007" << "0xD0");
|
||||
new QTreeWidgetItem(d, QStringList() << "int d[1]" << "00000011" << "0xD1");
|
||||
new QTreeWidgetItem(t, QStringList() << "int f" << "00000015" << "0xF");
|
||||
ui->treeWidget->setColumnWidth(0, 200);
|
||||
ui->treeWidget->setColumnWidth(1, 80);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef STRUCTWIDGET_H
|
||||
#define STRUCTWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class StructWidget;
|
||||
}
|
||||
|
||||
class StructWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StructWidget(QWidget* parent = 0);
|
||||
~StructWidget();
|
||||
|
||||
private:
|
||||
Ui::StructWidget* ui;
|
||||
|
||||
void showTree();
|
||||
};
|
||||
|
||||
#endif // STRUCTWIDGET_H
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>StructWidget</class>
|
||||
<widget class="QWidget" name="StructWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>826</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Struct</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Lucida Console</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<attribute name="headerCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Address</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Value</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -173,6 +173,7 @@ SOURCES += \
|
|||
Src/Gui/LogStatusLabel.cpp \
|
||||
Src/Gui/DebugStatusLabel.cpp \
|
||||
Src/Utils/MenuBuilder.cpp \
|
||||
Src/Gui/StructWidget.cpp \
|
||||
Src/Gui/CustomizeMenuDialog.cpp \
|
||||
Src/Gui/SimpleTraceDialog.cpp
|
||||
|
||||
|
@ -284,6 +285,7 @@ HEADERS += \
|
|||
Src/Gui/LogStatusLabel.h \
|
||||
Src/Gui/DebugStatusLabel.h \
|
||||
Src/Gui/CustomizeMenuDialog.h \
|
||||
Src/Gui/StructWidget.h \
|
||||
Src/Gui/SimpleTraceDialog.h
|
||||
|
||||
|
||||
|
@ -322,6 +324,7 @@ FORMS += \
|
|||
Src/Gui/BrowseDialog.ui \
|
||||
Src/Gui/VirtualModDialog.ui \
|
||||
Src/Gui/CustomizeMenuDialog.ui \
|
||||
Src/Gui/StructWidget.ui \
|
||||
Src/Gui/SimpleTraceDialog.ui
|
||||
|
||||
##
|
||||
|
|
Loading…
Reference in New Issue