qt - QMainWindow stops receiving QEvent::UpdateRequest when user opens menu or resizes window -


mywindow inherits qmainwindow. mywindow contains qglwidget displays animation.

the problem animation pauses whenever open menu or resize window.

the animation implemented calling qcoreapplication::postevent(this, new qevent(qevent::updaterequest)) periodically, calling redrawing each time window receives qevent::updaterequest, this:

bool mywindow::event(qevent *event) {     qdebug() << event;     switch (event->type())     {         case qevent::updaterequest:             render();             return true;         default:             return qmainwindow::event(event);     } } 

as seen qdebug(), while menu open or window being resized, window stops receiving update request events.

is there setting on qmainwindow/qwidget make continue receive update request events? or there better way implement animation?

edit: i'm on mac os x.

this may qt bug. i'll investigate.

alas, you're way overcomplicating code.

  1. the postevent should replaced this->update(). behind scenes posts event you.

  2. one can connect qtimer instance's signal widget, slot(update()). if want save on qobject instance, use qbasictimer , reimplement timerevent follows: void mywidget::timerevent(qtimerevent* ev) { if (ev.timerid() == m_timer.timerid()) update(); }

  3. there's no need deal event() reimplementation. reimplement paintevent() - that's it's for.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -