17#include <QGraphicsItem>
32 QGraphicsItem* parent =
nullptr);
39 QGraphicsItem* parent =
nullptr);
45 QGraphicsItem* parent =
nullptr);
54 QGraphicsItem* parent =
nullptr);
58 void paint(QPainter* painter,
59 const QStyleOptionGraphicsItem* option,
60 QWidget* widget)
override;
64 void setRect(
int x,
int y,
int width,
int height);
A 2D cartesian grid as a QGraphicsItem.
void setRect(QRectF rect)
void setNumberOfYCells(int yCells)
Sets the number of cells in y direction.
~QGraphicsGrid() override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
Paints the grid.
void setNumberOfXCells(int xCells)
Sets the number of cells in x direction.
void initDefaultPens()
Defines the default pens.
QRectF boundingRect() const override
Returns the bounding rectangle of the grid.
QGraphicsGrid(QRectF rect, int xCells, int yCells, QGraphicsItem *parent=nullptr)