Skip to content
Snippets Groups Projects
Commit 35926a31 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH: correct doc tests + small change in QtDoc

parent 1e251515
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,7 @@ private:
SetParameterString("type", "none");
AddParameter(ParameterType_OutputImage, "out", "Output Image");
SetParameterDescription("out", "Outmput image");
SetParameterDescription("out", "Output image");
}
void DoUpdateParameters()
......
......@@ -123,8 +123,8 @@ QWidget* QtWidgetView::CreateFooter()
QWidget* QtWidgetView::CreateDoc()
{
// an HLayout with two buttons : Execute and Quit
QTextEdit *text = new QTextEdit;
text->setReadOnly(true);
QTextDocument * doc = new QTextDocument();
itk::OStringStream oss;
......@@ -142,7 +142,9 @@ QWidget* QtWidgetView::CreateDoc()
oss << "<h3>Long Description</h3>";
oss << "<body>"<<m_Application->GetDocLongDescription()<<"</body>";
oss << this->SetDocParameters();
std::string val;
this->SetDocParameters(val);
oss<<val;
oss << "<h3>Limitations</h3>";
oss << "<body>"<<m_Application->GetDocLimitations()<<"</body>";
......@@ -157,18 +159,20 @@ QWidget* QtWidgetView::CreateDoc()
text->setDocument( doc );
return text;
}
const char * QtWidgetView::SetDocParameters()
void QtWidgetView::SetDocParameters( std::string & val )
{
const std::vector<std::string> appKeyList = m_Application->GetParametersKeys( true );
const unsigned int nbOfParam = appKeyList.size();
itk::OStringStream oss;
oss << "<h3>Parameters</h3>";
// Mandatory parameters
oss << "<h2>Mandatory parameters</h2>";
// Mandatory parameters
oss << "<h4>Mandatory parameters</h4>";
oss << "<li>";
for( unsigned int i=0; i<nbOfParam; i++ )
......@@ -181,8 +185,9 @@ const char * QtWidgetView::SetDocParameters()
}
}
oss << "</body></li>";
// Optionnal parameters
oss << "<h2>Optionnal parameters</h2>";
oss << "<h4>Optionnal parameters</h4>";
oss << "<body><li>";
bool found = false;
for( unsigned int i=0; i<nbOfParam; i++ )
......@@ -197,9 +202,10 @@ const char * QtWidgetView::SetDocParameters()
}
if( !found )
oss << "None";
oss << "</li>";
return oss.str().c_str();
val = oss.str();
}
void QtWidgetView::CloseSlot()
......
......@@ -63,7 +63,7 @@ private:
QWidget* CreateDoc();
/** Add the parameter description in the flux of the documentation tab. */
const char * SetDocParameters();
void SetDocParameters( std::string & val );
Application::Pointer m_Application;
......
......@@ -46,47 +46,47 @@ int otbWrapperApplicationDocTest(int argc, char* argv[])
bool isOK = true;
// Check doc element...
if( app->GetName() == "" )
if( std::string(app->GetName()) == "" )
{
std::cout<<"Missing Name."<<std::endl;
isOK = false;
}
if( app->GetDocName() == "" )
if( std::string(app->GetDocName()) == "" )
{
std::cout<<"Missing Doc Name."<<std::endl;
isOK = false;
}
if( app->GetDescription() == "" )
if( std::string(app->GetDescription()) == "" )
{
std::cout<<"Missing Description."<<std::endl;
isOK = false;
}
if( app->GetDocLongDescription() == "" )
if( std::string(app->GetDocLongDescription()) == "" )
{
std::cout<<"Missing DocLongDescription."<<std::endl;
isOK = false;
}
if( std::string(app->GetDocLongDescription()).size() < 30 )
else if( std::string(app->GetDocLongDescription()).size() < 30 )
{
std::cout<<"DocLongDescription too small..."<<std::endl;
isOK = false;
}
if( app->GetDocCLExample() == "" )
if( std::string(app->GetDocCLExample()) == "" )
{
std::cout<<"Missing DocCLExample."<<std::endl;
isOK = false;
}
if( app->GetDocAuthors() == "" )
if( std::string(app->GetDocAuthors()) == "" )
{
std::cout<<"Missing DocAuthors."<<std::endl;
isOK = false;
}
if( app->GetDocLimitations() == "" )
if( std::string(app->GetDocLimitations()) == "" )
{
std::cout<<"Missing DocLimitations."<<std::endl;
isOK = false;
}
if( app->GetDocSeeAlso() == "" )
if( std::string(app->GetDocSeeAlso()) == "" )
{
std::cout<<"Missing DocSeeAlso."<<std::endl;
isOK = false;
......
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