QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QgsMessageOutput Class Referenceabstract

Interface for showing messages from QGIS in GUI independent way. More...

#include <qgsmessageoutput.h>

Inheritance diagram for QgsMessageOutput:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

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

Static Public Member Functions

static QgsMessageOutputcreateMessageOutput ()
 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) More...
 
static void setMessageOutputCreator (MESSAGE_OUTPUT_CREATOR f)
 sets function that will be used to create message output More...
 
static void showMessage (const QString &title, const QString &message, MessageType msgType)
 Display the blocking message to the user. More...
 

Detailed Description

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

Definition at line 43 of file qgsmessageoutput.h.

Member Enumeration Documentation

◆ MessageType

message can be in plain text or in html format

Enumerator
MessageText 
MessageHtml 

Definition at line 48 of file qgsmessageoutput.h.

Constructor & Destructor Documentation

◆ ~QgsMessageOutput()

virtual QgsMessageOutput::~QgsMessageOutput ( )
virtualdefault

Member Function Documentation

◆ appendMessage()

virtual void QgsMessageOutput::appendMessage ( const QString &  message)
pure virtual

message to be appended to the current text

Implemented in QgsMessageOutputConsole, and QgsMessageViewer.

◆ createMessageOutput()

QgsMessageOutput * QgsMessageOutput::createMessageOutput ( )
static

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)

Definition at line 36 of file qgsmessageoutput.cpp.

◆ setMessage()

virtual void QgsMessageOutput::setMessage ( const QString &  message,
MessageType  msgType 
)
pure virtual

Sets message, it won't be displayed until.

Implemented in QgsMessageOutputConsole, and QgsMessageViewer.

◆ setMessageOutputCreator()

void QgsMessageOutput::setMessageOutputCreator ( MESSAGE_OUTPUT_CREATOR  f)
static

sets function that will be used to create message output

Note
not available in Python bindings

Definition at line 31 of file qgsmessageoutput.cpp.

◆ setTitle()

virtual void QgsMessageOutput::setTitle ( const QString &  title)
pure virtual

Sets title for the messages.

Implemented in QgsMessageOutputConsole, and QgsMessageViewer.

◆ showMessage() [1/2]

virtual void QgsMessageOutput::showMessage ( bool  blocking = true)
pure virtual

display the message to the user and deletes itself

Implemented in QgsMessageOutputConsole, and QgsMessageViewer.

◆ showMessage() [2/2]

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

Display the blocking message to the user.

Since
QGIS 2.10

Definition at line 41 of file qgsmessageoutput.cpp.


The documentation for this class was generated from the following files: