Hi Miguel,
On 02/11/2014 11:19 AM, Miguel Nunes wrote:
I've already taken a look at it and I am facing a problem while trying
to acquire the ctkPluginContext. I am not sure from where I should
obtain this. Right now I am trying to get it when the plugin gets
initiated in the Snippet CreateQtPartControl( QWidget *parent )
function call, where I am setting up everything.
The usual pattern for CTK plug-ins is to write a static
"GetPluginContext()" method in the plug-ins activator class and call
this static method from other places within that plug-in to aquire the
plug-in specific context. The activator class contains a private static
ctkPluginContext* member which is set in the start(ctkPluginContext*)
method. See for example:
https://github.com/MITK/MITK/blob/master/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtApplicationPlugin.cpp#L83
here's a snapshot of my class:
class MyClass : public QmitkAbstractView, public ctkEventHandler
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
Q_INTERFACES(ctkEventHandler)
public:
static const std::string VIEW_ID;
void handleEvent(const ctkEvent& event);
protected:
...
}
and then, on the cpp file:
Snippet
ctkDictionary props;
ctkPluginContext* pluginContext =
ctkPluginFrameworkLauncher::getPluginContext();
props[ctkEventConstants::EVENT_TOPIC] =
"com/whatever/myplugin2/CONTOURNAMECHANGED";
pluginContext->registerService<ctkEventHandler>(this, props);
But the getpluginContext() apparently is not retrieving the correct
information, as I have tried to cout some of its data.
Unless you are using the ctkPluginFrameworkLauncher to also launch the
CTK Plugin Framework itself, the
ctkPluginFrameworkLauncher::getPluginContext() method should return
NULL. I am surprised that you are not getting segmentation faults in
this case.
Best,
Sascha
I am aware that this might probably not be your specialization inside
MITK, but I always appreciate your effort.
Best,
Miguel
On 10.02.2014 14:06, Sascha Zelzer wrote:
Hi Miguel,
this sounds a lot like a publish/subscribe event system. You might
want to use the CTK EventAdmin [1] plug-in for that. There is a
high-level overview [2] and a detailed tutorial [3].
Best,
Sascha
[1] http://www.commontk.org/docs/html/structctkEventAdmin.html
[2]
http://www.commontk.org/index.php/Documentation/CTK_Plugin_EventAdmin_local
[3]
http://www.commontk.org/docs/html/PluginFramework_EventAdmin_Page.html
On 02/10/2014 11:57 AM, Miguel Nunes wrote:
Hello again MITK List,
I have reached a point where I am sure multiple plugins will have to
communicate (send or broadcast signals) to each other and I can not
make plugin A depend on plugin B which will depend on plugin A.
So I was wondering if there is a signal manager on a higher level of
the plugins (inside the MITK framework) or if it is possible to just
"addAction" or "addSignal" to Snippet QmitkAbstractView (or to some
other berry class) in order for any random plugin to be able to
connect to it, send a signal, and this higher level class emit the
signal to all running plugins.
Thank you again.
Miguel
On 02.09.2013 09:22, Miguel Nunes wrote:
Hello Sascha!
I managed a work around. So in case I came across again with this I
will let you know. thanks once again!
Best,
Miguel
On 27.08.2013 19:51, Sascha Zelzer wrote:
Hi Miguel,
It is possible and exactly how you did it. So what are the errors
you are getting? Does CMake configure correctly? Can you include
header files from plug-in A within B? Does the linker complain?
Best,
Sascha
On 08/27/2013 12:03 PM, Miguel Nunes wrote:
Hello MITK List,
I am trying to make two independent plugins communicate with each
other.
I want plugin B to access the plugin A active instance and call
some method like A::getData() or something similar. Is this
possible?
On my B plugin file"manifest_headers.cmake" I changed the line to
set(Require-Plugin org.mitk.gui.qt.common org.mitk.A ) But I
still can't access A.
I appreciate any help.
Best,
Miguel
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users