Translations:Development/Tutorials/Physical Simulation/85/en

From KDE TechBase
Revision as of 17:41, 19 July 2019 by FuzzyBot (talk | contribs) (Importing a new version from external source)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

void BallGraph::paintEvent(QPaintEvent* event) {

   double position=logic->getPosition();
   QPainter painter(this);
   painter.setRenderHint(QPainter::Antialiasing, true);
   //draw ball
   painter.setPen(QPen(Qt::red, 4));
   painter.drawEllipse(95, 575-position, 2*radius, -2*radius);
   //draw floor
   painter.fillRect( 10, 595, 180, -20 , QColor(40, 40, 40) );

} </syntaxhighlight>