c++ - Qt4 qwidget after shown event -


i need handle event fired after widget visible after show event. cannot find event in qt4. tried solutions suggested below. none of them worked.

my aim: working on embedded system , using qt ui. trying show hardware accelerated camera on ui after customwidget shown. if use showevent, camera shown before customwidget drawn. seems showevent fired before widget drawn. behaves before show event.

failure-1

bool customwidget::event(qevent *event) {    bool returnvalue = qwidget::event(event);    if (event->type() == qevent::polish)    {        this->camera->show();    }    return returnvalue; } 

polish event called once. when hide , show widget again , again, never fired.

failure-2

void customwidget::showevent(qshowevent *event) {     qwidget::showevent(event);     qtimer::singleshot(0, this, slot(dialogexec)); }  void customwidget::dialogexec() {     this->camera->show(); } 

this did not work either.

failure-3

void customwidget::paintevent( qpaintevent *event ) {    qwidget::paintevent( event );     if( !this->camera->isvisible() )    {        this->camera->show();    } }  void customwidget::hideevent( qhideevent *event ) {    this->camera->hide(); } 

qwidget has protected members called closeevent( qcloseevent* event ) , showevent( qshowevent* event ). maybe can use these methods manage camera.


Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -