resourceExplorer basics
This commit is contained in:
parent
04a4f4a9c7
commit
a079802abb
|
@ -5,3 +5,4 @@ Makefile
|
||||||
.qmake.stash
|
.qmake.stash
|
||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
qtdebugger
|
qtdebugger
|
||||||
|
*.pro.user
|
||||||
|
|
|
@ -24,6 +24,7 @@ public:
|
||||||
private slots:
|
private slots:
|
||||||
void refresh();
|
void refresh();
|
||||||
void currentObjectChanged( QTreeWidgetItem* new_, QTreeWidgetItem* old );
|
void currentObjectChanged( QTreeWidgetItem* new_, QTreeWidgetItem* old );
|
||||||
|
void openResourceExplorer();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resetStyleSheet();
|
void resetStyleSheet();
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
#ifndef RESOURCEEXPLORER_H
|
||||||
|
#define RESOURCEEXPLORER_H
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class ResourceExplorer;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ResourceExplorer : public QMainWindow {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ResourceExplorer(QWidget *parent = nullptr);
|
||||||
|
~ResourceExplorer();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::ResourceExplorer *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // RESOURCEEXPLORER_H
|
|
@ -29,13 +29,16 @@ INCLUDEPATH += $$PWD/include/
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
src/injector.cpp \
|
src/injector.cpp \
|
||||||
src/qtdebugger.cpp
|
src/qtdebugger.cpp \
|
||||||
|
src/resourceexplorer.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
include/qtdebugger.h
|
include/qtdebugger.h \
|
||||||
|
include/resourceexplorer.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
ui/debugwindow.ui
|
ui/debugwindow.ui \
|
||||||
|
ui/resourceexplorer.ui
|
||||||
|
|
||||||
# main binary target
|
# main binary target
|
||||||
qtdebugger.depends = src/main.c
|
qtdebugger.depends = src/main.c
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
#include "resourceexplorer.h"
|
||||||
|
|
||||||
QtDebugger::QtDebugger(QObject* parent) : QObject(parent), debugWindow( new QMainWindow() ), ui( new Ui::DebugWindow() ) {
|
QtDebugger::QtDebugger(QObject* parent) : QObject(parent), debugWindow( new QMainWindow() ), ui( new Ui::DebugWindow() ) {
|
||||||
this->ui->setupUi( debugWindow );
|
this->ui->setupUi( debugWindow );
|
||||||
debugWindow->show();
|
debugWindow->show();
|
||||||
|
@ -21,6 +23,7 @@ QtDebugger::QtDebugger(QObject* parent) : QObject(parent), debugWindow( new QMai
|
||||||
|
|
||||||
QObject::connect( this->ui->refreshButton, &QPushButton::clicked, this, &QtDebugger::refresh );
|
QObject::connect( this->ui->refreshButton, &QPushButton::clicked, this, &QtDebugger::refresh );
|
||||||
QObject::connect( this->ui->objectTree, &QTreeWidget::currentItemChanged, this, &QtDebugger::currentObjectChanged );
|
QObject::connect( this->ui->objectTree, &QTreeWidget::currentItemChanged, this, &QtDebugger::currentObjectChanged );
|
||||||
|
QObject::connect( this->ui->resourceExplorerButton, &QPushButton::clicked, this, &QtDebugger::openResourceExplorer );
|
||||||
|
|
||||||
this->refresh();
|
this->refresh();
|
||||||
}
|
}
|
||||||
|
@ -70,6 +73,8 @@ void QtDebugger::refresh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtDebugger::currentObjectChanged( QTreeWidgetItem* new_, QTreeWidgetItem* old ) {
|
void QtDebugger::currentObjectChanged( QTreeWidgetItem* new_, QTreeWidgetItem* old ) {
|
||||||
|
Q_UNUSED( old );
|
||||||
|
|
||||||
this->ui->propertiesTree->clear();
|
this->ui->propertiesTree->clear();
|
||||||
|
|
||||||
this->resetStyleSheet();
|
this->resetStyleSheet();
|
||||||
|
@ -125,6 +130,11 @@ void QtDebugger::currentObjectChanged( QTreeWidgetItem* new_, QTreeWidgetItem* o
|
||||||
readProperties( obj->metaObject() );
|
readProperties( obj->metaObject() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtDebugger::openResourceExplorer() {
|
||||||
|
ResourceExplorer* re = new ResourceExplorer( debugWindow );
|
||||||
|
re->show();
|
||||||
|
}
|
||||||
|
|
||||||
void QtDebugger::resetStyleSheet() {
|
void QtDebugger::resetStyleSheet() {
|
||||||
// get currently selected item
|
// get currently selected item
|
||||||
QList<QTreeWidgetItem*> items = this->ui->objectTree->selectedItems();
|
QList<QTreeWidgetItem*> items = this->ui->objectTree->selectedItems();
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include "resourceexplorer.h"
|
||||||
|
#include "ui_resourceexplorer.h"
|
||||||
|
|
||||||
|
#include <QFileSystemModel>
|
||||||
|
|
||||||
|
ResourceExplorer::ResourceExplorer(QWidget *parent) : QMainWindow( parent ), ui(new Ui::ResourceExplorer) {
|
||||||
|
this->ui->setupUi(this);
|
||||||
|
|
||||||
|
QFileSystemModel* model = new QFileSystemModel;
|
||||||
|
model->setRootPath( ":/" );
|
||||||
|
this->ui->treeView->setModel( model );
|
||||||
|
}
|
||||||
|
|
||||||
|
ResourceExplorer::~ResourceExplorer() {
|
||||||
|
delete this->ui;
|
||||||
|
}
|
|
@ -20,22 +20,47 @@
|
||||||
<property name="childrenCollapsible">
|
<property name="childrenCollapsible">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QPushButton" name="refreshButton">
|
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||||
<property name="minimumSize">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<size>
|
<item>
|
||||||
<width>0</width>
|
<widget class="QPushButton" name="refreshButton">
|
||||||
<height>20</height>
|
<property name="minimumSize">
|
||||||
</size>
|
<size>
|
||||||
</property>
|
<width>0</width>
|
||||||
<property name="maximumSize">
|
<height>20</height>
|
||||||
<size>
|
</size>
|
||||||
<width>16777215</width>
|
</property>
|
||||||
<height>40</height>
|
<property name="maximumSize">
|
||||||
</size>
|
<size>
|
||||||
</property>
|
<width>16777215</width>
|
||||||
<property name="text">
|
<height>40</height>
|
||||||
<string>Refresh</string>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Refresh</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="resourceExplorerButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Resource Explorer</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTreeWidget" name="objectTree">
|
<widget class="QTreeWidget" name="objectTree">
|
||||||
<property name="indentation">
|
<property name="indentation">
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ResourceExplorer</class>
|
||||||
|
<widget class="QMainWindow" name="ResourceExplorer">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>600</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Resource Explorer</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QTreeView" name="treeView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menubar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>24</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Reference in New Issue