So I created this nice PushButton that has a popmenu. Unlike QToolButton, it does not allow me to hide()/show() the button which I find frustrating. I want to be able to hide/destroy this button while the application is in a certain mode and then show/create it in another. How do I do this? (are there no destructor calls in Python?) Or are there an alternative?

Thanks,
Jo

Recommended Answers

All 2 Replies

So I created this nice PushButton that has a popmenu. Unlike QToolButton, it does not allow me to hide()/show() the button which I find frustrating. I want to be able to hide/destroy this button while the application is in a certain mode and then show/create it in another. How do I do this? (are there no destructor calls in Python?) Or are there an alternative?

Thanks,
Jo

So I figured out why the PushButton wasn't hiding. Apparently if I comment out my setMenu functionality to it, it works as expected. How do get rid of the setMenu when I'm in a the other mode?

As NOT wizards, we don't guess code solutions.


Cheers and Happy coding

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.