With this constructor
Planet::Planet() //:QGraphicsEllipseItem(QRect(0,0,0,0))
{
}
Planet::Planet() //:QGraphicsEllipseItem(QRect(0,0,0,0))
{
setBrush(QBrush(QColor(45,21,182)));
setPen(QPen(QColor(200,10,10)));
}
To copy to clipboard, switch view to plain text mode
I get different colors, but it doesn't change the Brush if I add
setBrush(QBrush(QColor(rand()%255,rand()%255,rand()%255)));
To copy to clipboard, switch view to plain text mode
to the
void Planet::paint(QPainter* painter, QStyleOptionGraphicsItem* option,QWidget* widget)
To copy to clipboard, switch view to plain text mode
function.
Strange.
Bookmarks