GraphView

class GraphView

Inherits from QAbstractScrollArea

Subclassed by DisassemblerGraphView, OverviewView

Public Types

enum Layout

Values:

GridNarrow
GridMedium
GridWide
using GraphBlock = GraphLayout::GraphBlock
using GraphEdge = GraphLayout::GraphEdge

Public Functions

GraphView(QWidget *parent)
~GraphView()
void showBlock(GraphBlock &block, bool anywhere = false)
void showBlock(GraphBlock *block, bool anywhere = false)
void showRectangle(const QRect &rect, bool anywhere = false)

Move view so that area is visible.

Parameters
  • rect: Rectangle to show
  • anywhere: - set to true for minimizing movement

GraphView::GraphBlock *getBlockContaining(QPoint p)

Get block containing specified point logical coordinates.

Return
Block or nullptr if position is outside all blocks.
Parameters
  • p: positionin graph logical coordinates

QPoint viewToLogicalCoordinates(QPoint p)
void setGraphLayout(Layout layout)
Layout getGraphLayout() const
void paint(QPainter &p, QPoint offset, QRect area, qreal scale = 1.0, bool interactive = true)
void saveAsBitmap(QString path, const char *format = nullptr)
void saveAsSvg(QString path)
QPoint getViewOffset() const
void setViewOffset(QPoint offset)
qreal getViewScale() const
void setViewScale(qreal scale)
void center()
void centerX()
void centerY()

Signal

signal GraphView::viewOffsetChanged
signal GraphView::viewScaleChanged
struct EdgeConfiguration

Public Members

QColor color = QColor(128, 128, 128)
bool start_arrow = false
bool end_arrow = true
qreal width_scale = 1.0
Qt::PenStyle lineStyle = Qt::PenStyle::SolidLine