QgsMessageOutput class

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

Derived classes

class QgsMessageOutputConsole
Default implementation of message output interface.
class QgsMessageViewer
A generic message view for displaying QGIS messages.

Public types

enum MessageType { MessageText, MessageHtml }
message can be in plain text or in html format

Public static functions

static auto createMessageOutput() -> QgsMessageOutput*
function that returns new class derived from QgsMessageOutput (don't forget to delete it then if showMessage(bool) is not used showMessage(bool) deletes the instance)
static void setMessageOutputCreator(MESSAGE_OUTPUT_CREATOR f)
sets function that will be used to create message output
static void showMessage(const QString& title, const QString& message, MessageType msgType)
Display the blocking message to the user.

Public functions

void appendMessage(const QString& message) pure virtual
message to be appended to the current text
void setMessage(const QString& message, MessageType msgType) pure virtual
Sets message, it won't be displayed until.
void setTitle(const QString& title) pure virtual
Sets title for the messages.
void showMessage(bool blocking = true) pure virtual
display the message to the user and deletes itself

Function documentation

static void QgsMessageOutput::setMessageOutputCreator(MESSAGE_OUTPUT_CREATOR f)

sets function that will be used to create message output

static void QgsMessageOutput::showMessage(const QString& title, const QString& message, MessageType msgType)

Display the blocking message to the user.