Class: QgsProcessingAlgorithmDialogBase

class qgis.gui.QgsProcessingAlgorithmDialogBase

Bases: PyQt5.QtWidgets.QDialog, QgsProcessingParametersGenerator, QgsProcessingContextGenerator

Base class for processing algorithm dialogs.

Note

This is not considered stable API and may change in future QGIS versions.

QgsProcessingAlgorithmDialogBase(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags(), mode: QgsProcessingAlgorithmDialogBase.DialogMode = QgsProcessingAlgorithmDialogBase.DialogMode.Single) Constructor for QgsProcessingAlgorithmDialogBase.

Enums

DialogMode

Bases: enum.IntEnum

Methods

actionEvent

algExecuted

Called when an algorithm task has completed.

algorithm

Returns the algorithm running in the dialog.

applyContextOverrides

Applies any defined overrides for Processing context settings to the specified context.

blockAdditionalControlsWhileRunning

For subclasses to register their own GUI controls to be blocked while the algorithm is running.

blockControlsWhileRunning

Blocks run and changeParameters buttons and parameters tab while the algorithm is running.

buttonBox

Returns the dialog's button box.

cancelButton

Returns the dialog's cancel button.

changeEvent

changeParametersButton

Returns the dialog's change parameters button.

childEvent

clearLog

Clears the current log contents.

clearProgress

Clears any current progress from the dialog.

closeEvent

param e:

connectNotify

contextMenuEvent

copyLogToClipboard

Copies the current log contents to the clipboard.

create

createFeedback

Creates a new processing feedback object, automatically connected to the appropriate slots in this dialog.

createProgressDialog

Creates a modal progress dialog showing progress and log messages from this dialog.

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

eventFilter

finished

Called when the algorithm has finished executing.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

formatStringForLog

Formats an input string for display in the log tab.

hideEvent

hideShortHelp

Hides the short help panel.

initPainter

inputMethodEvent

isFinalized

Returns True if the dialog is all finalized and can be safely deleted.

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

logLevel

Returns the logging level to use when running algorithms from the dialog.

mainWidget

Returns the main widget for the dialog, usually a panel for configuring algorithm parameters.

messageBar

Returns the dialog's message bar.

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

pushCommandInfo

Pushes command info to the dialog's log.

pushConsoleInfo

Pushes a console info string to the dialog's log.

pushDebugInfo

Pushes a debug info string to the dialog's log.

pushFormattedMessage

Pushes a pre-formatted message to the dialog's log

pushInfo

Pushes an information string to the dialog's log.

pushWarning

Pushes a warning information string to the dialog's log.

receivers

reject

reportError

Reports an error string to the dialog's log.

resetAdditionalGui

For subclasses to register their own GUI controls to be reset, ready for another algorithm execution.

resetGui

Resets the dialog's gui, ready for another algorithm execution.

resizeEvent

results

Returns the results returned by the algorithm executed.

runAlgorithm

Called when the dialog's algorithm should be run.

runButton

Returns the dialog's run button.

saveLog

Opens a dialog allowing users to save the current log contents.

saveLogToFile

Saves the log contents to a text file (specified by the file path), in the given format.

sender

senderSignalIndex

setAlgorithm

Sets the algorithm to run in the dialog.

setCurrentTask

Sets the current task running in the dialog.

setExecuted

Sets whether the algorithm was executed through the dialog.

setExecutedAnyResult

Sets whether the algorithm was executed through the dialog (no matter the result).

setInfo

Displays an info message in the dialog's log.

setLogLevel

Sets the logging level to use when running algorithms from the dialog.

setMainWidget

Sets the main widget for the dialog, usually a panel for configuring algorithm parameters.

setParameters

Sets the parameter values to show in the dialog.

setPercentage

Sets the percentage progress for the dialog, between 0 and 100.

setProgressText

Sets a progress text message.

setResults

Sets the algorithm results.

sharedPainter

showEvent

showLog

Switches the dialog to the log page.

showParameters

Switches the dialog to the parameters page.

tabWidget

Returns the dialog's tab widget.

tabletEvent

timerEvent

updateMicroFocus

updateRunButtonVisibility

Sets visibility for mutually exclusive buttons Run and Change Parameters.

