Class: QgsMessageOutput

Interface for showing messages from QGIS in GUI independent way.

This class provides abstraction of a dialog for showing output to the user. By default QgsMessageConsoleOutput will be used if not overridden with other message output creator function.

QGIS application uses QgsMessageView class for displaying a dialog to the user.

Object deletes itself when it’s not needed anymore. Children should use signal destroyed() to notify the deletion

Class Hierarchy

Inheritance diagram of qgis.core.QgsMessageOutput

Subclasses

QgsMessageOutputConsole

Default implementation of message output interface

QgsMessageViewer

A generic message view for displaying QGIS messages.

Methods

appendMessage

message to be appended to the current text

setMessage

Sets message, it won't be displayed until

setTitle

Sets title for the messages

showMessage

display the message to the user and deletes itself

Static Methods

createMessageOutput

function that returns new class derived from QgsMessageOutput (don't forget to delete it then if showMessage(bool) is not used

Attributes

MessageHtml

MessageText

class qgis.core.QgsMessageOutput[source]

Bases: object

MessageHtml = 1
MessageText = 0
class MessageType

Bases: int

appendMessage(self, message: str | None)[source]

message to be appended to the current text

Parameters:

message (Optional[str])

static createMessageOutput() QgsMessageOutput | None[source]

function that returns new class derived from QgsMessageOutput (don’t forget to delete it then if showMessage(bool) is not used

Return type:

Optional[QgsMessageOutput]

static createMessageOutput(bool) deletes the instance)[source]
setMessage(self, message: str | None, msgType: QgsMessageOutput.MessageType)[source]

Sets message, it won’t be displayed until

Parameters:
setTitle(self, title: str | None)[source]

Sets title for the messages

Parameters:

title (Optional[str])

showMessage(self, blocking: bool = True)[source]

display the message to the user and deletes itself

Parameters:

blocking (bool = True)

showMessage(title: str | None, message: str | None, msgType: QgsMessageOutput.MessageType)[source]

Display the blocking message to the user.

Parameters: