I think I store all my questions about QGraphicsView in this thread.
First problem, I have a class Planet that is subclassedfrom GraphicsItem and I have this to draw it
{
painter
->setBrush
(QColor(Qt
::red));
painter->drawEllipse(x,y,2*radius,2*radius);
}
void Planet::paint(QPainter* painter, QStyleOptionGraphicsItem* option,QWidget* widget)
{
painter->setBrush(QColor(Qt::red));
painter->drawEllipse(x,y,2*radius,2*radius);
}
To copy to clipboard, switch view to plain text mode
but all I get is a black circle on a white background. And the view isn't updated very much. How do I draw the ellipse and how do I update it more often?
Bookmarks