Translations:Development/Tutorials/Physical Simulation/85/en: Difference between revisions

From KDE TechBase
(Importing a new version from external source)
 
(No difference)

Latest revision as of 17:41, 19 July 2019

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Development/Tutorials/Physical Simulation)
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>

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>