c++ - Widget won't hide -


i guess silly question why doesn't widget hide after shown?

void dialog::on_tabwidget_selected(const qstring &arg1){     qwidget *w = new qwidget();     if(ui->tabwidget->currentindex() == 3){              w -> move(1093,278);              w -> setwindowflags(qt::windowstaysontophint | qt::framelesswindowhint);              w -> setfixedsize(206,206);              w -> show();      }else{         w ->hide();     } } 

the second time, creats new qwidget, hide not affect old widget if that's want do. maybe should explain little bit more result expected ?

edit: if want display popup when tab open, use widget's showevent , hideevent. or can remove "widget *w = new widget();", add "qwidget *w;" *.h, , add "w = new qwidget();" constructor, , should work.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -