mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 22:05:25 +00:00
Small refactor for the widgets of Cutter (#405)
* Small refactor for the widgets of Cutter This refactor include the following : * Creation of a new class Creation of a new class, named CutterWidget, that inherits from QDockWidget and is used to represent all of the widgets of the main window. The goal of this class is to regroup all the behaviour shared by the widgets of Cutter. For example : in the constructor, instructions corresponding of those present in the macro **ADD_DOCK** (in MainWindow.cpp) are executed. This was made because I think that the macro **ADD_DOCK** which is used to construct the widgets does not take advantage of the object structure. * Ensure that every widget has a parent Some widgets were created using the constructor QDockWidget, but using **nullptr** (default) as argument, thus they haven't got any parent. The constructor of a CutterWidget takes as argument the MainWindow and an action (optional) and calls the constructor of QDockWidget with the main window as argument. This is valid under the assumption that it is mandatory for every widget to have the main window as a parent. * Constructors removal The constructors of some widgets are not used anywhere and does not seem not fullfill any current usecase. They were removed. * Renaming CutterWidget to CutterDockWidget
This commit is contained in:
parent
98ea17c85a
commit
c4e8a1c178
@ -142,7 +142,9 @@ SOURCES += \
|
|||||||
widgets/JupyterWidget.cpp \
|
widgets/JupyterWidget.cpp \
|
||||||
utils/PythonAPI.cpp \
|
utils/PythonAPI.cpp \
|
||||||
utils/NestedIPyKernel.cpp \
|
utils/NestedIPyKernel.cpp \
|
||||||
dialogs/R2PluginsDialog.cpp
|
dialogs/R2PluginsDialog.cpp \
|
||||||
|
widgets/CutterDockWidget.cpp \
|
||||||
|
widgets/GraphWidget.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
Cutter.h \
|
Cutter.h \
|
||||||
@ -209,7 +211,9 @@ HEADERS += \
|
|||||||
widgets/JupyterWidget.h \
|
widgets/JupyterWidget.h \
|
||||||
utils/PythonAPI.h \
|
utils/PythonAPI.h \
|
||||||
utils/NestedIPyKernel.h \
|
utils/NestedIPyKernel.h \
|
||||||
dialogs/R2PluginsDialog.h
|
dialogs/R2PluginsDialog.h \
|
||||||
|
widgets/CutterDockWidget.h \
|
||||||
|
widgets/GraphWidget.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
dialogs/AboutDialog.ui \
|
dialogs/AboutDialog.ui \
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
#include "dialogs/NewFileDialog.h"
|
#include "dialogs/NewFileDialog.h"
|
||||||
#include "widgets/DisassemblerGraphView.h"
|
#include "widgets/DisassemblerGraphView.h"
|
||||||
|
#include "widgets/GraphWidget.h"
|
||||||
#include "widgets/FunctionsWidget.h"
|
#include "widgets/FunctionsWidget.h"
|
||||||
#include "widgets/SectionsWidget.h"
|
#include "widgets/SectionsWidget.h"
|
||||||
#include "widgets/CommentsWidget.h"
|
#include "widgets/CommentsWidget.h"
|
||||||
@ -150,78 +151,44 @@ void MainWindow::initUI()
|
|||||||
*/
|
*/
|
||||||
dockWidgets.reserve(20);
|
dockWidgets.reserve(20);
|
||||||
|
|
||||||
#define ADD_DOCK(cls, dockMember, action) \
|
disassemblyDock = new DisassemblyWidget(this, ui->actionDisassembly);
|
||||||
{ \
|
sidebarDock = new SidebarWidget(this, ui->actionSidebar);
|
||||||
(dockMember) = new cls(this); \
|
hexdumpDock = new HexdumpWidget(this, ui->actionHexdump);
|
||||||
dockWidgets.push_back(dockMember); \
|
pseudocodeDock = new PseudocodeWidget(this, ui->actionPseudocode);
|
||||||
connect((action), &QAction::triggered, this, [this](bool checked) \
|
consoleDock = new ConsoleWidget(this, ui->actionConsole);
|
||||||
{ \
|
|
||||||
toggleDockWidget((dockMember), checked); \
|
|
||||||
}); \
|
|
||||||
dockWidgetActions[action] = (dockMember); \
|
|
||||||
}
|
|
||||||
ADD_DOCK(DisassemblyWidget, disassemblyDock, ui->actionDisassembly);
|
|
||||||
ADD_DOCK(SidebarWidget, sidebarDock, ui->actionSidebar);
|
|
||||||
ADD_DOCK(HexdumpWidget, hexdumpDock, ui->actionHexdump);
|
|
||||||
ADD_DOCK(PseudocodeWidget, pseudocodeDock, ui->actionPseudocode);
|
|
||||||
ADD_DOCK(ConsoleWidget, consoleDock, ui->actionConsole);
|
|
||||||
|
|
||||||
// Add graph view as dockable
|
// Add graph view as dockable
|
||||||
graphDock = new QDockWidget(tr("Graph"), this);
|
graphDock = new GraphWidget(this, ui->actionGraph);
|
||||||
graphDock->setObjectName("Graph");
|
|
||||||
graphDock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
|
||||||
graphView = new DisassemblerGraphView(graphDock);
|
|
||||||
graphDock->setWidget(graphView);
|
|
||||||
|
|
||||||
// Hide centralWidget as we do not need it
|
// Hide centralWidget as we do not need it
|
||||||
ui->centralWidget->hide();
|
ui->centralWidget->hide();
|
||||||
|
|
||||||
connect(graphDock, &QDockWidget::visibilityChanged, graphDock, [](bool visibility)
|
sectionsDock = new SectionsDock(this, ui->actionSections);
|
||||||
{
|
disassemblyDock = new DisassemblyWidget(this, ui->actionDisassembly);
|
||||||
if (visibility)
|
entrypointDock = new EntrypointWidget(this, ui->actionEntrypoints);
|
||||||
{
|
functionsDock = new FunctionsWidget(this, ui->actionFunctions);
|
||||||
Core()->setMemoryWidgetPriority(CutterCore::MemoryWidgetType::Graph);
|
importsDock = new ImportsWidget(this, ui->actionImports);
|
||||||
}
|
exportsDock = new ExportsWidget(this, ui->actionExports);
|
||||||
});
|
typesDock = new TypesWidget(this, ui->actionTypes);
|
||||||
connect(Core(), &CutterCore::raisePrioritizedMemoryWidget, graphDock, [ = ](CutterCore::MemoryWidgetType type)
|
searchDock = new SearchWidget(this, ui->actionSearch);
|
||||||
{
|
symbolsDock = new SymbolsWidget(this, ui->actionSymbols);
|
||||||
if (type == CutterCore::MemoryWidgetType::Graph)
|
relocsDock = new RelocsWidget(this, ui->actionRelocs);
|
||||||
{
|
commentsDock = new CommentsWidget(this, ui->actionComments);
|
||||||
graphDock->raise();
|
stringsDock = new StringsWidget(this, ui->actionStrings);
|
||||||
graphView->setFocus();
|
flagsDock = new FlagsWidget(this, ui->actionFlags);
|
||||||
}
|
|
||||||
});
|
|
||||||
dockWidgets.push_back(graphDock);
|
|
||||||
connect(ui->actionGraph, &QAction::triggered, this, [this](bool checked)
|
|
||||||
{
|
|
||||||
toggleDockWidget(graphDock, checked);
|
|
||||||
});
|
|
||||||
|
|
||||||
ADD_DOCK(SectionsDock, sectionsDock, ui->actionSections);
|
|
||||||
ADD_DOCK(EntrypointWidget, entrypointDock, ui->actionEntrypoints);
|
|
||||||
ADD_DOCK(FunctionsWidget, functionsDock, ui->actionFunctions);
|
|
||||||
ADD_DOCK(ImportsWidget, importsDock, ui->actionImports);
|
|
||||||
ADD_DOCK(ExportsWidget, exportsDock, ui->actionExports);
|
|
||||||
ADD_DOCK(TypesWidget, typesDock, ui->actionTypes);
|
|
||||||
ADD_DOCK(SearchWidget, searchDock, ui->actionSearchInst);
|
|
||||||
ADD_DOCK(SymbolsWidget, symbolsDock, ui->actionSymbols);
|
|
||||||
ADD_DOCK(RelocsWidget, relocsDock, ui->actionRelocs);
|
|
||||||
ADD_DOCK(CommentsWidget, commentsDock, ui->actionComments);
|
|
||||||
ADD_DOCK(StringsWidget, stringsDock, ui->actionStrings);
|
|
||||||
ADD_DOCK(FlagsWidget, flagsDock, ui->actionFlags);
|
|
||||||
#ifdef CUTTER_ENABLE_JUPYTER
|
#ifdef CUTTER_ENABLE_JUPYTER
|
||||||
ADD_DOCK(JupyterWidget, jupyterDock, ui->actionJupyter);
|
jupyterDock = new JupyterWidget(this, ui->actionJupyter);
|
||||||
#else
|
#else
|
||||||
ui->actionJupyter->setEnabled(false);
|
ui->actionJupyter->setEnabled(false);
|
||||||
ui->actionJupyter->setVisible(false);
|
ui->actionJupyter->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
ADD_DOCK(Dashboard, dashboardDock, ui->actionDashboard);
|
dashboardDock = new Dashboard(this, ui->actionDashboard);
|
||||||
ADD_DOCK(SdbDock, sdbDock, ui->actionSDBBrowser);
|
disassemblyDock = new DisassemblyWidget(this, ui->actionDisassembly);
|
||||||
ADD_DOCK(ClassesWidget, classesDock, ui->actionClasses);
|
sdbDock = new SdbDock(this, ui->actionSDBBrowser);
|
||||||
ADD_DOCK(ResourcesWidget, resourcesDock, ui->actionResources);
|
classesDock = new ClassesWidget(this, ui->actionClasses);
|
||||||
ADD_DOCK(VTablesWidget, vTablesDock, ui->actionVTables);
|
resourcesDock = new ResourcesWidget(this, ui->actionResources);
|
||||||
|
vTablesDock = new VTablesWidget(this, ui->actionVTables);
|
||||||
|
|
||||||
#undef ADD_DOCK
|
|
||||||
|
|
||||||
// Set up dock widgets default layout
|
// Set up dock widgets default layout
|
||||||
resetToDefaultLayout();
|
resetToDefaultLayout();
|
||||||
@ -484,19 +451,6 @@ void MainWindow::lockUnlock_Docks(bool what)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::toggleDockWidget(QDockWidget *dock_widget, bool show)
|
|
||||||
{
|
|
||||||
if (!show)
|
|
||||||
{
|
|
||||||
dock_widget->close();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dock_widget->show();
|
|
||||||
dock_widget->raise();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::restoreDocks()
|
void MainWindow::restoreDocks()
|
||||||
{
|
{
|
||||||
// In the upper half the functions are the first widget
|
// In the upper half the functions are the first widget
|
||||||
@ -808,3 +762,11 @@ void MainWindow::projectSaved(const QString &name)
|
|||||||
{
|
{
|
||||||
addOutput(tr("Project saved: ") + name);
|
addOutput(tr("Project saved: ") + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::addToDockWidgetList(QDockWidget *dockWidget) {
|
||||||
|
this->dockWidgets.push_back(dockWidget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::addDockWidgetAction(QDockWidget *dockWidget, QAction *action) {
|
||||||
|
this->dockWidgetActions[action] = dockWidget;
|
||||||
|
}
|
||||||
|
@ -91,6 +91,9 @@ public:
|
|||||||
void addDebugOutput(const QString &msg);
|
void addDebugOutput(const QString &msg);
|
||||||
void refreshOmniBar(const QStringList &flags);
|
void refreshOmniBar(const QStringList &flags);
|
||||||
|
|
||||||
|
void addToDockWidgetList(QDockWidget *dockWidget);
|
||||||
|
void addDockWidgetAction(QDockWidget *dockWidget, QAction *action);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void refreshAll();
|
void refreshAll();
|
||||||
@ -198,8 +201,6 @@ private:
|
|||||||
JupyterWidget *jupyterDock = nullptr;
|
JupyterWidget *jupyterDock = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void toggleDockWidget(QDockWidget *dock_widget, bool show);
|
|
||||||
|
|
||||||
void resetToDefaultLayout();
|
void resetToDefaultLayout();
|
||||||
|
|
||||||
void restoreDocks();
|
void restoreDocks();
|
||||||
@ -207,6 +208,8 @@ private:
|
|||||||
void showDefaultDocks();
|
void showDefaultDocks();
|
||||||
void updateDockActionsChecked();
|
void updateDockActionsChecked();
|
||||||
|
|
||||||
|
void toggleDockWidget(QDockWidget *dock_widget, bool show);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString getFilename() const { return filename; }
|
QString getFilename() const { return filename; }
|
||||||
};
|
};
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
#include "ClassesWidget.h"
|
#include "ClassesWidget.h"
|
||||||
|
#include "MainWindow.h"
|
||||||
#include "ui_ClassesWidget.h"
|
#include "ui_ClassesWidget.h"
|
||||||
#include "utils/Helpers.h"
|
#include "utils/Helpers.h"
|
||||||
|
|
||||||
@ -242,8 +243,8 @@ bool ClassesSortFilterProxyModel::lessThan(const QModelIndex &left, const QModel
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
ClassesWidget::ClassesWidget(QWidget *parent) :
|
ClassesWidget::ClassesWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::ClassesWidget)
|
ui(new Ui::ClassesWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
@ -16,6 +16,7 @@ namespace Ui
|
|||||||
|
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
|
|
||||||
class ClassesModel: public QAbstractItemModel
|
class ClassesModel: public QAbstractItemModel
|
||||||
@ -65,12 +66,12 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ClassesWidget : public QDockWidget
|
class ClassesWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ClassesWidget(QWidget *parent = nullptr);
|
explicit ClassesWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~ClassesWidget();
|
~ClassesWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "utils/Helpers.h"
|
#include "utils/Helpers.h"
|
||||||
|
|
||||||
CommentsWidget::CommentsWidget(MainWindow *main, QWidget *parent) :
|
CommentsWidget::CommentsWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::CommentsWidget),
|
ui(new Ui::CommentsWidget),
|
||||||
main(main)
|
main(main)
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <QDockWidget>
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
@ -13,12 +13,12 @@ namespace Ui
|
|||||||
class CommentsWidget;
|
class CommentsWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class CommentsWidget : public QDockWidget
|
class CommentsWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CommentsWidget(MainWindow *main, QWidget *parent = 0);
|
explicit CommentsWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~CommentsWidget();
|
~CommentsWidget();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -90,8 +90,8 @@ static bool isForbidden(const QString &input)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConsoleWidget::ConsoleWidget(QWidget *parent, Qt::WindowFlags flags) :
|
ConsoleWidget::ConsoleWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent, flags),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::ConsoleWidget),
|
ui(new Ui::ConsoleWidget),
|
||||||
debugOutputEnabled(true),
|
debugOutputEnabled(true),
|
||||||
maxHistoryEntries(100),
|
maxHistoryEntries(100),
|
||||||
@ -110,9 +110,9 @@ ConsoleWidget::ConsoleWidget(QWidget *parent, Qt::WindowFlags flags) :
|
|||||||
QTextDocument *console_docu = ui->outputTextEdit->document();
|
QTextDocument *console_docu = ui->outputTextEdit->document();
|
||||||
console_docu->setDocumentMargin(10);
|
console_docu->setDocumentMargin(10);
|
||||||
|
|
||||||
QAction *action = new QAction(tr("Clear Output"), ui->outputTextEdit);
|
QAction *actionClear = new QAction(tr("Clear Output"), ui->outputTextEdit);
|
||||||
connect(action, SIGNAL(triggered(bool)), ui->outputTextEdit, SLOT(clear()));
|
connect(actionClear, SIGNAL(triggered(bool)), ui->outputTextEdit, SLOT(clear()));
|
||||||
actions.append(action);
|
actions.append(actionClear);
|
||||||
|
|
||||||
// Completion
|
// Completion
|
||||||
QCompleter *completer = new QCompleter(radareArgs, this);
|
QCompleter *completer = new QCompleter(radareArgs, this);
|
||||||
@ -144,12 +144,6 @@ ConsoleWidget::ConsoleWidget(QWidget *parent, Qt::WindowFlags flags) :
|
|||||||
connect(Config(), SIGNAL(fontsUpdated()), this, SLOT(setupFont()));
|
connect(Config(), SIGNAL(fontsUpdated()), this, SLOT(setupFont()));
|
||||||
}
|
}
|
||||||
|
|
||||||
ConsoleWidget::ConsoleWidget(const QString &title, QWidget *parent, Qt::WindowFlags flags)
|
|
||||||
: ConsoleWidget(parent, flags)
|
|
||||||
{
|
|
||||||
setWindowTitle(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleWidget::~ConsoleWidget() {}
|
ConsoleWidget::~ConsoleWidget() {}
|
||||||
|
|
||||||
void ConsoleWidget::setupFont()
|
void ConsoleWidget::setupFont()
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef CONSOLEWIDGET_H
|
#ifndef CONSOLEWIDGET_H
|
||||||
#define CONSOLEWIDGET_H
|
#define CONSOLEWIDGET_H
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
@ -11,13 +11,12 @@ namespace Ui
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class ConsoleWidget : public QDockWidget
|
class ConsoleWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ConsoleWidget(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
explicit ConsoleWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
explicit ConsoleWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
|
||||||
|
|
||||||
~ConsoleWidget();
|
~ConsoleWidget();
|
||||||
|
|
||||||
|
37
src/widgets/CutterDockWidget.cpp
Normal file
37
src/widgets/CutterDockWidget.cpp
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#include "CutterDockWidget.h"
|
||||||
|
#include "MainWindow.h"
|
||||||
|
|
||||||
|
|
||||||
|
CutterDockWidget::CutterDockWidget(MainWindow *main, QAction *action) :
|
||||||
|
QDockWidget(main),
|
||||||
|
action(action)
|
||||||
|
{
|
||||||
|
main->addToDockWidgetList(this);
|
||||||
|
if (action) {
|
||||||
|
main->addDockWidgetAction(this, action);
|
||||||
|
connect(action, &QAction::triggered, this, &CutterDockWidget::toggleDockWidget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CutterDockWidget::toggleDockWidget(bool show)
|
||||||
|
{
|
||||||
|
if (!show)
|
||||||
|
{
|
||||||
|
this->close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->show();
|
||||||
|
this->raise();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CutterDockWidget::closeEvent(QCloseEvent * event) {
|
||||||
|
if (action) {
|
||||||
|
this->action->setChecked(false);
|
||||||
|
}
|
||||||
|
QDockWidget::closeEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
CutterDockWidget::~CutterDockWidget() {}
|
27
src/widgets/CutterDockWidget.h
Normal file
27
src/widgets/CutterDockWidget.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#ifndef CUTTERWIDGET_H
|
||||||
|
#define CUTTERWIDGET_H
|
||||||
|
|
||||||
|
#include <QDockWidget>
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
|
class CutterDockWidget : public QDockWidget
|
||||||
|
{
|
||||||
|
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit CutterDockWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
|
~CutterDockWidget();
|
||||||
|
public slots:
|
||||||
|
void toggleDockWidget(bool show);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
QAction *action;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void closeEvent(QCloseEvent * event) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CUTTERWIDGET_H
|
@ -12,11 +12,9 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QLayoutItem>
|
#include <QLayoutItem>
|
||||||
|
|
||||||
|
Dashboard::Dashboard(MainWindow *main, QAction *action) :
|
||||||
Dashboard::Dashboard(MainWindow *main, QWidget *parent) :
|
CutterDockWidget(main, action),
|
||||||
QDockWidget(parent),
|
ui(new Ui::Dashboard)
|
||||||
ui(new Ui::Dashboard),
|
|
||||||
main(main)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
#define DASHBOARD_H
|
#define DASHBOARD_H
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
||||||
@ -12,12 +11,12 @@ namespace Ui
|
|||||||
class Dashboard;
|
class Dashboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Dashboard : public QDockWidget
|
class Dashboard : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Dashboard(MainWindow *main, QWidget *parent = 0);
|
explicit Dashboard(MainWindow *main, QAction *action = nullptr);
|
||||||
~Dashboard();
|
~Dashboard();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -25,7 +24,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::Dashboard> ui;
|
std::unique_ptr<Ui::Dashboard> ui;
|
||||||
MainWindow *main;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DASHBOARD_H
|
#endif // DASHBOARD_H
|
||||||
|
@ -37,8 +37,8 @@ static DisassemblyTextBlockUserData *getUserData(const QTextBlock &block)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DisassemblyWidget::DisassemblyWidget(QWidget *parent)
|
DisassemblyWidget::DisassemblyWidget(MainWindow *main, QAction *action)
|
||||||
: QDockWidget(parent)
|
: CutterDockWidget(main, action)
|
||||||
, mCtxMenu(new DisassemblyContextMenu(this))
|
, mCtxMenu(new DisassemblyContextMenu(this))
|
||||||
, mDisasScrollArea(new DisassemblyScrollArea(this))
|
, mDisasScrollArea(new DisassemblyScrollArea(this))
|
||||||
, mDisasTextEdit(new DisassemblyTextEdit(this))
|
, mDisasTextEdit(new DisassemblyTextEdit(this))
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define DISASSEMBLYWIDGET_H
|
#define DISASSEMBLYWIDGET_H
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
#include <QDockWidget>
|
#include "CutterDockWidget.h"
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
@ -12,11 +12,11 @@ class DisassemblyTextEdit;
|
|||||||
class DisassemblyScrollArea;
|
class DisassemblyScrollArea;
|
||||||
class DisassemblyContextMenu;
|
class DisassemblyContextMenu;
|
||||||
|
|
||||||
class DisassemblyWidget : public QDockWidget
|
class DisassemblyWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit DisassemblyWidget(QWidget *parent = nullptr);
|
explicit DisassemblyWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
QWidget* getTextWidget();
|
QWidget* getTextWidget();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -12,10 +12,9 @@
|
|||||||
* Entrypoint Widget
|
* Entrypoint Widget
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EntrypointWidget::EntrypointWidget(MainWindow *main, QWidget *parent) :
|
EntrypointWidget::EntrypointWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::EntrypointWidget),
|
ui(new Ui::EntrypointWidget)
|
||||||
main(main)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
#define ENTRYPOINTWIDGET_H
|
#define ENTRYPOINTWIDGET_H
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <QDockWidget>
|
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
#include <QTreeWidgetItem>
|
#include <QTreeWidgetItem>
|
||||||
|
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
|
|
||||||
@ -15,12 +15,12 @@ namespace Ui
|
|||||||
class EntrypointWidget;
|
class EntrypointWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class EntrypointWidget : public QDockWidget
|
class EntrypointWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit EntrypointWidget(MainWindow *main, QWidget *parent = 0);
|
explicit EntrypointWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~EntrypointWidget();
|
~EntrypointWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -30,7 +30,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::EntrypointWidget> ui;
|
std::unique_ptr<Ui::EntrypointWidget> ui;
|
||||||
MainWindow *main;
|
|
||||||
|
|
||||||
void setScrollMode();
|
void setScrollMode();
|
||||||
};
|
};
|
||||||
|
@ -129,16 +129,12 @@ bool ExportsSortFilterProxyModel::lessThan(const QModelIndex &left, const QModel
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
ExportsWidget::ExportsWidget(MainWindow *main, QWidget *parent) :
|
ExportsWidget::ExportsWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::ExportsWidget),
|
ui(new Ui::ExportsWidget)
|
||||||
main(main)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
// Radare core found in:
|
|
||||||
this->main = main;
|
|
||||||
|
|
||||||
exports_model = new ExportsModel(&exports, this);
|
exports_model = new ExportsModel(&exports, this);
|
||||||
exports_proxy_model = new ExportsSortFilterProxyModel(exports_model, this);
|
exports_proxy_model = new ExportsSortFilterProxyModel(exports_model, this);
|
||||||
ui->exportsTreeView->setModel(exports_proxy_model);
|
ui->exportsTreeView->setModel(exports_proxy_model);
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
@ -61,12 +61,12 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ExportsWidget : public QDockWidget
|
class ExportsWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ExportsWidget(MainWindow *main, QWidget *parent = 0);
|
explicit ExportsWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~ExportsWidget();
|
~ExportsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -76,7 +76,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::ExportsWidget> ui;
|
std::unique_ptr<Ui::ExportsWidget> ui;
|
||||||
MainWindow *main;
|
|
||||||
|
|
||||||
ExportsModel *exports_model;
|
ExportsModel *exports_model;
|
||||||
ExportsSortFilterProxyModel *exports_proxy_model;
|
ExportsSortFilterProxyModel *exports_proxy_model;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#include <QDockWidget>
|
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@ -127,8 +126,8 @@ bool FlagsSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FlagsWidget::FlagsWidget(MainWindow *main, QWidget *parent) :
|
FlagsWidget::FlagsWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::FlagsWidget),
|
ui(new Ui::FlagsWidget),
|
||||||
main(main)
|
main(main)
|
||||||
{
|
{
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
@ -57,12 +57,12 @@ namespace Ui
|
|||||||
class FlagsWidget;
|
class FlagsWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class FlagsWidget : public QDockWidget
|
class FlagsWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FlagsWidget(MainWindow *main, QWidget *parent = 0);
|
explicit FlagsWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~FlagsWidget();
|
~FlagsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -347,10 +347,9 @@ bool FunctionSortFilterProxyModel::lessThan(const QModelIndex &left, const QMode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionsWidget::FunctionsWidget(MainWindow *main, QWidget *parent) :
|
FunctionsWidget::FunctionsWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::FunctionsWidget),
|
ui(new Ui::FunctionsWidget)
|
||||||
main(main)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
@ -86,12 +86,12 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FunctionsWidget : public QDockWidget
|
class FunctionsWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FunctionsWidget(MainWindow *main, QWidget *parent = 0);
|
explicit FunctionsWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~FunctionsWidget();
|
~FunctionsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
34
src/widgets/GraphWidget.cpp
Normal file
34
src/widgets/GraphWidget.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#include "MainWindow.h"
|
||||||
|
#include "GraphWidget.h"
|
||||||
|
#include "DisassemblerGraphView.h"
|
||||||
|
|
||||||
|
GraphWidget::GraphWidget(MainWindow *main, QAction *action) :
|
||||||
|
CutterDockWidget(main, action)
|
||||||
|
{
|
||||||
|
this->setObjectName("Graph");
|
||||||
|
this->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
this->graphView = new DisassemblerGraphView(this);
|
||||||
|
this->setWidget(graphView);
|
||||||
|
|
||||||
|
connect(this, &QDockWidget::visibilityChanged, this, [](bool visibility)
|
||||||
|
{
|
||||||
|
if (visibility)
|
||||||
|
{
|
||||||
|
Core()->setMemoryWidgetPriority(CutterCore::MemoryWidgetType::Graph);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(Core(), &CutterCore::raisePrioritizedMemoryWidget, this, [ = ](CutterCore::MemoryWidgetType type)
|
||||||
|
{
|
||||||
|
if (type == CutterCore::MemoryWidgetType::Graph)
|
||||||
|
{
|
||||||
|
this->raise();
|
||||||
|
this->graphView->setFocus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GraphWidget::~GraphWidget() {}
|
22
src/widgets/GraphWidget.h
Normal file
22
src/widgets/GraphWidget.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef GRAPHWIDGET_H
|
||||||
|
#define GRAPHWIDGET_H
|
||||||
|
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
class DisassemblerGraphView;
|
||||||
|
|
||||||
|
class GraphWidget : public CutterDockWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit GraphWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
|
~GraphWidget();
|
||||||
|
|
||||||
|
private:
|
||||||
|
DisassemblerGraphView *graphView;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GRAPHWIDGET_H
|
@ -13,8 +13,8 @@
|
|||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|
||||||
HexdumpWidget::HexdumpWidget(QWidget *parent, Qt::WindowFlags flags) :
|
HexdumpWidget::HexdumpWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent, flags),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::HexdumpWidget)
|
ui(new Ui::HexdumpWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@ -85,12 +85,6 @@ HexdumpWidget::HexdumpWidget(QWidget *parent, Qt::WindowFlags flags) :
|
|||||||
selectHexPreview();
|
selectHexPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
HexdumpWidget::HexdumpWidget(const QString &title, QWidget *parent, Qt::WindowFlags flags)
|
|
||||||
: HexdumpWidget(parent, flags)
|
|
||||||
{
|
|
||||||
setWindowTitle(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HexdumpWidget::setupScrollSync()
|
void HexdumpWidget::setupScrollSync()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QDockWidget>
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
#include "utils/Highlighter.h"
|
#include "utils/Highlighter.h"
|
||||||
#include "utils/HexAsciiHighlighter.h"
|
#include "utils/HexAsciiHighlighter.h"
|
||||||
#include "utils/HexHighlighter.h"
|
#include "utils/HexHighlighter.h"
|
||||||
@ -19,14 +19,13 @@
|
|||||||
|
|
||||||
#include "ui_HexdumpWidget.h"
|
#include "ui_HexdumpWidget.h"
|
||||||
|
|
||||||
class HexdumpWidget : public QDockWidget
|
class HexdumpWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit HexdumpWidget(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
explicit HexdumpWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
explicit HexdumpWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
|
||||||
~HexdumpWidget();
|
~HexdumpWidget();
|
||||||
|
|
||||||
Highlighter *highlighter;
|
Highlighter *highlighter;
|
||||||
|
@ -32,10 +32,9 @@ void CMyDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, c
|
|||||||
* Imports Widget
|
* Imports Widget
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ImportsWidget::ImportsWidget(MainWindow *main, QWidget *parent) :
|
ImportsWidget::ImportsWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::ImportsWidget),
|
ui(new Ui::ImportsWidget)
|
||||||
main(main)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -3,10 +3,11 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <QDockWidget>
|
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
#include <QTreeWidgetItem>
|
#include <QTreeWidgetItem>
|
||||||
|
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
|
|
||||||
@ -15,12 +16,12 @@ namespace Ui
|
|||||||
class ImportsWidget;
|
class ImportsWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ImportsWidget : public QDockWidget
|
class ImportsWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ImportsWidget(MainWindow *main, QWidget *parent = 0);
|
explicit ImportsWidget(MainWindow *main, QAction *action);
|
||||||
~ImportsWidget();
|
~ImportsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -30,7 +31,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::ImportsWidget> ui;
|
std::unique_ptr<Ui::ImportsWidget> ui;
|
||||||
MainWindow *main;
|
|
||||||
|
|
||||||
void highlightUnsafe();
|
void highlightUnsafe();
|
||||||
void setScrollMode();
|
void setScrollMode();
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
#include <QWebEngineSettings>
|
#include <QWebEngineSettings>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
JupyterWidget::JupyterWidget(QWidget *parent, Qt::WindowFlags flags) :
|
JupyterWidget::JupyterWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent, flags),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::JupyterWidget)
|
ui(new Ui::JupyterWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <QDockWidget>
|
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
|
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
#include "utils/JupyterConnection.h"
|
#include "utils/JupyterConnection.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
@ -17,15 +17,15 @@ namespace Ui
|
|||||||
}
|
}
|
||||||
|
|
||||||
class JupyterWebView;
|
class JupyterWebView;
|
||||||
|
|
||||||
class QTabWidget;
|
class QTabWidget;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class JupyterWidget : public QDockWidget
|
class JupyterWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
JupyterWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
|
JupyterWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~JupyterWidget();
|
~JupyterWidget();
|
||||||
|
|
||||||
#ifdef CUTTER_ENABLE_QTWEBENGINE
|
#ifdef CUTTER_ENABLE_QTWEBENGINE
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
#include "utils/SyntaxHighlighter.h"
|
#include "utils/SyntaxHighlighter.h"
|
||||||
#include "utils/TempConfig.h"
|
#include "utils/TempConfig.h"
|
||||||
|
|
||||||
PseudocodeWidget::PseudocodeWidget(QWidget *parent, Qt::WindowFlags flags) :
|
PseudocodeWidget::PseudocodeWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent, flags),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::PseudocodeWidget)
|
ui(new Ui::PseudocodeWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@ -47,12 +47,6 @@ PseudocodeWidget::PseudocodeWidget(QWidget *parent, Qt::WindowFlags flags) :
|
|||||||
refresh(RVA_INVALID);
|
refresh(RVA_INVALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
PseudocodeWidget::PseudocodeWidget(const QString &title, QWidget *parent, Qt::WindowFlags flags)
|
|
||||||
: PseudocodeWidget(parent, flags)
|
|
||||||
{
|
|
||||||
setWindowTitle(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
PseudocodeWidget::~PseudocodeWidget() {}
|
PseudocodeWidget::~PseudocodeWidget() {}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef PSEUDOCODEWIDGET_H
|
#ifndef PSEUDOCODEWIDGET_H
|
||||||
#define PSEUDOCODEWIDGET_H
|
#define PSEUDOCODEWIDGET_H
|
||||||
|
|
||||||
#include <QDockWidget>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
@ -14,13 +14,12 @@ namespace Ui
|
|||||||
class QTextEdit;
|
class QTextEdit;
|
||||||
class SyntaxHighlighter;
|
class SyntaxHighlighter;
|
||||||
|
|
||||||
class PseudocodeWidget : public QDockWidget
|
class PseudocodeWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PseudocodeWidget(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
explicit PseudocodeWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
explicit PseudocodeWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
|
||||||
~PseudocodeWidget();
|
~PseudocodeWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -4,16 +4,12 @@
|
|||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "utils/Helpers.h"
|
#include "utils/Helpers.h"
|
||||||
|
|
||||||
RelocsWidget::RelocsWidget(MainWindow *main, QWidget *parent) :
|
RelocsWidget::RelocsWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::RelocsWidget),
|
ui(new Ui::RelocsWidget)
|
||||||
main(main)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
// Radare core found in:
|
|
||||||
this->main = main;
|
|
||||||
|
|
||||||
setScrollMode();
|
setScrollMode();
|
||||||
|
|
||||||
connect(Core(), SIGNAL(refreshAll()), this, SLOT(fillTreeWidget()));
|
connect(Core(), SIGNAL(refreshAll()), this, SLOT(fillTreeWidget()));
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <QDockWidget>
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
@ -13,12 +13,12 @@ namespace Ui
|
|||||||
class RelocsWidget;
|
class RelocsWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RelocsWidget : public QDockWidget
|
class RelocsWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RelocsWidget(MainWindow *main, QWidget *parent = 0);
|
explicit RelocsWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~RelocsWidget();
|
~RelocsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -28,7 +28,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::RelocsWidget> ui;
|
std::unique_ptr<Ui::RelocsWidget> ui;
|
||||||
MainWindow *main;
|
|
||||||
|
|
||||||
void setScrollMode();
|
void setScrollMode();
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "utils/Helpers.h"
|
#include "utils/Helpers.h"
|
||||||
#include "ResourcesWidget.h"
|
#include "ResourcesWidget.h"
|
||||||
|
#include "MainWindow.h"
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
ResourcesModel::ResourcesModel(QList<ResourcesDescription> *resources, QObject *parent)
|
ResourcesModel::ResourcesModel(QList<ResourcesDescription> *resources, QObject *parent)
|
||||||
@ -86,8 +87,8 @@ void ResourcesModel::endReload()
|
|||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourcesWidget::ResourcesWidget(QWidget *parent)
|
ResourcesWidget::ResourcesWidget(MainWindow *main, QAction *action) :
|
||||||
: QDockWidget(parent)
|
CutterDockWidget(main, action)
|
||||||
{
|
{
|
||||||
setObjectName("ResourcesWidget");
|
setObjectName("ResourcesWidget");
|
||||||
|
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
#define RESOURCESWIDGET_H
|
#define RESOURCESWIDGET_H
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
#include <QDockWidget>
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class ResourcesModel : public QAbstractListModel
|
class ResourcesModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -28,7 +30,7 @@ public:
|
|||||||
void endReload();
|
void endReload();
|
||||||
};
|
};
|
||||||
|
|
||||||
class ResourcesWidget : public QDockWidget
|
class ResourcesWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -38,7 +40,7 @@ private:
|
|||||||
QList<ResourcesDescription> resources;
|
QList<ResourcesDescription> resources;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ResourcesWidget(QWidget *parent = nullptr);
|
explicit ResourcesWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void refreshResources();
|
void refreshResources();
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
|
|
||||||
|
|
||||||
SdbDock::SdbDock(QWidget *parent) :
|
SdbDock::SdbDock(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::SdbDock)
|
ui(new Ui::SdbDock)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <QDockWidget>
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
@ -13,12 +13,12 @@ namespace Ui
|
|||||||
class SdbDock;
|
class SdbDock;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SdbDock : public QDockWidget
|
class SdbDock : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SdbDock(QWidget *parent = 0);
|
explicit SdbDock(MainWindow *main, QAction *action = nullptr);
|
||||||
~SdbDock();
|
~SdbDock();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -122,10 +122,9 @@ bool SearchSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelI
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SearchWidget::SearchWidget(MainWindow *main, QWidget *parent) :
|
SearchWidget::SearchWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::SearchWidget),
|
ui(new Ui::SearchWidget)
|
||||||
main(main)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
@ -57,12 +57,12 @@ namespace Ui
|
|||||||
class SearchWidget;
|
class SearchWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SearchWidget : public QDockWidget
|
class SearchWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SearchWidget(MainWindow *main, QWidget *parent = 0);
|
explicit SearchWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~SearchWidget();
|
~SearchWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -73,7 +73,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::SearchWidget> ui;
|
std::unique_ptr<Ui::SearchWidget> ui;
|
||||||
MainWindow *main;
|
|
||||||
|
|
||||||
SearchModel *search_model;
|
SearchModel *search_model;
|
||||||
SearchSortFilterProxyModel *search_proxy_model;
|
SearchSortFilterProxyModel *search_proxy_model;
|
||||||
|
@ -8,15 +8,13 @@
|
|||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
|
|
||||||
|
|
||||||
SectionsDock::SectionsDock(MainWindow *main, QWidget *parent) :
|
SectionsDock::SectionsDock(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::SectionsDock)
|
ui(new Ui::SectionsDock),
|
||||||
|
main(main)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
// Radare core found in:
|
|
||||||
this->main = main;
|
|
||||||
|
|
||||||
this->sectionsWidget = new SectionsWidget(this->main);
|
this->sectionsWidget = new SectionsWidget(this->main);
|
||||||
this->setWidget(this->sectionsWidget);
|
this->setWidget(this->sectionsWidget);
|
||||||
this->sectionsWidget->setContentsMargins(0, 0, 0, 5);
|
this->sectionsWidget->setContentsMargins(0, 0, 0, 5);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <QDockWidget>
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class SectionsWidget;
|
class SectionsWidget;
|
||||||
@ -13,12 +13,12 @@ namespace Ui
|
|||||||
class SectionsDock;
|
class SectionsDock;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SectionsDock : public QDockWidget
|
class SectionsDock : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SectionsDock(MainWindow *main, QWidget *parent = 0);
|
explicit SectionsDock(MainWindow *main, QAction *action = nullptr);
|
||||||
~SectionsDock();
|
~SectionsDock();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
|
|
||||||
SidebarWidget::SidebarWidget(QWidget *parent, Qt::WindowFlags flags) :
|
SidebarWidget::SidebarWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent, flags),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::SidebarWidget)
|
ui(new Ui::SidebarWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@ -35,13 +35,6 @@ SidebarWidget::SidebarWidget(QWidget *parent, Qt::WindowFlags flags) :
|
|||||||
connect(Core(), SIGNAL(refreshAll()), this, SLOT(refresh()));
|
connect(Core(), SIGNAL(refreshAll()), this, SLOT(refresh()));
|
||||||
}
|
}
|
||||||
|
|
||||||
SidebarWidget::SidebarWidget(const QString &title, QWidget *parent, Qt::WindowFlags flags)
|
|
||||||
: SidebarWidget(parent, flags)
|
|
||||||
{
|
|
||||||
setWindowTitle(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SidebarWidget::~SidebarWidget()
|
SidebarWidget::~SidebarWidget()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,15 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QDockWidget>
|
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
#include "utils/Highlighter.h"
|
#include "utils/Highlighter.h"
|
||||||
#include "utils/HexAsciiHighlighter.h"
|
#include "utils/HexAsciiHighlighter.h"
|
||||||
#include "utils/HexHighlighter.h"
|
#include "utils/HexHighlighter.h"
|
||||||
@ -24,13 +25,12 @@ namespace Ui
|
|||||||
class SidebarWidget;
|
class SidebarWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SidebarWidget : public QDockWidget
|
class SidebarWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SidebarWidget(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
explicit SidebarWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
explicit SidebarWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
|
||||||
~SidebarWidget();
|
~SidebarWidget();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -132,8 +132,8 @@ bool StringsSortFilterProxyModel::lessThan(const QModelIndex &left, const QModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
StringsWidget::StringsWidget(QWidget *parent) :
|
StringsWidget::StringsWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::StringsWidget)
|
ui(new Ui::StringsWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
@ -55,12 +55,12 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class StringsWidget : public QDockWidget
|
class StringsWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit StringsWidget(QWidget *parent = nullptr);
|
explicit StringsWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~StringsWidget();
|
~StringsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
|
|
||||||
|
|
||||||
SymbolsWidget::SymbolsWidget(QWidget *parent) :
|
SymbolsWidget::SymbolsWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::SymbolsWidget)
|
ui(new Ui::SymbolsWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <QDockWidget>
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
@ -13,12 +13,12 @@ namespace Ui
|
|||||||
class SymbolsWidget;
|
class SymbolsWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SymbolsWidget : public QDockWidget
|
class SymbolsWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SymbolsWidget(QWidget *parent = 0);
|
explicit SymbolsWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~SymbolsWidget();
|
~SymbolsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -113,16 +113,12 @@ bool TypesSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIn
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
TypesWidget::TypesWidget(MainWindow *main, QWidget *parent) :
|
TypesWidget::TypesWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::TypesWidget),
|
ui(new Ui::TypesWidget)
|
||||||
main(main)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
// Radare core found in:
|
|
||||||
this->main = main;
|
|
||||||
|
|
||||||
types_model = new TypesModel(&types, this);
|
types_model = new TypesModel(&types, this);
|
||||||
types_proxy_model = new TypesSortFilterProxyModel(types_model, this);
|
types_proxy_model = new TypesSortFilterProxyModel(types_model, this);
|
||||||
ui->typesTreeView->setModel(types_proxy_model);
|
ui->typesTreeView->setModel(types_proxy_model);
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
@ -61,12 +61,12 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TypesWidget : public QDockWidget
|
class TypesWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TypesWidget(MainWindow *main, QWidget *parent = 0);
|
explicit TypesWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~TypesWidget();
|
~TypesWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -76,7 +76,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::TypesWidget> ui;
|
std::unique_ptr<Ui::TypesWidget> ui;
|
||||||
MainWindow *main;
|
|
||||||
|
|
||||||
TypesModel *types_model;
|
TypesModel *types_model;
|
||||||
TypesSortFilterProxyModel *types_proxy_model;
|
TypesSortFilterProxyModel *types_proxy_model;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
|
|
||||||
|
#include "MainWindow.h"
|
||||||
#include "VTablesWidget.h"
|
#include "VTablesWidget.h"
|
||||||
#include "ui_VTablesWidget.h"
|
#include "ui_VTablesWidget.h"
|
||||||
|
|
||||||
@ -142,8 +143,8 @@ bool VTableSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VTablesWidget::VTablesWidget(QWidget *parent) :
|
VTablesWidget::VTablesWidget(MainWindow *main, QAction *action) :
|
||||||
QDockWidget(parent),
|
CutterDockWidget(main, action),
|
||||||
ui(new Ui::VTablesWidget)
|
ui(new Ui::VTablesWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@ -5,15 +5,17 @@
|
|||||||
|
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
#include "CutterDockWidget.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class VTablesWidget;
|
class VTablesWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class VTableModel : public QAbstractItemModel
|
class VTableModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -49,12 +51,12 @@ protected:
|
|||||||
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
|
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class VTablesWidget : public QDockWidget
|
class VTablesWidget : public CutterDockWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit VTablesWidget(QWidget *parent = 0);
|
explicit VTablesWidget(MainWindow *main, QAction *action = nullptr);
|
||||||
~VTablesWidget();
|
~VTablesWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
Loading…
Reference in New Issue
Block a user