Class: QgsProcessingAlgorithmDialogBase

class qgis.gui.QgsProcessingAlgorithmDialogBase(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = 0)

Bases: PyQt5.QtWidgets.QDialog

Constructor for QgsProcessingAlgorithmDialogBase.

Base class for processing algorithm dialogs.

Note

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

New in version 3.0.

Parameters
  • parent (QWidget = None) –

  • flags

FormatHtml = 1
FormatPlainText = 0
class LogFormat

Bases: int

actionEvent()
algorithm(self) → QgsProcessingAlgorithm

Returns the algorithm running in the dialog.

See also

setAlgorithm()

Return type

QgsProcessingAlgorithm

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()
childEvent()
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()
contextMenuEvent()
copyLogToClipboard(self)

Copies the current log contents to the clipboard.

New in version 3.2.

create()
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()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
eventFilter()
finished(self, successful: bool, result: Dict[str, Any], context: QgsProcessingContext, feedback: QgsProcessingFeedback)

Called when the algorithm has finished executing.

Parameters
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
formatStringForLog(string: str) → str

Formats an input string for display in the log tab.

New in version 3.0.1.

Parameters

string (str) –

Return type

str

getParameterValues(self) → Dict[str, Any]

Returns the parameter values for the algorithm to run in the dialog.

Return type

Dict[str, Any]

hideEvent()
hideShortHelp(self)

Hides the short help panel.

initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
mainWidget(self) → QWidget

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

See also

setMainWidget()

Return type

QWidget

messageBar(self) → QgsMessageBar

Returns the dialog’s message bar.

Return type

QgsMessageBar

metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
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) –

pushInfo(self, info: str)

Pushes an information string to the dialog’s log.

Parameters

info (str) –

receivers()
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) –

resetGui(self)

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

resizeEvent()
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()
senderSignalIndex()
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) –

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

Displays an info message in the dialog’s log.

Parameters
  • message (str) –

  • isError (bool = False) –

  • escapeHtml (bool = True) –

setMainWidget(self, widget: QWidget)

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

See also

mainWidget()

Parameters

widget (QWidget) –

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()
showEvent()
showLog(self)

Switches the dialog to the log page.

tabWidget(self) → QTabWidget

Returns the dialog’s tab widget.

Return type

QTabWidget

tabletEvent()
timerEvent()
updateMicroFocus()
wasExecuted(self) → bool

Returns true if an algorithm was executed in the dialog.

See also

results()

See also

setExecuted()

Return type

bool

wheelEvent()