![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include <Libs/Widgets/ctkLayoutFactory.h>
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 () |
![]() | |
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) |
![]() | |
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 | |
![]() | |
void | layoutChanged () |
![]() | |
QScopedPointer< ctkLayoutManagerPrivate > | d_ptr |
![]() | |
int | spacing |
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.
Definition at line 38 of file ctkLayoutFactory.h.
ctkLayoutFactory::ctkLayoutFactory | ( | QObject * | parent = 0 | ) |
|
explicit |
|
virtual |
const QDomDocument ctkLayoutManager::layout |
QList<ctkLayoutViewFactory*> ctkLayoutFactory::registeredViewFactories | ( | ) | const |
Return the list of view factories that are registered.
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.
virtual void ctkLayoutManager::setLayout |
|
protectedvirtual |
Call beginSetupLayout() and endSetupLayout() on all the registeredfactories.
Reimplemented from ctkLayoutManager.
|
protectedvirtual |
Find the layoutElement factory and setupView() on it.
Reimplemented from ctkLayoutManager.
void ctkLayoutFactory::unregisterViewFactory | ( | ctkLayoutViewFactory * | factory | ) |
Unregister a view factory. If the factory is owned by the ctkLayoutManager, the factory is deleted.
|
protected |
Return all the registered factories that can handle the layoutElement.
|
protectedvirtual |
Find the layoutElement factory and call viewFromXML() on it.
Implements ctkLayoutManager.
|
protectedvirtual |
Find the layoutElement factory and call viewsFromXML() on it.
Reimplemented from ctkLayoutManager.