Slicer 5.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qSlicerSingletonViewFactory.h
Go to the documentation of this file.
1/*==============================================================================
2
3Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4Queen's University, Kingston, ON, Canada. All Rights Reserved.
5
6See COPYRIGHT.txt
7or http://www.slicer.org/copyright/copyright.txt for details.
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14
15This file was originally developed by Kyle Sunderland, PerkLab, Queen's University
16and was supported through CANARIE's Research Software Program, and Cancer
17Care Ontario.
18
19==============================================================================*/
20
21#ifndef qSlicerSingletonViewFactory_h
22#define qSlicerSingletonViewFactory_h
23
24// CTK includes
25#include "ctkLayoutViewFactory.h"
26
27// QtGUI includes
28#include "qSlicerBaseQTGUIExport.h"
29
30class ctkDICOMBrowser;
31class qSlicerSingletonViewFactoryPrivate;
32
38class Q_SLICER_BASE_QTGUI_EXPORT qSlicerSingletonViewFactory : public ctkLayoutViewFactory
39{
40 Q_OBJECT
41public:
42 typedef ctkLayoutViewFactory Superclass;
43 qSlicerSingletonViewFactory(QObject* parent=nullptr);
45
47 QStringList supportedElementNames()const override;
48
51 Q_INVOKABLE virtual void setWidget(QWidget* widget);
53 Q_INVOKABLE virtual QWidget* widget();
54
56 Q_INVOKABLE virtual void setTagName(QString tagName);
58 Q_INVOKABLE QString tagName();
59
60public slots:
61 virtual void onWidgetDestroyed();
62
63protected:
64 QScopedPointer<qSlicerSingletonViewFactoryPrivate> d_ptr;
65
67 Q_INVOKABLE QWidget* createViewFromXML(QDomElement layoutElement) override;
68
69private:
70 Q_DECLARE_PRIVATE(qSlicerSingletonViewFactory)
71};
72
73#endif
QScopedPointer< qSlicerSingletonViewFactoryPrivate > d_ptr
virtual Q_INVOKABLE void setWidget(QWidget *widget)
QStringList supportedElementNames() const override
Reimplemented to support custom element names.
virtual void onWidgetDestroyed()
Q_INVOKABLE QWidget * createViewFromXML(QDomElement layoutElement) override
Reimplemented to instantiate desired singleton widget from the element.
~qSlicerSingletonViewFactory() override
virtual Q_INVOKABLE void setTagName(QString tagName)
Set the XML tag that identifies the view where the widget should be placed.
qSlicerSingletonViewFactory(QObject *parent=nullptr)
Q_INVOKABLE QString tagName()
Get the XML tag that identifies the view where the widget should be placed.
virtual Q_INVOKABLE QWidget * widget()
Get the singleton widget instance that will be used to create the view.