CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Member Functions | Protected Member Functions | List of all members
ctkLayoutFactory Class Reference

#include <Libs/Widgets/ctkLayoutFactory.h>

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

Public Member Functions

 ctkLayoutFactory (QObject *parent=0)
 
 ctkLayoutFactory (QWidget *viewport, QObject *parent)
 
const QDomDocument layout () const
 
QList< ctkLayoutViewFactory * > registeredViewFactories () const
 
void registerViewFactory (ctkLayoutViewFactory *factory)
 
virtual void setLayout (const QDomDocument &newLayout)
 
void unregisterViewFactory (ctkLayoutViewFactory *factory)
 
virtual ~ctkLayoutFactory ()
 
- Public Member Functions inherited from ctkLayoutManager
 ctkLayoutManager (QObject *parent=0)
 Constructor. More...
 
 ctkLayoutManager (QWidget *viewport, QObject *parent)
 
void refresh ()
 
void setSpacing (int spacing)
 
Q_INVOKABLE void setViewport (QWidget *widget)
 
int spacing () const
 
Q_INVOKABLE QWidget * viewport () const
 
virtual ~ctkLayoutManager ()
 Destructor. More...
 

Protected Member Functions

virtual void setupLayout ()
 
virtual void setupView (QDomElement layoutElement, QWidget *view)
 
QList< ctkLayoutViewFactory * > viewFactories (QDomElement viewElement) const
 Return all the registered factories that can handle the layoutElement. More...
 
virtual QWidget * viewFromXML (QDomElement layoutElement)
 
virtual QList< QWidget * > viewsFromXML (QDomElement layoutElement)
 
- Protected Member Functions inherited from ctkLayoutManager
virtual void addChildItemToLayout (QDomElement itemElement, QLayoutItem *childItem, QLayoutItem *layoutItem)
 
void clearLayout ()
 
 ctkLayoutManager (ctkLayoutManagerPrivate *ptr, QWidget *viewport, QObject *parent)
 
const QDomDocument layout () const
 
virtual QLayoutItem * layoutFromXML (QDomElement layoutElement)
 
virtual void onViewportChanged ()
 
virtual QLayoutItem * processElement (QDomElement element)
 
void processItemElement (QDomElement layoutElement, QLayoutItem *layoutItem)
 
virtual QLayoutItem * processLayoutElement (QDomElement layoutElement)
 
virtual void setLayout (const QDomDocument &newLayout)
 
QWidgetItem * widgetItemFromXML (QDomElement layoutElement)
 
QList< QLayoutItem * > widgetItemsFromXML (QDomElement layoutElement)
 

Additional Inherited Members

- Signals inherited from ctkLayoutManager
void layoutChanged ()
 
- Protected Attributes inherited from ctkLayoutManager
QScopedPointer< ctkLayoutManagerPrivate > d_ptr
 
- Properties inherited from ctkLayoutManager
int spacing
 

Detailed Description

This class gives the ability to control externally the instantiation of view widgets by registering view factories. Depending on the view XML element in the layout document, the best registered view factory is being used to create and setup the corresponding widget.

See also
ctkLayoutManager, ctkViewFactory

Definition at line 38 of file ctkLayoutFactory.h.

Constructor & Destructor Documentation

◆ ctkLayoutFactory() [1/2]

ctkLayoutFactory::ctkLayoutFactory ( QObject *  parent = 0)

◆ ctkLayoutFactory() [2/2]

ctkLayoutFactory::ctkLayoutFactory ( QWidget *  viewport,
QObject *  parent 
)
explicit

◆ ~ctkLayoutFactory()

virtual ctkLayoutFactory::~ctkLayoutFactory ( )
virtual

Member Function Documentation

◆ layout()

const QDomDocument ctkLayoutManager::layout

◆ registeredViewFactories()

QList<ctkLayoutViewFactory*> ctkLayoutFactory::registeredViewFactories ( ) const

Return the list of view factories that are registered.

See also
registerViewFactory(), unregisterViewFactory()

◆ registerViewFactory()

void ctkLayoutFactory::registerViewFactory ( ctkLayoutViewFactory factory)

Register a view factory. The factory is prepended to the list of factories. If the factory has no parent, ctkLayoutManager takes ownership. Otherwise you should make sure the factory is not deleted until the factory is unregisted or until the manager is deleted.

See also
unregisterViewFactory(), registerViewFactories()

◆ setLayout()

virtual void ctkLayoutManager::setLayout

◆ setupLayout()

virtual void ctkLayoutFactory::setupLayout ( )
protectedvirtual

Call beginSetupLayout() and endSetupLayout() on all the registeredfactories.

See also
setupView()

Reimplemented from ctkLayoutManager.

◆ setupView()

virtual void ctkLayoutFactory::setupView ( QDomElement  layoutElement,
QWidget *  view 
)
protectedvirtual

Find the layoutElement factory and setupView() on it.

See also
viewFromXML(), viewsFromXML()

Reimplemented from ctkLayoutManager.

◆ unregisterViewFactory()

void ctkLayoutFactory::unregisterViewFactory ( ctkLayoutViewFactory factory)

Unregister a view factory. If the factory is owned by the ctkLayoutManager, the factory is deleted.

See also
registerViewFactory(), registerViewFactories()

◆ viewFactories()

QList<ctkLayoutViewFactory*> ctkLayoutFactory::viewFactories ( QDomElement  viewElement) const
protected

Return all the registered factories that can handle the layoutElement.

◆ viewFromXML()

virtual QWidget* ctkLayoutFactory::viewFromXML ( QDomElement  layoutElement)
protectedvirtual

Find the layoutElement factory and call viewFromXML() on it.

See also
viewsFromXML(), setupView()

Implements ctkLayoutManager.

◆ viewsFromXML()

virtual QList<QWidget*> ctkLayoutFactory::viewsFromXML ( QDomElement  layoutElement)
protectedvirtual

Find the layoutElement factory and call viewsFromXML() on it.

See also
viewFromXML(), setupView()

Reimplemented from ctkLayoutManager.


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