Skip to content
Snippets Groups Projects
Commit cb4e1fcc authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: wait the end of edition before calling update (InputImageList widget)

parent 92bd4d3a
No related branches found
No related tags found
No related merge requests found
......@@ -81,8 +81,12 @@ public:
void SetIOMode( IOMode );
IOMode GetIOMode() const;
signals:
void FilenameChanged();
protected slots:
void SelectFile();
void CallFilenameChanged();
private:
QtFileSelectionWidget(const QtFileSelectionWidget&); //purposely not implemented
......
......@@ -74,6 +74,7 @@ void QtFileSelectionWidget::DoCreateWidget()
m_HLayout->addWidget(m_Checkbox);
m_Input = new QLineEdit;
connect( m_Input, SIGNAL(editingFinished()), this, SLOT(CallFilenameChanged()) );
m_HLayout->addWidget(m_Input);
// Set up input text edit
......@@ -116,8 +117,16 @@ QtFileSelectionWidget
return;
m_Input->setText( filename );
emit FilenameChanged();
}
void
QtFileSelectionWidget
::CallFilenameChanged()
{
emit FilenameChanged();
}
}
......
......@@ -134,7 +134,7 @@ void QtWidgetInputImageListParameter::DoCreateWidget()
fileSelection->setFixedHeight(30);
fileLayout->addWidget(fileSelection);
m_InputImageListParam->AddNullElement();
connect(fileSelection->GetInput(), SIGNAL(textChanged(const QString&)), this, SLOT(UpdateImageList()));
connect(fileSelection, SIGNAL(FilenameChanged()), this, SLOT(UpdateImageList()));
m_FileSelectionList.push_back(fileSelection);
......@@ -319,8 +319,8 @@ QtWidgetInputImageListParameter::AddFile()
/* No need of AddNullElement() here. Moved adding NullElement when updating the list */
//m_InputImageListParam->AddNullElement();
connect(
fileSelection->GetInput(),
SIGNAL( textChanged( const QString & ) ),
fileSelection,
SIGNAL( FilenameChanged() ),
this,
SLOT( UpdateImageList() )
);
......@@ -372,7 +372,7 @@ QtWidgetInputImageListParameter::EraseFile()
m_FileLayout->addWidget(fileSelection);
m_FileSelectionList.push_back(fileSelection);
m_InputImageListParam->AddNullElement();
connect(fileSelection->GetInput(), SIGNAL(textChanged(const QString&)), this, SLOT(UpdateImageList()));
connect(fileSelection, SIGNAL(FilenameChanged()), this, SLOT(UpdateImageList()));
QGroupBox *mainGroup = new QGroupBox();
mainGroup->setLayout(m_FileLayout);
......@@ -396,7 +396,7 @@ void QtWidgetInputImageListParameter::RecreateImageList()
for(unsigned int j = 0; j < m_FileSelectionList.size(); j++)
{
m_InputImageListParam->AddFromFileName(m_FileSelectionList[j]->GetFilename());
connect(m_FileSelectionList[j]->GetInput(), SIGNAL(textChanged(const QString&)), this, SLOT(UpdateImageList()));
connect(m_FileSelectionList[j], SIGNAL(FilenameChanged()), this, SLOT(UpdateImageList()));
}
emit Change();
......
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