Skip to content
Snippets Groups Projects
Commit a2170092 authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH : add method relative to the QViewWidget class

parent 153430bb
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@
#include "otbWrapperApplication.h"
#include "otbWrapperChoiceParameter.h"
#include "otbWrapperListViewParameter.h"
#include "otbWrapperDirectoryParameter.h"
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperFilenameParameter.h"
......@@ -203,6 +204,10 @@ ParameterType Application::GetParameterType(std::string paramKey) const
{
type = ParameterType_Choice;
}
else if (dynamic_cast<const ListViewParameter*>(param))
{
type = ParameterType_ListView;
}
else if (dynamic_cast<const RadiusParameter*>(param))
{
type = ParameterType_Radius;
......@@ -331,6 +336,11 @@ void Application::SetParameterString(std::string parameter, std::string value)
ChoiceParameter* paramDown = dynamic_cast<ChoiceParameter*>(param);
paramDown->SetValue(value);
}
else if (dynamic_cast<ListViewParameter*>(param))
{
ListViewParameter* paramDown = dynamic_cast<ListViewParameter*>(param);
paramDown->SetValue(value);
}
else if (dynamic_cast<StringParameter*>(param))
{
StringParameter* paramDown = dynamic_cast<StringParameter*>(param);
......@@ -510,6 +520,11 @@ std::string Application::GetParameterString(std::string parameter)
ChoiceParameter* paramDown = dynamic_cast<ChoiceParameter*>(param);
ret = paramDown->GetChoiceName( paramDown->GetValue() );
}
else if (dynamic_cast<ListViewParameter*>(param))
{
ListViewParameter* paramDown = dynamic_cast<ListViewParameter*>(param);
ret = paramDown->GetChoiceName( paramDown->GetValue() );
}
else if (dynamic_cast<StringParameter*>(param))
{
StringParameter* paramDown = dynamic_cast<StringParameter*>(param);
......@@ -670,6 +685,17 @@ Application::AddChoice(std::string paramKey, std::string paramName)
GetParameterList()->AddChoice(paramKey, paramName);
}
void
Application::ClearChoices(std::string paramKey)
{
GetParameterList()->ClearChoices(paramKey);
}
std::vector<int>
Application::GetSelectedItems(std::string param)
{
return GetParameterList()->GetSelectedItems(param);
}
void
Application::AddParameter(ParameterType type, std::string paramKey, std::string paramName)
......
......@@ -366,6 +366,12 @@ protected:
* or the path to a choice value */
void AddParameter(ParameterType type, std::string paramKey, std::string paramName);
/** Remove the items added to the ListWidget */
void ClearChoices(std::string key);
/** Get Items selected in the ListView Parameter*/
std::vector<int> GetSelectedItems(std::string paramKey);
/** Declare a parameter as mandatory */
void MandatoryOn(std::string paramKey);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment