fw4spl
QtMenuContainer.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include <QMenu>
8 #include "fwGuiQt/container/QtMenuContainer.hpp"
9 
10 namespace fwGuiQt
11 {
12 namespace container
13 {
14 
15 //-----------------------------------------------------------------------------
16 
17 QtMenuContainer::QtMenuContainer(::fwGui::GuiBaseObject::Key key) noexcept
18 {
19 }
20 
21 //-----------------------------------------------------------------------------
22 
23 QtMenuContainer::~QtMenuContainer() noexcept
24 {
25 }
26 
27 //-----------------------------------------------------------------------------
28 
29 void QtMenuContainer::clean()
30 {
31  SLM_ASSERT("The Qt menu is not yet initialized, cleaning is thus impossible", m_menu);
32  m_menu->clear();
33 }
34 
35 //-----------------------------------------------------------------------------
36 
37 void QtMenuContainer::destroyContainer()
38 {
39  SLM_ASSERT("The Qt menu not yet initialized, cleaning is thus impossible", m_menu);
40  delete m_menu;
41 }
42 
43 //-----------------------------------------------------------------------------
44 
45 void QtMenuContainer::setQtMenu(QMenu *menu)
46 {
47  this->m_menu = menu;
48 }
49 
50 //-----------------------------------------------------------------------------
51 
52 QMenu* QtMenuContainer::getQtMenu()
53 {
54  return this->m_menu;
55 }
56 
57 //-----------------------------------------------------------------------------
58 
59 } // namespace container
60 } // namespace fwGuiQt
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
The namespace fwGuiQt contains classes which provide the implementation of the Gui using Qt library...
Definition: WindowLevel.hpp:32
#define SLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:308