MainWindow

class MainWindow : public QMainWindow

Public Types

enum MenuType

Values:

enumerator File
enumerator Edit
enumerator View
enumerator Windows
enumerator Debug
enumerator Help
enumerator Plugins
enum ContextMenuType

Values:

enumerator Disassembly
enumerator Addressable

Public Functions

MainWindow(QWidget *parent = nullptr)
~MainWindow() override
void openNewFile(InitialOptions &options, bool skipOptionsDialog = false)
void displayNewFileDialog()
void displayWelcomeDialog()

displays the WelocmeDialog

Upon first execution of Cutter, the WelcomeDialog would be showed to the user. The Welcome dialog would be showed after a reset of Cutter’s preferences by the user.

void closeNewFileDialog()
void openProject(const QString &project_name)
bool saveProject(bool quit = false)

Return

if quit is true, false if the application should not close

Parameters
  • quit: whether to show destructive button in dialog

bool saveProjectAs(bool quit = false)

Return

false if the application should not close

Parameters
  • quit: whether to show destructive button in dialog

void closeEvent(QCloseEvent *event) override
void paintEvent(QPaintEvent *event) override
void readSettings()
void saveSettings()
void setFilename(const QString &fn)
void refreshOmniBar(const QStringList &flags)
void addWidget(CutterDockWidget *widget)
void addMemoryDockWidget(MemoryDockWidget *widget)
void removeWidget(CutterDockWidget *widget)
void addExtraWidget(CutterDockWidget *extraDock)
MemoryDockWidget *addNewMemoryWidget(MemoryWidgetType type, RVA address, bool synchronized = true)
void addPluginDockWidget(CutterDockWidget *dockWidget, QAction*)
void addPluginDockWidget(CutterDockWidget *dockWidget)
QMenu *getMenuByType(MenuType type)

Getter for MainWindow’s different menus.

Return

The requested menu or nullptr if “type” is invalid

Parameters
  • type: The type which represents the desired menu

void addMenuFileAction(QAction *action)
QString getFilename() const
void messageBoxWarning(QString title, QString message)

Show a warning message box.

This API can either be used in Cutter internals, or by Python plugins.

QString getUniqueObjectName(const QString &widgetType) const
void showMemoryWidget()
void showMemoryWidget(MemoryWidgetType type)
QMenu *createShowInMenu(QWidget *parent, RVA address)
void setCurrentMemoryWidget(MemoryDockWidget *memoryWidget)
MemoryDockWidget *getLastMemoryWidget()
QMenu *getContextMenuExtensions(ContextMenuType type)

Fetches the pointer to a context menu extension of type.

Return

plugins submenu of the selected context menu

Parameters
  • type: - the type of the context menu

Public Members

bool responsive

Public Slots

void finalizeOpen()
void refreshAll()
void seekToFunctionLastInstruction()
void seekToFunctionStart()
void setPanelLock()
void setTabLocation()
void on_actionLock_triggered()
void on_actionLockUnlock_triggered()
void on_actionTabs_triggered()
void lockUnlock_Docks(bool what)
void on_actionRun_Script_triggered()
void toggleResponsive(bool maybe)
void openNewFileFailed()
void toggleOverview(bool visibility, GraphWidget *targetGraph)