Easy action GUI/widget for specific properties
As a | CEP developer |
I would like to | easily add/easily manage specific high-level properties/parameters to my action |
So that | my action source code is only focusing on the processing |
Description / Overview
This story is about having an easy way to declare and manage specific high level properties in actions.
In an Action
derived class it should be easy to add properties (and automatically create their GUI) for the following:
-
QStringList
→ dropdown list - list of instanciated/available components (with possible restriction to components of a given type) → GUI = dropdown list
- list of
MedicalImageViewer
viewers → GUI = dropdown list - button (name + icon + tristate or not + double state or not + slot to call) → GUI =
QPushButton
automatically added to the defaultActionWidget
that calls the slot.
Therefore it should be possible to directly write something like:
// MyAction constructor
MyAction::MyAction(..) : .. {
...
QStringList myList;
myList << "A" << "B" << "C";
addParameters(new Property(tr("List of strings"), myList, ...);
Property *listOfComp = new Property(tr("Image 1", Property::LIST_OF_COMPONENT, ...);
listOfComp->setAttribute("componentName", "ImageComponent");
addParameters(listOfComp);
addParameters(new Property(tr("Viewer to show"), Property::LIST_OF_MEDICAL_VIEWERS, ...);
Property *pushMeProp = new Property(tr("Push Me"), SLOT(pushMeSlot()), ...);
pushMeProp->setAttribute("checkable",true);
pushMeProp->setAttribute("icon",QIcon(":/images/myIcon.png"));
addParameters(pushMeProp);
...
}
Acceptance test
-
there is a tutorial showing how to use these highlevel -
the Action and Property API documentation is updated -
the wizard allow for the creation of such properties -
the CEP generator is aware of these properties and there are new tests in the cepgenerator/testing/cepgernerator-test.sh
-
any action in CamiTK CE that manages this type of high-level properties otherwise should use the new way