KGameRenderedItem Class

A QGraphicsPixmapItem which reacts to theme changes automatically. More...

Header: #include <KGameRenderedItem>
Inherits: QGraphicsPixmapItem and KGameRendererClient

Public Functions

KGameRenderedItem(KGameRenderer *renderer, const QString &spriteKey, QGraphicsItem *parent = nullptr)

Reimplemented Protected Functions

virtual void receivePixmap(const QPixmap &pixmap) override

Detailed Description

This class is a QGraphicsPixmapItem which retrieves its pixmap from a KGameRenderer, and updates it automatically when the KGameRenderer changes the theme.

Member Function Documentation

KGameRenderedItem::KGameRenderedItem(KGameRenderer *renderer, const QString &spriteKey, QGraphicsItem *parent = nullptr)

Creates a new KGameRenderedItem with parent, which renders the sprite with the given spriteKey as provided by the given renderer.

[override virtual protected] void KGameRenderedItem::receivePixmap(const QPixmap &pixmap)

Reimplements: KGameRendererClient::receivePixmap(const QPixmap &pixmap).

Sets the item's pixmap to pixmap.