65 printer.setPaperSize(QPrinter::A4);
73 QSizeF segmentSize = sceneRect().size() / pow(2,
depth - 1);
106 QRectF TileScene::rectForTile(
int x,
int y)
const
109 return QRectF(
x * tileWidth,
y * tileHeight, tileWidth, tileHeight);
117 invalidate(rectForTile(
x,
y), BackgroundLayer);
124 for (
int y = 0;
y < numTilesV; ++
y) {
125 for (
int x = 0;
x < numTilesH; ++
x) {
The QBrush class defines the fill pattern of shapes drawn by QPainter.
The QColor class provides colors based on RGB, HSV or CMYK values.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
void addItem(QGraphicsItem *item)
void setForegroundBrush(const QBrush &brush)
void setBackgroundBrush(const QBrush &brush)
QGraphicsTextItem * addText(const QString &text, const QFont &font=QFont())
void render(QPainter *painter, const QRectF &target=QRectF(), const QRectF &source=QRectF(), Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio)
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
The QPainter class performs low-level painting on widgets and other paint devices.
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
The QPixmap class is an off-screen image representation that can be used as a paint device.
The QPrinter class is a paint device that paints on a printer.
The QRadialGradient class is used in combination with QBrush to specify a radial gradient brush.
The QRectF class defines a finite rectangle in the plane using floating point precision.
bool intersects(const QRectF &r) const noexcept
The QSizeF class defines the size of a two-dimensional object using floating point precision.
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth