mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Save algorithm results to dialog
This commit is contained in:
parent
edcd058e32
commit
ce28cf5087
@ -69,6 +69,19 @@ Switches the dialog to the log page.
|
||||
bool wasExecuted() const;
|
||||
%Docstring
|
||||
Returns true if an algorithm was executed in the dialog.
|
||||
|
||||
.. seealso:: :py:func:`results()`
|
||||
|
||||
.. seealso:: :py:func:`setExecuted()`
|
||||
%End
|
||||
|
||||
QVariantMap results() const;
|
||||
%Docstring
|
||||
Returns the results returned by the algorithm executed.
|
||||
|
||||
.. seealso:: :py:func:`wasExecuted()`
|
||||
|
||||
.. seealso:: :py:func:`setResults()`
|
||||
%End
|
||||
|
||||
QgsProcessingFeedback *createFeedback() /Factory/;
|
||||
@ -157,6 +170,19 @@ Clears any current progress from the dialog.
|
||||
void setExecuted( bool executed );
|
||||
%Docstring
|
||||
Sets whether the algorithm was executed through the dialog.
|
||||
|
||||
.. seealso:: :py:func:`wasExecuted()`
|
||||
|
||||
.. seealso:: :py:func:`setResults()`
|
||||
%End
|
||||
|
||||
void setResults( const QVariantMap &results );
|
||||
%Docstring
|
||||
Sets the algorithm results.
|
||||
|
||||
.. seealso:: :py:func:`results()`
|
||||
|
||||
.. seealso:: :py:func:`setExecuted()`
|
||||
%End
|
||||
|
||||
void setInfo( const QString &message, bool isError = false, bool escapeHtml = true );
|
||||
|
@ -276,6 +276,7 @@ class AlgorithmDialog(QgsProcessingAlgorithmDialogBase):
|
||||
return
|
||||
|
||||
self.setExecuted(True)
|
||||
self.setResults(result)
|
||||
self.setInfo(self.tr('Algorithm \'{0}\' finished').format(self.algorithm().displayName()), escapeHtml=False)
|
||||
|
||||
if not keepOpen:
|
||||
|
@ -210,6 +210,11 @@ void QgsProcessingAlgorithmDialogBase::setExecuted( bool executed )
|
||||
mExecuted = executed;
|
||||
}
|
||||
|
||||
void QgsProcessingAlgorithmDialogBase::setResults( const QVariantMap &results )
|
||||
{
|
||||
mResults = results;
|
||||
}
|
||||
|
||||
void QgsProcessingAlgorithmDialogBase::finished( bool, const QVariantMap &, QgsProcessingContext &, QgsProcessingFeedback * )
|
||||
{
|
||||
|
||||
|
@ -118,9 +118,18 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, private Ui::
|
||||
|
||||
/**
|
||||
* Returns true if an algorithm was executed in the dialog.
|
||||
* \see results()
|
||||
* \see setExecuted()
|
||||
*/
|
||||
bool wasExecuted() const { return mExecuted; }
|
||||
|
||||
/**
|
||||
* Returns the results returned by the algorithm executed.
|
||||
* \see wasExecuted()
|
||||
* \see setResults()
|
||||
*/
|
||||
QVariantMap results() const { return mResults; }
|
||||
|
||||
/**
|
||||
* Creates a new processing feedback object, automatically connected to the appropriate
|
||||
* slots in this dialog.
|
||||
@ -203,9 +212,18 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, private Ui::
|
||||
|
||||
/**
|
||||
* Sets whether the algorithm was executed through the dialog.
|
||||
* \see wasExecuted()
|
||||
* \see setResults()
|
||||
*/
|
||||
void setExecuted( bool executed );
|
||||
|
||||
/**
|
||||
* Sets the algorithm results.
|
||||
* \see results()
|
||||
* \see setExecuted()
|
||||
*/
|
||||
void setResults( const QVariantMap &results );
|
||||
|
||||
/**
|
||||
* Displays an info \a message in the dialog's log.
|
||||
*/
|
||||
@ -250,6 +268,7 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, private Ui::
|
||||
QgsMessageBar *mMessageBar = nullptr;
|
||||
|
||||
bool mExecuted = false;
|
||||
QVariantMap mResults;
|
||||
QWidget *mMainWidget = nullptr;
|
||||
QgsProcessingAlgorithm *mAlgorithm = nullptr;
|
||||
bool mHelpCollapsed = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user