PDA

View Full Version : Hiding a QToolButton in a QToolBar



elcuco
23rd November 2009, 19:03
Simple problem:
I have this menu on a toolbar (a QToolButton which has a QMenu attached). Then another checkable action which shows/hides that menu. But it does not. This code does not work:


toolbarMenuButton->setVisible(!hideAction->isChecked());


Full code attached here. Put it in a new dir, and to compile type:


qmake -project
qmake
make


Can anyone give me a hint, what am I missing?

elcuco
24th November 2009, 17:42
Does any one have a clue...?

mattc
24th November 2009, 18:08
see the docs for QToolbar::addWidget

http://doc.trolltech.com/4.5/qtoolbar.html#addWidget

elcuco
24th November 2009, 20:35
So trivial... thanks :)