A happy new year, MITK community!
 
As I began twice to write a question to the list and during explaining it I solved the issue on my own, I thought I might not cancel the message but send a sort of 'tip-of-the-week'.
Maybe this will start a new tradition, so please take part and share your tips as well.
 
Background:
I am working on porting my Workbench derivative to the new release (2014.10.0).
As I also am interested in QT5 support I decided to go for the trunk (currently a checkout from 12. Jan (#88916de) and minor changes (bug-16811-PrintOutBaseDataProperties, bug-18540-FixExternalLibAssumptions (changes towards using cmake targets), bug-18544-PreserveDefinedDoxygenExecutabeVariable,    see https://github.com/iwegner/MITK/tree/working_on_prerelease_2014.10.1 if interested).
To merge from 2014.03.0 to my trunk-based MITK version I stripped down my Workbench to only contain the app and the app plugin, so hardly no modules or plugins. This way I can solve the issues step by step.
 
Ploblem:
I ran into an issue, that the app plugin didn't get loaded by QT. After searching and debugging for some time I finally found the problem.
 
---> TIP <---
To merge to QT5 you need to change the way your plugin gets registered as the plugin registration mechanism has changed in QT5.
See http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5 section Plugin loading.
So you introduce an if statement in your my_plugin_activator.cpp to support QT4:
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
   Q_EXPORT_PLUGIN2(com_COMPANY_APPLICATION_app, MyAppActivator) // registering QT4 plugin
#endif
 
and add another if statement with a new QT5 macro in the header my_plugin_activator.h below the Q_OBJECT macro:
 
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    Q_PLUGIN_METADATA(IID "com_COMPANY_APPLICATION_app")
#endif
Q_INTERFACES(ctkPluginActivator)
 
---> End of TIP <---
 
Easy as that!
My issue was that I only added the if statement in the body and forgot about registering it elsewhere. The result was that qpluginloader returned that the given path for the app plugin dll is not a plugin; which was right...
And this was pretty much the only change to switch from Qt4.6.8 to 5.4.0. ... ok, now I need to take care of a lot of modules and plugins. ;)
 
If there is anything missing, then please add a comment.
And if you like the idea of a 'community tip of the week' then send one. I am sure everybody has a small tip that can be useful for a bunch of developers. This way we can assist the MITK dev team as well, don't you think?
 
;) Best Regards,
Ingmar
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to