diff --git a/Applications/Util/otbConvert.cxx b/Applications/Util/otbConvert.cxx index f92fa05d466c16d00f34cddeff96518ab1bab004..57c1e8dc5dbd83b9e6bd12fc811d153d7bb82914 100644 --- a/Applications/Util/otbConvert.cxx +++ b/Applications/Util/otbConvert.cxx @@ -111,7 +111,7 @@ private: SetParameterString("type", "none"); AddParameter(ParameterType_OutputImage, "out", "Output Image"); - SetParameterDescription("out", "Outmput image"); + SetParameterDescription("out", "Output image"); } void DoUpdateParameters() diff --git a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx index 3d3091910af50eb78ba94f3827650049dac38ec6..c7709ad3ede6af8443421f4808b8ecd8eb252978 100644 --- a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx +++ b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx @@ -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() diff --git a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h index 9d25edfcd47ff23ba799e337847f7b7dd0b1ecce..67b0206ff9211e06f80a82344f333a0fca3ec90f 100644 --- a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h +++ b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h @@ -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; diff --git a/Testing/Applications/otbWrapperApplicationDocTests.cxx b/Testing/Applications/otbWrapperApplicationDocTests.cxx index 22804011235f32b53277bf1a206a4fd714937fd5..0cf443383562e52bdd5292a6e4f1f95e59c7826d 100644 --- a/Testing/Applications/otbWrapperApplicationDocTests.cxx +++ b/Testing/Applications/otbWrapperApplicationDocTests.cxx @@ -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;