Views Without Multi Widget
Revision as of 14:02, 19 February 2012 by SaschaZelzer (talk | contribs)
Replace the QmitkFunctionality inheritance of your View class with QmitkAbstractView and remove any QmitkStdMultiWidget.h include directives.
#!highlight cpp //#include <QmitkStdMultiWidget.h> <-- Remove this include //#include <QmitkFunctionality.h> <-- Remove this include #include <QmitkAbstractView.h> //class MyView : public QmitkFunctionality {...}; class MyView : public QmitkAbstractView {...};
You must implement the method SetFocus(). Previously, an empty default implementation was provided by QmitkFunctionality which generally is not a good default.
#!highlight cpp void SetFocus() { m_Controls->someWidget->setFocus(); }
The following table maps the deprecated QmitkFunctionality API to the new API offered by QmitkAbstractView or related interfaces.
QmitkFunctionality | QmitkAbstractView |
void OnSelectionChanged(std::vector<mitk::DataNode*>) | void OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList<mitk::DataNode::Pointer>&) |
mitk::DataStorage::Pointer GetDefaultDataStorage() | mitk::DataStorage::Pointer GetDataStorage() |
bool IsActivated() | x (remeber the state yourself by implementing the mitk::ILifecycleAwarePart interface) |
QmitkStdMultiWidget* GetActiveStdMultiWidget(bool reCreateWidget = true) | mitk::IRenderWindowPart* GetRenderWindowPart(IRenderWindowPartStrategies) |
m_Parent | x (remember the parent yourself in CreateQtPartControl(QWidget*) ) |
bool IsExclusiveFunctionality() | x (implement the mitk::IZombieViewPart interface to indicate special behavior) |
QmitkFunctionality | mitk::IRenderWindowPartListener |
void StdMultiWidgetAvailable(QmitkStdMultiWidget&) | void RenderWindowPartActivated(mitk::IRenderWindowPart*) |
QmitkFunctionality | mitk::ILifecycleAwarePart |
QmitkFunctionality | mitk::IZombieViewPart |
void Deactivated() | void ActivatedZombieView(berry::IWorkbenchPartReference::Pointer) |
Calls to the global mitk::RenderingManager instance should be replaced by calls to the mitk::IRenderingManager instance returned by the mitk::IRenderWindowPart. Rendering update requests should be done by calling QmitkAbstractView::RequestRenderWindowUpdate.
#!highlight cpp // Get a mitk::IRenderingManager instance mitk::IRenderingManager* rendering manager = this->GetRenderWindowPart()->GetRenderingManager(); // Request an update of the currently active render windows this->RequestRenderWindowUpdate();