How to fill a QGraphicsRecItem with color
-
error: class QGraphicsItem has no member named "setBrush"
ok, which member function can fill color.@
ui->setupUi(this);
QGraphicsItem *ball = new QGraphicsRectItem(0, 0, 20, 20);
ball->setBrush(QBrush((Qt::darkBlue)));QTimeLine *timer = new QTimeLine(5000); timer->setFrameRange(0, 100);
@
-
#include <QGraphicsRectItem>
Forgot it?
-
The header file has been included
-
Yeah sorry... QGraphicsItem does not know setBrush. You need a QGraphicsRectItem for using setBrush.
Wrong cast in line 3...