wasExecuted

Returns True if an algorithm was executed in the dialog.

wheelEvent

Signals

algorithmFinished

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

Attributes

FormatHtml

FormatPlainText

class DialogMode(value)

Bases: enum.IntEnum

Dialog modes.

New in version 3.24.

  • Single: Single algorithm execution mode

  • Batch: Batch processing mode

Batch = 1
Single = 0
FormatHtml = 1
FormatPlainText = 0
class LogFormat

Bases: int

actionEvent(self, QActionEvent)
algExecuted(self, successful: bool, results: Dict[str, Any])

Called when an algorithm task has completed.

New in version 3.26.

Parameters:
  • successful (bool) –

  • results (Dict[str) –

algorithm(self) QgsProcessingAlgorithm

Returns the algorithm running in the dialog.

See also

setAlgorithm()

Return type:

QgsProcessingAlgorithm

algorithmFinished

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

applyContextOverrides(self, context: QgsProcessingContext)

Applies any defined overrides for Processing context settings to the specified context.

This allows the dialog to override default Processing settings for an individual algorithm execution.

New in version 3.32.

Parameters:

context (QgsProcessingContext) –

blockAdditionalControlsWhileRunning(self)

For subclasses to register their own GUI controls to be blocked while the algorithm is running.

blockControlsWhileRunning(self)

Blocks run and changeParameters buttons and parameters tab while the algorithm is running.

buttonBox(self) QDialogButtonBox

Returns the dialog’s button box.

Return type:

QDialogButtonBox

cancelButton(self) QPushButton

Returns the dialog’s cancel button.

Return type:

QPushButton

changeEvent(self, QEvent)
changeParametersButton(self) QPushButton

Returns the dialog’s change parameters button.

Return type:

QPushButton

childEvent(self, QChildEvent)
clearLog(self)

Clears the current log contents.

New in version 3.2.

clearProgress(self)

Clears any current progress from the dialog.

closeEvent(self, e: QCloseEvent)
Parameters:

e (QCloseEvent) –

connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
copyLogToClipboard(self)

Copies the current log contents to the clipboard.

New in version 3.2.

create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
createFeedback(self) QgsProcessingFeedback

Creates a new processing feedback object, automatically connected to the appropriate slots in this dialog.

Return type:

QgsProcessingFeedback

createProgressDialog(self) QDialog

Creates a modal progress dialog showing progress and log messages from this dialog.

Return type:

QDialog

customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
finished(self, successful: bool, result: Dict[str, Any], context: QgsProcessingContext, feedback: QgsProcessingFeedback)

Called when the algorithm has finished executing.

Parameters:
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
formatStringForLog(string: str) str

Formats an input string for display in the log tab.

Parameters:

string (str) –

Return type:

str

hideEvent(self, QHideEvent)
hideShortHelp(self)

Hides the short help panel.

initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isFinalized(self) bool

Returns True if the dialog is all finalized and can be safely deleted.

New in version 3.26.

Return type:

bool

isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
logLevel(self) Qgis.ProcessingLogLevel

Returns the logging level to use when running algorithms from the dialog.

See also

setLogLevel()

New in version 3.20.

Return type:

Qgis.ProcessingLogLevel

mainWidget(self) QgsPanelWidget

Returns the main widget for the dialog, usually a panel for configuring algorithm parameters.

See also

setMainWidget()

Return type:

QgsPanelWidget

messageBar(self) QgsMessageBar

Returns the dialog’s message bar.

Return type:

QgsMessageBar

metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
pushCommandInfo(self, info: str)

Pushes command info to the dialog’s log.

Parameters:

info (str) –

pushConsoleInfo(self, info: str)

Pushes a console info string to the dialog’s log.

Parameters:

info (str) –

pushDebugInfo(self, message: str)

Pushes a debug info string to the dialog’s log.

Parameters:

message (str) –

pushFormattedMessage(self, html: str)

Pushes a pre-formatted message to the dialog’s log

This can be used to push formatted HTML messages to the dialog.

New in version 3.36.

Parameters:

html (str) –

pushInfo(self, info: str)

Pushes an information string to the dialog’s log.

Parameters:

info (str) –

pushWarning(self, warning: str)

Pushes a warning information string to the dialog’s log.

Parameters:

warning (str) –

receivers(self, PYQT_SIGNAL) int
reject(self)
reportError(self, error: str, fatalError: bool)

Reports an error string to the dialog’s log.

If fatalError is True, the error prevented the algorithm from executing.

Parameters:
  • error (str) –

  • fatalError (bool) –

resetAdditionalGui(self)

For subclasses to register their own GUI controls to be reset, ready for another algorithm execution.

resetGui(self)

Resets the dialog’s gui, ready for another algorithm execution.

resizeEvent(self, QResizeEvent)
results(self) Dict[str, Any]

Returns the results returned by the algorithm executed.

See also

wasExecuted()

See also

setResults()

Return type:

Dict[str, Any]

runAlgorithm(self)

Called when the dialog’s algorithm should be run. Must be overridden by subclasses.

runButton(self) QPushButton

Returns the dialog’s run button.

Return type:

QPushButton

saveLog(self)

Opens a dialog allowing users to save the current log contents.

See also

saveLogToFile()

New in version 3.2.

saveLogToFile(self, path: str, format: QgsProcessingAlgorithmDialogBase.LogFormat = QgsProcessingAlgorithmDialogBase.FormatPlainText)

Saves the log contents to a text file (specified by the file path), in the given format.

See also

saveLog()

New in version 3.2.

Parameters:
  • path (str) –

  • format (QgsProcessingAlgorithmDialogBase.LogFormat = QgsProcessingAlgorithmDialogBase.FormatPlainText) –

sender(self) QObject
senderSignalIndex(self) int
setAlgorithm(self, algorithm: QgsProcessingAlgorithm)

Sets the algorithm to run in the dialog.

Ownership of the algorithm instance is transferred to the dialog.

See also

algorithm()

Parameters:

algorithm (QgsProcessingAlgorithm) –

setCurrentTask(self, task: QgsProcessingAlgRunnerTask)

Sets the current task running in the dialog. The task will automatically be started by the dialog. Ownership of task is transferred to the dialog.

Parameters:

task (QgsProcessingAlgRunnerTask) –

setExecuted(self, executed: bool)

Sets whether the algorithm was executed through the dialog.

See also

wasExecuted()

See also

setResults()

Parameters:

executed (bool) –

setExecutedAnyResult(self, executedAnyResult: bool)

Sets whether the algorithm was executed through the dialog (no matter the result).

Parameters:

executedAnyResult (bool) –

setInfo(self, message: str, isError: bool = False, escapeHtml: bool = True, isWarning: bool = False)

Displays an info message in the dialog’s log.

Parameters:
  • message (str) –

  • isError (bool = False) –

  • escapeHtml (bool = True) –

  • isWarning (bool = False) –

setLogLevel(self, level: Qgis.ProcessingLogLevel)

Sets the logging level to use when running algorithms from the dialog.

See also

logLevel()

New in version 3.20.

Parameters:

level (Qgis.ProcessingLogLevel) –

setMainWidget(self, widget: QgsPanelWidget)

Sets the main widget for the dialog, usually a panel for configuring algorithm parameters.

See also

mainWidget()

Parameters:

widget (QgsPanelWidget) –

setParameters(self, values: Dict[str, Any])

Sets the parameter values to show in the dialog.

New in version 3.24.

Parameters:

values (Dict[str) –

setPercentage(self, percent: float)

Sets the percentage progress for the dialog, between 0 and 100.

Parameters:

percent (float) –

setProgressText(self, text: str)

Sets a progress text message.

Parameters:

text (str) –

setResults(self, results: Dict[str, Any])

Sets the algorithm results.

See also

results()

See also

setExecuted()

Parameters:

results (Dict[str) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
showLog(self)

Switches the dialog to the log page.

showParameters(self)

Switches the dialog to the parameters page.

tabWidget(self) QTabWidget

Returns the dialog’s tab widget.

Return type:

QTabWidget

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
updateRunButtonVisibility(self)

Sets visibility for mutually exclusive buttons Run and Change Parameters.

wasExecuted(self) bool

Returns True if an algorithm was executed in the dialog.

See also

results()

See also

setExecuted()

Return type:

bool

wheelEvent(self, QWheelEvent)