我想要覆盖可以显示图像并可以在同一项目上使用QPainter绘图的QGraphicsPixmapItem。qraphicsselectionPixmapitem.h#define QGRAPHICSSELECTIONPIXMAPITEM_H#include <QPainter>
class QGraphi
我按键盘按钮,但我添加到我的QGraphicsPixmapItem QGraphicsScene不移动,我已经实现了一个keyPressedEvent函数. class marioChar : public QObject, public QGraphicsPixmapItemQ_OBJECT bool
我想我需要更多地解释一下这个游戏,所以这里有一些基本的代码可以让您了解它是如何工作的:class Piece : public QGraphicsPixmapItempublicknow how to make it move
我正在考虑把这些部分变成全局的,这样我就可以在这个函数中访问它们,并在这个位置上做一些类似piece[1].setPos()的事情,但是我不能使一个QGraphicsPixmapItem
我知道,如果我使用QObject,我需要从QGraphicsPixmapItem派生,以便连接到一个插槽,但是我很难做到这一点。run->setFlag(QGraphicsPixmapItem::ItemIsSelectable);if (run->isSelected()) { qDebug() << "selected";}QGraphicsPixmapItem* run = new QGraphicsPixmapItem(QPixmap::fromImage(image6)