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

From KDE TechBase
Revision as of 17:42, 19 July 2019 by FuzzyBot (talk | contribs) (Importing a new version from external source)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

QTimer *timer = new QTimer(this);

   connect(timer, SIGNAL(timeout()),
           logic, SLOT( nextTimeStep() ) );
   connect(timer, SIGNAL(timeout()),
           ballGraph, SLOT(nextAnimationFrame()));
   timer->start(100);

} </syntaxhighlight> Mostly, it is the same as before, now we only define the pointers for the xy-plot and the ball-logic and give those pointers to the constructor of the ball-drawing widget. We add the drawing widget to the layout. The widgets are added from the left to the right: the first goes left, the second goes to the right of that and so on.