97 printer.setPageSize(QPrinter::A4);
107 QRectF(0, printer.height() / 2,
108 printer.width(), printer.height() / 2),
129 qDebug(
"You didn't click on an item.");
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
void addItem(QGraphicsItem *item)
QGraphicsRectItem * addRect(const QRectF &rect, const QPen &pen=QPen(), const QBrush &brush=QBrush())
QGraphicsTextItem * addText(const QString &text, const QFont &font=QFont())
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
void mousePressEvent(QMouseEvent *event) override
QPointF mapToScene(const QPoint &point) const
QList< QGraphicsItem * > items() const
void setRenderHints(QPainter::RenderHints hints)
void setBackgroundBrush(const QBrush &brush)
void setCacheMode(CacheMode mode)
QGraphicsItem * itemAt(const QPoint &pos) const
void render(QPainter *painter, const QRectF &target=QRectF(), const QRect &source=QRect(), Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio)
The QImage class provides a hardware-independent image representation that allows direct access to th...
qsizetype size() const noexcept
The QMouseEvent class contains parameters that describe a mouse event.
The QPainter class performs low-level painting on widgets and other paint devices.
The QRectF class defines a finite rectangle in the plane using floating point precision.
The QRect class defines a rectangle in the plane using integer precision.
view viewport() -> scroll(dx, dy, deviceRect)