Skip to content
Permalink
Browse files

Make sure QgsFileWidget emits fileChanged when value is cleared

Fixes external resource widget not updating document display
when link is cleared.
  • Loading branch information
nyalldawson committed Apr 5, 2016
1 parent 7357268 commit bcb2c736d514bbf1e2a7da713510bf22ded262c6
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/gui/qgsfilewidget.cpp
@@ -60,7 +60,7 @@ QgsFileWidget::QgsFileWidget( QWidget *parent )

// otherwise, use the traditional QLineEdit
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 );

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

//will trigger textEdited slot
mLineEdit->setValue( path );
}

void QgsFileWidget::setReadOnly( bool readOnly )

0 comments on commit bcb2c73

Please sign in to comment.
You can’t perform that action at this time.