QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
src
core
qgsrunprocess.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrunprocess.h
3
4
A class that runs an external program
5
6
-------------------
7
begin : Jan 2005
8
copyright : (C) 2005 by Gavin Macaulay
9
email : gavin at macaulay dot co dot nz
10
***************************************************************************/
11
12
/***************************************************************************
13
* *
14
* This program is free software; you can redistribute it and/or modify *
15
* it under the terms of the GNU General Public License as published by *
16
* the Free Software Foundation; either version 2 of the License, or *
17
* (at your option) any later version. *
18
* *
19
***************************************************************************/
20
21
#ifndef QGSRUNPROCESS_H
22
#define QGSRUNPROCESS_H
23
24
#include <QObject>
25
#include <QProcess>
26
27
#include "qgis_core.h"
28
#include "
qgis_sip.h
"
29
30
class
QgsMessageOutput
;
31
41
class
CORE_EXPORT
QgsRunProcess
:
public
QObject
SIP_NODEFAULTCTORS
42
{
43
Q_OBJECT
44
45
public
:
46
// This class deletes itself, so to ensure that it is only created
47
// using new, the Named Constructor Idiom is used, and one needs to
48
// use the create() static function to get an instance of this class.
49
50
// The action argument contains string with the command.
51
// If capture is true, the standard output and error from the process
52
// will be sent to QgsMessageOutput - usually a dialog box.
53
static
QgsRunProcess
*
create
(
const
QString &action,
bool
capture )
SIP_FACTORY
54
{
return
new
QgsRunProcess
( action, capture ); }
55
56
private
:
57
QgsRunProcess
(
const
QString &action,
bool
capture )
SIP_FORCE
;
58
~
QgsRunProcess
() override
SIP_FORCE
;
59
60
#if QT_CONFIG(process)
61
// Deletes the instance of the class
62
void
die();
63
64
QProcess *mProcess =
nullptr
;
65
QgsMessageOutput
*mOutput =
nullptr
;
66
QString mCommand;
67
68
public
slots:
69
void
stdoutAvailable();
70
void
stderrAvailable();
71
void
processError( QProcess::ProcessError );
72
void
processExit(
int
, QProcess::ExitStatus );
73
void
dialogGone();
74
#endif // !(QT_CONFIG(process)
75
};
76
77
#endif
QgsMessageOutput
Interface for showing messages from QGIS in GUI independent way.
Definition:
qgsmessageoutput.h:43
SIP_FACTORY
#define SIP_FACTORY
Definition:
qgis_sip.h:76
QgsRunProcess::create
static QgsRunProcess * create(const QString &action, bool capture)
Definition:
qgsrunprocess.h:53
qgis_sip.h
SIP_NODEFAULTCTORS
#define SIP_NODEFAULTCTORS
Definition:
qgis_sip.h:101
SIP_FORCE
#define SIP_FORCE
Definition:
qgis_sip.h:131
QgsRunProcess
A class that executes an external program/script.
Definition:
qgsrunprocess.h:42
Generated on Sat Oct 24 2020 17:43:09 for QGIS API Documentation by
1.8.20