French
Nouvelles
Pages à mettre à jour
Documentation à mettre à jour
English
Drafts, concepts
News
Pages to update
Documentation to update
This page describes how to write a plugin for FreeMedForms. FMF basically is derived from QtCreator by Nokia, and you can write plugins like you would write one for QtCreator, the basic code is the same. Using QtCreator, you can easily create a plugin with the builtin template wizard, we've created a template that should keep you up and running.
In the FMF source tree, there is the qtcreator_wizards directory, which contains subdirectories, that can just be copied (or better linked, for update safety) to the QtCreator template wizards directory. You can gather some info from here (for QtCreator 2.4).
We recommend that you put a link in your personal home directory, so you don't have to bother with admin rights and update problems. The user directory QtCreator is looking at startup is ~/.config/Nokia/qtcreator/templates/wizards.
Go to the qtcreator_wizards directory, and run the following commands (for e.g. the freemedformsplugin, repeat for other directories):
mkdir -p ~/.config/Nokia/qtcreator/templates/wizards ln -s $PWD/freemedformsplugin ~/.config/Nokia/qtcreator/templates/wizards/freemedformsplugin
TODO
TODO
After a QtCreator restart there should be a new wizard available.
Right-click on the freemedforms project, and select New subproject…:
Then unter FreeMedForms choose FreeMedForms Plugin:
Under Introduction and Project Location you must give the directory a lowercase name (e.g. “myplugin”), and you must choose /freemedforms/plugins as directory where to create the plugin:
Under Target Setup you can use your usual settings.
Fill out the Plugin Information form (Plugin name, Author, Vendor etc) - these items will be visible within the application when opening the plugin manager.
Under the last page, Project Management, it's very important that you choose plugins.pro as the project where to add this new subproject - otherwise it won't work. choose any VCS you are working with, we are using git at the main FMF repository.
Then click Finish.
The wizard is not able to write a little speciality that is needed by FMF. All the common plugins live in /plugins, but there is also a %application%/plugins directory (where %application% means freepad, freediams etc.) with a plugins.pro file for only that application. This file is the main plugins project file for that application, but it has to reference the plugins relatively in ../../plugins.
Therefore you have to open the plugins.pro file in QtCreator, and change what the wizard just wrote manually: search for the last line of the SUBDIRS variable, you'll see the following line:
../../plugins/myspecialplugin
Delete this line and write just
myspecial
instead. Now scroll down to the lower part, create a new section and write
myspecial.subdir = ../../plugins/myplugin myspecial.depends += core myspecial.depends += %whatElseItDependsOn%
Then you should have no problem compiling and running the plugin.