Hi,

I can suggest the following solution for using Qt's "signal-slot" with 
an mitk interactor. It's maybe not the coolest solution, but it is the 
one that works.

First of all, the interactor should be placed locally in the directory 
where your functionality is. Otherwise  "#include <qobject.h>" will fail 
(why? Maybe you know?).
Than the interactor shouldn't have "MITK_CORE_EXPORT" makro, cause it's 
not a part of CORE any more.
The interactor has to be derived from QObject and have "Q_OBJECT" in its 
declaration - just a usual procedure for using "signal-slot".
Now you have to make sure, the corresponding meta object compiler file 
(moc) will be also created. To do so, just insert the line 
"your_ineractor_name".h into the "files.cmake" file of your 
functionality in the "SET( MOC_H_FILES" section.

Now you can declare signals and slots and connect them e.g. with signals 
and slots of your functionality.

If someone knows the solution, that fits better to the mitk environment, 
I would be glad to learn it.

My regards,
Roman

Roman Tulchiner wrote:
> Hallo everybody,
>
> is there a possibility to emit events (or signals or similar) from out 
> of mitk interactor?
>
> The following is a little sketch of what I'm trying to do:
>
> I have an interactor, which reads some parameters of a surface point 
> near the mouse click location. Reading is not a problem - so I have the 
> information I need within my interactor. Now I wish this information be 
> shown in the UI of my mitk functionality.
>
> I could certainly do it per "call-back". Like giving my interactor a 
> pointer to my functionality. So the interactor can directly notify the 
> functionality of new information.
> But I would rather appreciate an "event-driven" approach with interactor 
> emitting an event if data is changed.
>
> I have tried it with Qt's "signal-slot". As I understand, if I want the 
> interactor to emit signals, I should derive it from QObject. But 
> "#include <qobject.h>" in my interactor breaks with a following compiler 
> error message:
> 6>f:\mitk\src\core\interactions\PointNeighborhoodSelectInteractor.h(12) 
> : fatal error C1083: Cannot open include file: 'qobject.h': No such file 
> or directory 
>
> So finally my question is :-) :
> Isn't it possible to use Qt "signal-slots" from within mitk interactor? 
> Are there maybe some other "event-driven" approach provided, referenced 
> to my problem above?
>
>
> Kind regards,
> Roman
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users
>   


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to