Skip to content
Permalink
Browse files

call loadDocument in setDocumentViewerContent instead over a seperate…

… method

updateDocumentViewer needs not to be called on Image before the laod of the document (because it's called after the document load (or unload))
  • Loading branch information
signedav committed Aug 24, 2020
1 parent 6fbeb47 commit c3cb69b16722dfae5d98d5d9ec6c8bdc06a74442
@@ -133,12 +133,6 @@ is set to QgsFileWidget.RelativeDefaultPath.
%Docstring
Configures the base path which should be used if the relativeStorage property
is set to QgsFileWidget.RelativeDefaultPath.
%End

void reloadDocument();
%Docstring
Reloads the document from the path of the filewidget
/since QGIS 3.16
%End

signals:
@@ -112,7 +112,6 @@ void QgsExternalResourceWidgetWrapper::updateProperties( const QgsFeature &featu
dvc = QgsExternalResourceWidget::NoContent;
}
mQgsWidget->setDocumentViewerContent( dvc );
mQgsWidget->reloadDocument();
}
}
}
@@ -99,7 +99,9 @@ QgsExternalResourceWidget::DocumentViewerContent QgsExternalResourceWidget::docu
void QgsExternalResourceWidget::setDocumentViewerContent( QgsExternalResourceWidget::DocumentViewerContent content )
{
mDocumentViewerContent = content;
updateDocumentViewer();
if ( mDocumentViewerContent != Image )
updateDocumentViewer();
loadDocument( mFileWidget->filePath() );
}

int QgsExternalResourceWidget::documentViewerHeight() const
@@ -194,11 +196,6 @@ void QgsExternalResourceWidget::setDefaultRoot( const QString &defaultRoot )
mDefaultRoot = defaultRoot;
}

void QgsExternalResourceWidget::reloadDocument()
{
loadDocument( mFileWidget->filePath() );
}

QgsFileWidget::RelativeStorage QgsExternalResourceWidget::relativeStorage() const
{
return mRelativeStorage;
@@ -143,12 +143,6 @@ class GUI_EXPORT QgsExternalResourceWidget : public QWidget
*/
void setDefaultRoot( const QString &defaultRoot );

/**
* Reloads the document from the path of the filewidget
* /since QGIS 3.16
*/
void reloadDocument();

signals:
//! emitteed as soon as the current document changes
void valueChanged( const QString & );

0 comments on commit c3cb69b

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