1
/***************************************************************************
4
A class that runs an external program
8
copyright : (C) 2005 by Gavin Macaulay
9
email : gavin at macaulay dot co dot nz
10
***************************************************************************/
12
/***************************************************************************
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. *
19
***************************************************************************/
22
#ifndef QGSRUNPROCESS_H
23
#define QGSRUNPROCESS_H
28
class QgsMessageOutput;
31
* A class that executes an external program/script.
32
* It can optionally capture the standard output and error from the
33
* process and displays them in a dialog box.
35
class CORE_EXPORT QgsRunProcess: public QObject
40
// This class deletes itself, so to ensure that it is only created
41
// using new, the Named Consturctor Idiom is used, and one needs to
42
// use the create() static function to get an instance of this class.
44
// The action argument contains string with the command.
45
// If capture is true, the standard output and error from the process
46
// will be sent to QgsMessageOuptut - usually a dialog box.
47
static QgsRunProcess* create( const QString& action, bool capture )
48
{ return new QgsRunProcess( action, capture ); }
51
void stdoutAvailable();
52
void stderrAvailable();
53
void processError( QProcess::ProcessError );
54
void processExit( int, QProcess::ExitStatus );
58
QgsRunProcess( const QString& action, bool capture );
61
// Deletes the instance of the class
65
QgsMessageOutput* mOutput;