class CutterGraphView : public GraphView

Common Cutter specific graph functionality.

Subclassed by DisassemblerGraphView, SimpleTextGraphView

Public Types

enum GraphExportType


enumerator Png
enumerator Jpeg
enumerator Svg
enumerator GVDot
enumerator GVJson
enumerator GVGif
enumerator GVPng
enumerator GVJpeg
enumerator GVPostScript
enumerator GVSvg
enumerator R2Gml
enumerator R2SDBKeyValue
enumerator R2Json

Public Functions

CutterGraphView(QWidget *parent)
bool event(QEvent *event) override
void exportGraph(QString filePath, GraphExportType type, QString graphCommand = "", RVA address = RVA_INVALID)

Export graph to a file in the specified format.

  • filePath:

  • type: export type, GV* and R2* types require graphCommand

  • graphCommand: r2 graph printing command without type, not required for direct image export

  • address: object address for commands like agf

void exportR2GraphvizGraph(QString filePath, QString type, QString graphCommand, RVA address)

Export image using r2 ag*w command and graphviz. Requires graphviz dot executable in the path.

  • filePath: output file path

  • type: image format as expected by “e graph.gv.format”

  • graphCommand: r2 command without type, for example agf

  • address: object address if required by command

void exportR2TextGraph(QString filePath, QString graphCommand, RVA address)

Export graph in one of the text formats supported by r2 json, gml, SDB key-value.

  • filePath: output file path

  • graphCommand: graph command including the format, example “agfd” or “agfg”

  • address: object address if required by command

void showExportGraphDialog(QString defaultName, QString graphCommand = "", RVA address = RVA_INVALID)

Show graph export dialog.

  • defaultName: - default file name in the export dialog

  • graphCommand: - R2 graph commmand with graph type and without export type, for example afC. Leave empty for non-r2 graphs. In such case only direct image export will be available.

  • address: - object address if relevant for graphCommand

Public Slots

void refreshView()
void updateColors()
void fontsUpdatedSlot()
void zoom(QPointF mouseRelativePos, double velocity)
void setZoom(QPointF mouseRelativePos, double scale)
void zoomIn()
void zoomOut()
void zoomReset()
void showExportDialog()

Show the export file dialog. Override this to support r2 based export formats.


void viewRefreshed()
void viewZoomed()
void graphMoved()
void resized()

Public Static Functions

bool graphIsBitamp(GraphExportType type)