7 #include "fwGuiQt/builder/MenuBarBuilder.hpp" 8 #include "fwGuiQt/container/QtContainer.hpp" 9 #include "fwGuiQt/container/QtMenuBarContainer.hpp" 11 #include <fwGui/registry/macros.hpp> 13 #include <QMainWindow> 32 MenuBarBuilder::~MenuBarBuilder()
40 m_parent = ::fwGuiQt::container::QtContainer::dynamicCast(parent);
41 SLM_ASSERT(
"The parent container is not a QtContainer", m_parent);
42 QMainWindow *window = qobject_cast<QMainWindow*> ( m_parent->getQtContainer() );
45 window = qobject_cast<QMainWindow*> ( m_parent->getQtContainer()->parent() );
47 SLM_ASSERT(
"The parent container must be a QMainWindow", window );
50 ::fwGuiQt::container::QtMenuBarContainer::sptr menuBarContainer =
51 ::fwGuiQt::container::QtMenuBarContainer::New();
52 QMenuBar *menuBar =
new QMenuBar(0);
53 menuBarContainer->setQtMenuBar(menuBar);
54 window->setMenuBar( menuBar );
64 SLM_ASSERT(
"The parent container is not a QtContainer", m_parent);
65 QMainWindow *window = qobject_cast<QMainWindow*> ( m_parent->getQtContainer() );
68 window = qobject_cast<QMainWindow*> ( m_parent->getQtContainer()->parent() );
70 SLM_ASSERT(
"The parent container must be a QMainWindow", window );
73 window->setMenuBar( NULL );
The namespace fwGui contains the base interface for IHM services.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...