QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsmessageoutput.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmessageoutput.h - interface for showing messages
3
----------------------
4
begin : April 2006
5
copyright : (C) 2006 by Martin Dobias
6
email : wonder.sk at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
17
#ifndef QGSMESSAGEOUTPUT_H
18
#define QGSMESSAGEOUTPUT_H
19
20
#include "
qgis.h
"
21
#include "qgis_core.h"
22
#include "
qgis_sip.h
"
23
24
#include <QObject>
25
#include <QString>
26
27
class
QgsMessageOutput
;
28
typedef
QgsMessageOutput
*( *MESSAGE_OUTPUT_CREATOR )()
SIP_SKIP
;
29
30
44
class
CORE_EXPORT
QgsMessageOutput
45
{
46
public
:
47
virtual
~QgsMessageOutput
() =
default
;
48
50
virtual
void
setMessage
(
const
QString &message,
Qgis::StringFormat
format ) = 0;
51
53
virtual
void
appendMessage
(
const
QString &message ) = 0;
54
56
virtual
void
setTitle
(
const
QString &title ) = 0;
57
59
virtual
void
showMessage
(
bool
blocking =
true
) = 0;
60
64
static
void
showMessage
(
const
QString &title,
const
QString &message,
Qgis::StringFormat
format );
65
66
// TODO: implementation where Python class could be passed
67
72
static
void
setMessageOutputCreator
(
MESSAGE_OUTPUT_CREATOR
f )
SIP_SKIP
;
73
78
static
QgsMessageOutput
*
createMessageOutput
();
79
80
private
:
82
static
MESSAGE_OUTPUT_CREATOR
mMessageOutputCreator;
83
};
84
85
93
class
CORE_EXPORT
QgsMessageOutputConsole
:
public
QObject,
public
QgsMessageOutput
94
{
95
Q_OBJECT
96
97
public
:
98
QgsMessageOutputConsole
() =
default
;
99
100
void
setMessage
(
const
QString &message,
Qgis::StringFormat
format )
override
;
101
102
void
appendMessage
(
const
QString &message )
override
;
103
104
void
setTitle
(
const
QString &title )
override
;
105
107
void
showMessage
(
bool
blocking =
true
)
override
;
108
109
signals:
110
112
void
destroyed
();
113
114
private
:
116
QString mMessage;
117
119
QString mTitle;
120
121
Qgis::StringFormat
mFormat =
Qgis::StringFormat::PlainText
;
122
};
123
124
#endif
Qgis::StringFormat
StringFormat
Format of log message.
Definition
qgis.h:175
Qgis::StringFormat::PlainText
@ PlainText
Text message.
Definition
qgis.h:176
QgsMessageOutputConsole::setTitle
void setTitle(const QString &title) override
Sets title for the messages.
Definition
qgsmessageoutput.cpp:83
QgsMessageOutputConsole::destroyed
void destroyed()
signals that object will be destroyed and shouldn't be used anymore
QgsMessageOutputConsole::QgsMessageOutputConsole
QgsMessageOutputConsole()=default
QgsMessageOutputConsole::appendMessage
void appendMessage(const QString &message) override
message to be appended to the current text
Definition
qgsmessageoutput.cpp:64
QgsMessageOutputConsole::setMessage
void setMessage(const QString &message, Qgis::StringFormat format) override
Sets message, it won't be displayed until.
Definition
qgsmessageoutput.cpp:58
QgsMessageOutputConsole::showMessage
void showMessage(bool blocking=true) override
sends the message to the standard output
Definition
qgsmessageoutput.cpp:69
QgsMessageOutput
Interface for showing messages from QGIS in GUI independent way.
Definition
qgsmessageoutput.h:45
QgsMessageOutput::showMessage
virtual void showMessage(bool blocking=true)=0
display the message to the user and deletes itself
QgsMessageOutput::appendMessage
virtual void appendMessage(const QString &message)=0
message to be appended to the current text
QgsMessageOutput::createMessageOutput
static QgsMessageOutput * createMessageOutput()
function that returns new class derived from QgsMessageOutput (don't forget to delete it then if show...
Definition
qgsmessageoutput.cpp:42
QgsMessageOutput::setMessageOutputCreator
static void setMessageOutputCreator(MESSAGE_OUTPUT_CREATOR f)
sets function that will be used to create message output
Definition
qgsmessageoutput.cpp:37
QgsMessageOutput::~QgsMessageOutput
virtual ~QgsMessageOutput()=default
QgsMessageOutput::setMessage
virtual void setMessage(const QString &message, Qgis::StringFormat format)=0
Sets message, it won't be displayed until.
QgsMessageOutput::setTitle
virtual void setTitle(const QString &title)=0
Sets title for the messages.
qgis.h
qgis_sip.h
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
MESSAGE_OUTPUT_CREATOR
QgsMessageOutput *(* MESSAGE_OUTPUT_CREATOR)()
Definition
qgsmessageoutput.h:28
Generated on
for QGIS API Documentation by
1.17.0