PDA

View Full Version : setVisible(false) doesn't work



sepehr
4th February 2009, 15:25
I'm trying to temporarily hide a QMenu which contains some actions ,but
ui.menu_management->setVisible(false); doesn't seem to work,how can I approach this?

jpn
4th February 2009, 16:15
Why do you have the menu on the heap as a member variable in the first place? Wouldn't it be better to create it on the stack once needed, execute it, and let it go out of scope? Something like what is shown in QMenu::exec() docs.

caduel
4th February 2009, 16:20
try

ui.menu_management->menuAction()->setVisible(false);

the ";" after a class decl is needed because C allows you to write stuff like
struct hello {
int i;
} an_object_of_type_hello;

saving you the trouble of writing the impossibly long
struct hello an_object_of_type_hello;