Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 52fffada authored by Tiffet Théophile's avatar Tiffet Théophile
Browse files

Moved the modification from trigger to getWidget so that Action.h does not need any modification.

parent 697276ce
......@@ -73,11 +73,8 @@ ManualThreshold::~ManualThreshold() {
// do not delete the widget has it might have been used in the ActionViewer (i.e. the ownership might have been taken by the stacked widget)
}
// --------------- trigger -------------------
Action::ApplyStatus ManualThreshold::trigger(QWidget* parent) {
if (Action::trigger(parent) == ERROR)
return ERROR;
// --------------- getWidget -------------------
QWidget* ManualThreshold::getWidget() {
// Computing the maximum and the minimum possible value for the image
double min = 0;
double max = 0;
......@@ -101,10 +98,8 @@ Action::ApplyStatus ManualThreshold::trigger(QWidget* parent) {
highThresholdProperty->setAttribute("maximum", max);
highThresholdProperty->setAttribute("singleStep", (max - min) / 255);
addParameter(highThresholdProperty);
// Updating the widget
if (actionWidget)
dynamic_cast<camitk::ActionWidget*>(actionWidget)->update();
return SUCCESS;
// Call the parent method
return Action::getWidget();
}
// --------------- apply -------------------
......
......@@ -46,13 +46,9 @@ public:
/// Default Destructor
virtual ~ManualThreshold();
virtual QWidget* getWidget();
public slots:
/**
* This method triggers the action.
* The parent widget is used if the action is embedded, see class description for more information about the algorithm.
* This method cannot be redefined in inherited class.
*/
virtual ApplyStatus trigger(QWidget* parent = nullptr);
/** this method is automatically called when the action is triggered.
* Use getTargets() QList to get the list of component to use.
* \note getTargets() is automatically filtered so that it only contains compatible components,
......
......@@ -241,7 +241,7 @@ public slots:
* The parent widget is used if the action is embedded, see class description for more information about the algorithm.
* This method cannot be redefined in inherited class.
*/
virtual ApplyStatus trigger(QWidget* parent = nullptr);
ApplyStatus trigger(QWidget* parent = nullptr);
/**
* This method is called when the action has to be applied on the target list (get the target lists using getTargets())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment