Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qMRMLMarkupsOptionsWidgetsFactory.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) The Intervention Centre
4 Oslo University Hospital, Oslo, Norway. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 This file was originally developed by Rafael Palomar (The Intervention Centre,
16 Oslo University Hospital), based on qMRMLMarkupsOptionsWidgetsFactory.h by
17 Csaba Pinter (Perklab, Queen's University), and was supported by The Research
18 Council of Norway through the ALive project (grant nr. 311393).
19
20 ==============================================================================*/
21
22#ifndef qMRMLMarkupsOptionsWidgetsFactory_h
23#define qMRMLMarkupsOptionsWidgetsFactory_h
24
25// Markups widgets includes
27#include "qSlicerMarkupsModuleWidgetsExport.h"
28
29// Qt includes
30#include <QObject>
31#include <QMap>
32#include <QPointer>
33#include <QWidget>
34
35// -----------------------------------------------------------------------------------------
37class qMRMLMarkupsOptionsWidgetsFactoryCleanup;
38
41class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT qMRMLMarkupsOptionsWidgetsFactory : public QObject
42{
43 Q_OBJECT
44
45public:
48 Q_INVOKABLE static qMRMLMarkupsOptionsWidgetsFactory* instance();
49
50public:
56
58 Q_INVOKABLE bool unregisterOptionsWidget(const QString& className);
59
62
64 Q_INVOKABLE void unregisterAll();
65
68 { return this->RegisteredWidgets.keys(); }
69
72 Q_INVOKABLE qMRMLMarkupsAbstractOptionsWidget* createWidget(const QString& widgetClassName);
73
74signals:
77
78protected:
80
81private:
83 static void cleanup();
84
85private:
86 qMRMLMarkupsOptionsWidgetsFactory(QObject* parent=nullptr);
87 ~qMRMLMarkupsOptionsWidgetsFactory() override;
88
89 Q_DISABLE_COPY(qMRMLMarkupsOptionsWidgetsFactory);
91 friend class PythonQtWrapper_qMRMLMarkupsOptionsWidgetsFactory; // Allow Python wrapping without enabling direct instantiation
92
93private:
95 static qMRMLMarkupsOptionsWidgetsFactory* Instance;
96};
97
98#endif
Q_INVOKABLE void unregisterAll()
Unregister all widgets.
Q_INVOKABLE bool unregisterOptionsWidget(const QString &className)
Unregister an additional options widget.
static Q_INVOKABLE qMRMLMarkupsOptionsWidgetsFactory * instance()
Q_INVOKABLE bool registerOptionsWidget(qMRMLMarkupsAbstractOptionsWidget *widget)
QMap< QString, QPointer< qMRMLMarkupsAbstractOptionsWidget > > RegisteredWidgets
Q_INVOKABLE bool unregisterOptionsWidget(qMRMLMarkupsAbstractOptionsWidget *widget)
Unregister an additional options widget.
Q_INVOKABLE const QList< QString > registeredOptionsWidgetsClassNames() const
Returns the list of additional options widgets registered.
Q_INVOKABLE qMRMLMarkupsAbstractOptionsWidget * createWidget(const QString &widgetClassName)