c++ - Using QtimerEvent in QGraphicsScene -
TimerEvents, which is a member of the QGLWidget class, will be triggered when the mouse-function is called. I thought I could do it like this:
zero GLWidget :: timerEvent (QTimerEvent * E) {if (e-> gt; timerId) == 1 & amp; Amp; & Amp; Amp; & Amp; Refresh == true) {refresh =! Refresh; SwapBuffers (); Updates(); }} It looks like:
Zero OpenGLCEN :: MouseViewAvent (QGraphicsSceneMouseEvent * Event) {int mousex = event- & gt; ScenePos () (X); Int Mason = Event-> Viewpoint () Y (); If ((test-> mode == 2) & amp; amp; amp; and (test-> 1; = 1) =} {p_list [test-> gt1] .x = mousex- (1220) ; P_list [test-> move1] .y = mousey- (610); test-> refresh =! (Test-> refresh); test & gt; timerEvent (???); update ();}} But in some way I do not know where the question marks are. I have tried many things. It is not working. I want to set timerId () = 1 Thanks for the help ...
Why do not you call your own incident : Zero OpenGLCN :: MouseViewEvent (QGraphicsSceneMouseEvent * event) {// ... if ((test-> modus == 2) & amp; amp; and (test-gt ; Trick 1! = -1)) {// ... test-> refresh =! (Test-> Refresh); // Testing replaced by; timerEvent (???); test-> Manual updates (); // your own function // ...}} and in your GL widget:
zero GLWidget :: manuelUpdate ( ) {If (refresh = true =) {Refresh =! Refresh; SwapBuffers (); Updates(); }}
Comments
Post a Comment