Yes, a good rule of thumb is that if your View is going to make use of MITK data types (working with mitk::DataNode, mitk::DataStorage, etc.) or need to interact with render windows, use QmitkAbstractView. It could achieve everything by directly inheriting from berry::QtViewPart, but it will make your life harder.
Have a look at the QmitkAbstractView API and its general class documentation to get an idea about its usefulness. Best, Sascha On 10/19/2012 08:29 PM, Félix C. Morency wrote: > Hi, > > Thank you for the fast answer. Could you explain what are the > pros/cons of using QtView over QmitkAbstractView (and vice versa)? Is > there any rule of thumb? > > Regards, > -F > > On Fri, Oct 19, 2012 at 12:30 PM, Sascha Zelzer > <[email protected]> wrote: >> Hi, >> >> long story short: You cannot contribute Views derived from QmitkAbstractView >> in a plug-in which also provides an org.blueberry.osgi.applications >> extension. As you figured out, you must create a separate plug-in containing >> your View(s). >> >> Here is the reason (we actually just stumbled over that ourselves a couple >> of weeks ago): >> >> The QmitkAbstractView.h file is included in org.mitk.gui.qt.common and hence >> you need a dependency to that plug-in in your "application" plug-in (as you >> figured out). But this also means that all dependent plug-ins of your >> application plug-in will be loaded first, in order to resolve all >> dependencies correctly. Now the plugin activator of the >> org.mitk.gui.qt.common plug-in instantiates a class which requires a running >> workbench. But the workbench has yet to be initialized in your overridden >> berry::IApplication::Start() method. One could of course think about a >> "better" place for the QmitkAbstractView.h header... >> >> Creating Views which derive directly from berry::QtViewPart should work >> though. >> >> Best, >> Sascha >> >> >> On 10/19/2012 05:48 PM, Félix C. Morency wrote: >>> Hi, >>> >>> I build a custom application using Bluerry. I defined a custom >>> perspective and everything works. My manifest has the line >>> >>> set(Require-Plugin org.mitk.gui.qt.ext) >>> >>> I tried to add a custom view (QmitkAbstractView) to the same plugin >>> containing my application. I had to change the manifest line to >>> >>> set(Require-Plugin org.mitk.gui.qt.ext org.mitk.gui.qt.common) >>> >>> to make it build, otherwise QmitkAbstractView.h is not found. When I >>> run the application, I have the following error >>> >>> #0.220# ERROR: BlueBerry Workbench not running! >>> >>> My guess is that is has something to do with the Require-Plugin line. >>> >>> The following questions comes to mind: >>> >>> 1) Can we have a plugin containing an application and views? >>> 2) If not, does it means that I have to create another plugin >>> containing only views? Why? >>> >>> I can understand that since views can be used in multiple >>> applications, it might be a good thing to split that into two plugins. >>> The thing I don't get is why is it producing an error when trying to >>> have a plugin with both application and views? >>> >>> Regards, >>> -- >>> Félix C. Morency, M.Sc. >>> Plateforme d’analyse et de visualisation d’images >>> Centre Hospitalier Universitaire de Sherbrooke >>> Centre de recherche clinique Étienne-Le Bel >>> Local Z5-3031 | 819.346.1110 ext 16634 >>> >>> >>> ------------------------------------------------------------------------------ >>> Everyone hates slow websites. So do we. >>> Make your web apps faster with AppDynamics >>> Download AppDynamics Lite for free today: >>> http://p.sf.net/sfu/appdyn_sfd2d_oct >>> _______________________________________________ >>> mitk-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/mitk-users >> > > ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
