Skip to content

Commit

Permalink
Make sure QgsFileWidget emits fileChanged when value is cleared
Browse files Browse the repository at this point in the history
Fixes external resource widget not updating document display
when link is cleared.
  • Loading branch information
nyalldawson committed Apr 5, 2016
1 parent 7357268 commit bcb2c73
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/gui/qgsfilewidget.cpp
Expand Up @@ -60,7 +60,7 @@ QgsFileWidget::QgsFileWidget( QWidget *parent )


// otherwise, use the traditional QLineEdit // otherwise, use the traditional QLineEdit
mLineEdit = new QgsFilterLineEdit( this ); mLineEdit = new QgsFilterLineEdit( this );
connect( mLineEdit, SIGNAL( textEdited( QString ) ), this, SLOT( textEdited( QString ) ) ); connect( mLineEdit, SIGNAL( textChanged( QString ) ), this, SLOT( textEdited( QString ) ) );
layout->addWidget( mLineEdit, 1, 0 ); layout->addWidget( mLineEdit, 1, 0 );


mFileWidgetButton = new QToolButton( this ); mFileWidgetButton = new QToolButton( this );
Expand All @@ -86,10 +86,9 @@ void QgsFileWidget::setFilePath( QString path )
{ {
path = ""; path = "";
} }
mFilePath = path;
mLineEdit->setText( path ); //will trigger textEdited slot
mLinkLabel->setText( toUrl( path ) ); mLineEdit->setValue( path );
emit fileChanged( mFilePath );
} }


void QgsFileWidget::setReadOnly( bool readOnly ) void QgsFileWidget::setReadOnly( bool readOnly )
Expand Down

0 comments on commit bcb2c73

Please sign in to comment.