Skip to content
Snippets Groups Projects
Commit 779ae7af authored by Sébastien Dinot's avatar Sébastien Dinot
Browse files

ENH: Added 'Existing file' constraint in file selection widget

parent b68f6e10
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
=========================================================================*/
#include "otbWrapperQtWidgetInputImageParameter.h"
#include <stdexcept>
namespace otb
{
......@@ -65,6 +66,7 @@ void QtWidgetInputImageParameter::SelectFile()
{
QFileDialog fileDialog;
fileDialog.setConfirmOverwrite(true);
fileDialog.setFileMode(QFileDialog::ExistingFile);
fileDialog.setNameFilter("Raster files (*)");
if (fileDialog.exec())
......@@ -86,10 +88,11 @@ bool QtWidgetInputImageParameter::SetFileName(const QString& value)
{
bool res = true;
// save value
if(m_InputImageParam->SetFromFileName(static_cast<const char*>(value.toAscii())) == true )
if(m_InputImageParam->SetFromFileName(value.toAscii().constData()) == true)
{
// notify of value change
QString key( m_InputImageParam->GetKey() );
emit ParameterChanged(key);
}
else
......
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