Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes
qSlicerSingletonViewFactory Class Reference

#include <Base/QTGUI/qSlicerSingletonViewFactory.h>

Inheritance diagram for qSlicerSingletonViewFactory:
Inheritance graph
[legend]
Collaboration diagram for qSlicerSingletonViewFactory:
Collaboration graph
[legend]

Public Types

typedef ctkLayoutViewFactory Superclass
 

Public Slots

virtual void onWidgetDestroyed ()
 

Public Member Functions

 qSlicerSingletonViewFactory (QObject *parent=nullptr)
 
virtual Q_INVOKABLE void setTagName (QString tagName)
 Set the XML tag that identifies the view where the widget should be placed. More...
 
virtual Q_INVOKABLE void setWidget (QWidget *widget)
 
QStringList supportedElementNames () const override
 Reimplemented to support custom element names. More...
 
Q_INVOKABLE QString tagName ()
 Get the XML tag that identifies the view where the widget should be placed. More...
 
virtual Q_INVOKABLE QWidget * widget ()
 Get the singleton widget instance that will be used to create the view. More...
 
 ~qSlicerSingletonViewFactory () override
 

Protected Member Functions

Q_INVOKABLE QWidget * createViewFromXML (QDomElement layoutElement) override
 Reimplemented to instantiate desired singleton widget from the element. More...
 

Protected Attributes

QScopedPointer< qSlicerSingletonViewFactoryPrivate > d_ptr
 

Detailed Description

This class provides an interface for C++ and Python classes to register a singleton view replacement widget. New view widgets can be registered by registering a new qSlicerSingletonViewFactory, and then setting the widget and tag using setWidget(QWidget*) and setTagName(QString). The factory will be responsible for deleting the widget. This factory contains a single pointer to an instance of the widget, so only one view can be created within a given layout.

Definition at line 38 of file qSlicerSingletonViewFactory.h.

Member Typedef Documentation

◆ Superclass

typedef ctkLayoutViewFactory qSlicerSingletonViewFactory::Superclass

Definition at line 42 of file qSlicerSingletonViewFactory.h.

Constructor & Destructor Documentation

◆ qSlicerSingletonViewFactory()

qSlicerSingletonViewFactory::qSlicerSingletonViewFactory ( QObject *  parent = nullptr)

◆ ~qSlicerSingletonViewFactory()

qSlicerSingletonViewFactory::~qSlicerSingletonViewFactory ( )
override

Member Function Documentation

◆ createViewFromXML()

Q_INVOKABLE QWidget* qSlicerSingletonViewFactory::createViewFromXML ( QDomElement  layoutElement)
overrideprotected

Reimplemented to instantiate desired singleton widget from the element.

◆ onWidgetDestroyed

virtual void qSlicerSingletonViewFactory::onWidgetDestroyed ( )
virtualslot

◆ setTagName()

virtual Q_INVOKABLE void qSlicerSingletonViewFactory::setTagName ( QString  tagName)
virtual

Set the XML tag that identifies the view where the widget should be placed.

◆ setWidget()

virtual Q_INVOKABLE void qSlicerSingletonViewFactory::setWidget ( QWidget *  widget)
virtual

Set the singleton widget instance that will be used to create the view The factory will become responsible for deleting the widget

◆ supportedElementNames()

QStringList qSlicerSingletonViewFactory::supportedElementNames ( ) const
override

Reimplemented to support custom element names.

◆ tagName()

Q_INVOKABLE QString qSlicerSingletonViewFactory::tagName ( )

Get the XML tag that identifies the view where the widget should be placed.

◆ widget()

virtual Q_INVOKABLE QWidget* qSlicerSingletonViewFactory::widget ( )
virtual

Get the singleton widget instance that will be used to create the view.

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerSingletonViewFactoryPrivate> qSlicerSingletonViewFactory::d_ptr
protected

Definition at line 64 of file qSlicerSingletonViewFactory.h.


The documentation for this class was generated from the following file: