We'd like to control the visibility of tool bars in MITK applications through preferences to ease access to this functionality also to other parts of MITK. This task is dedicated to the first step in that direction: Enumerate all tool bars in the preferences with a checkbox for visibility and apply visibility as soon as preference changes are applied.
Unfortunately the actual Qt tool bars are hidden behind multiple layers of abstraction and interfaces that are partly explicitly made private to prevent access. Multiple BlueBerry classes would need substantial interface and dependency changes to allow for an easy interface access. Ideally, no extra code should be necessary in the window advisors derivates of our applications, which ultimately set up everything. With a simple contract, we can circumvent all these changes. The toolbars already use QWidget::objectName() to set their name/id to "<category> View Toolbar", which is a bit arbitrary (and already has a typo) for our purposes. I propose to simply change their name to "<category>", which is an easy and clear contract and then use Qt to query all toolbars of all Workbench windows and compare their names accordingly. Access to the QMainWindow through BlueBerry is possible and already done at a few places.