Developer documentation | Axl-2.5.1

axlMenuFactory.cpp
Go to the documentation of this file.
1 /* dtkAbstractProcessFactory.cpp ---
2  *
3  * Author: Julien Wintz
4  * Copyright (C) 2008 - Julien Wintz, Inria.
5  * Created: Fri Nov 7 15:54:10 2008 (+0100)
6  * Version: $Id: 2460ccb9838680880c0ff0a202c702fd0d42c97f $
7  * Last-Updated: mar. févr. 4 15:17:39 2014 (+0100)
8  * By: Nicolas Niclausse
9  * Update #: 125
10  */
11 
12 /* Commentary:
13  *
14  */
15 
16 /* Change log:
17  *
18  */
19 
20 #include "axlMenuFactory.h"
21 
22 class axlMenuFactoryPrivate
23 {
24 public:
25  QList<QMenu *> menus;
26 };
27 
29 {
30  if(!s_instance)
31  s_instance = new axlMenuFactory;
32 
33  return s_instance;
34 }
35 
36 
37 QList<QMenu *> axlMenuFactory::menus(void)
38 {
39  return d->menus;
40 }
41 
43 {
44  if ( ! d->menus.contains(m) )
45  {
46  d->menus << m;
47  return true;
48  }
49  else
50  return false;
51 }
52 
53 axlMenuFactory::axlMenuFactory(void) : QObject(), d(new axlMenuFactoryPrivate)
54 {
55 
56 }
57 
59 {
60  delete d;
61 
62  d = NULL;
63 }
64 
65 axlMenuFactory *axlMenuFactory::s_instance = NULL;
static axlMenuFactory * instance(void)
QList< QMenu * > menus(void)
bool registerMenu(QMenu *menu)