[Qt-interest] Toggle visibility of a QMainWindow's menu bar?
R. Reucher
rene.reucher at batcom-it.net
Tue Jan 13 08:44:28 CET 2009
On Sun January 11 2009 17:53:42 R. Reucher wrote:
> After some tests I'd now rather say "it _basically_ works", because
> hide()'ing the menuBar() pops up another issue: all menu short cuts seem to
> be disabled while the menuBar() is hidden.
>
> Am I still missing something or is there an easy solution to this?
According to the QAction documentation, this is wanted behaviour:
<quote>
visible : bool
This property holds whether the action can be seen (e.g. in menus and
toolbars).
If visible is true the action can be seen (e.g. in menus and toolbars) and
chosen by the user; if visible is false the action cannot be seen or chosen
by the user.
Actions which are not visible are not grayed out; they do not appear at all.
</quote>
Fortunately, I found a work around by using my already existing
application-wide eventFilter() and trigger()'ing the actions if one of the
short cut key sequence is recognized...
Have fun, René
--
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/
Documentation is like sex: when it is good, it is very, very good; and
when it is bad, it is better than nothing.
-- Dick Brandon
More information about the Qt-interest-old
mailing list