PDA

View Full Version : Making QWidgets(QSpinBox, QComboBox etc.) Dynamically Visible/Hidden



hakiim35
16th July 2010, 08:29
Hi all. I have a QToolBar, and several QWidgets (QSpinBox, QComboBox etc.) created as a child widget on it. When my main application is open and I can see all those toolbar and childs, I want to be able to make some of them both disabled and hidden, then again make the same ones enabled and visible throughout the program's life. setEnabled() works but setHidden(true) or setVisible(false) methods do not work. I can see a widget gets disabled, but although I set its isVisible to false, it is even seen on the QToolBar. Is there anybody knows the way to handle this?

wysota
16th July 2010, 13:01
If you place widgets on a toolbar then you should be manipulating them through QWidgetAction and not directly.

hakiim35
16th July 2010, 13:42
Thak you very much. It works.