Skip to content

Commit 1ae54b4

Browse files
author
wonder
committedApr 13, 2009
PyQGIS: wrapped QgsMapTip and QgsRunProcess.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10557 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed
 

‎python/core/core.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
%Include qgsrect.sip
5858
%Include qgsrendercontext.sip
5959
%Include qgsrenderer.sip
60+
%Include qgsrunprocess.sip
6061
%Include qgsscalecalculator.sip
6162
%Include qgssinglesymbolrenderer.sip
6263
%Include qgssnapper.sip

‎python/core/qgsrunprocess.sip

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
/** \ingroup core
3+
* A class that executes an external program/script.
4+
* It can optionally capture the standard output and error from the
5+
* process and displays them in a dialog box.
6+
*/
7+
class QgsRunProcess: QObject
8+
{
9+
%TypeHeaderCode
10+
#include <qgsrunprocess.h>
11+
%End
12+
13+
public:
14+
// This class deletes itself, so to ensure that it is only created
15+
// using new, the Named Consturctor Idiom is used, and one needs to
16+
// use the create() static function to get an instance of this class.
17+
18+
// The action argument contains string with the command.
19+
// If capture is true, the standard output and error from the process
20+
// will be sent to QgsMessageOuptut - usually a dialog box.
21+
static QgsRunProcess* create( const QString& action, bool capture );
22+
23+
public slots:
24+
void stdoutAvailable();
25+
void stderrAvailable();
26+
void processError( QProcess::ProcessError );
27+
void processExit( int, QProcess::ExitStatus );
28+
void dialogGone();
29+
30+
private:
31+
QgsRunProcess( const QString& action, bool capture );
32+
~QgsRunProcess();
33+
};

‎python/gui/gui.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
%Include qgsmapcanvasitem.sip
1616
%Include qgsmapcanvasmap.sip
1717
%Include qgsmapcanvassnapper.sip
18+
%Include qgsmaptip.sip
1819
%Include qgsmaptool.sip
1920
%Include qgsmaptoolemitpoint.sip
2021
%Include qgsmaptoolpan.sip

‎python/gui/qgsmaptip.sip

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
/** \ingroup gui
3+
* A maptip is a class to display a tip on a map canvas
4+
* when a mouse is hovered over a feature.
5+
*/
6+
class QgsMapTip
7+
{
8+
%TypeHeaderCode
9+
#include <qgsmaptip.h>
10+
%End
11+
12+
public:
13+
/** Default constructor
14+
*/
15+
QgsMapTip();
16+
/** Destructor
17+
*/
18+
virtual ~QgsMapTip();
19+
/** Show a maptip at a given point on the map canvas
20+
* @param QgsMapLayer thepLayer - a qgis vector map layer pointer that will
21+
* be used to provide the attribute data for the map tip.
22+
* @param QgsPoint theMapPosition - a reference to the position of the cursor
23+
* in map coordinatess.
24+
* @param QgsPoint thePixelPosition - a reference to the position of the cursor
25+
* in pixel coordinates.
26+
* @param QgsMapCanvas thepMapCanvas - a map canvas on which the tip is drawn
27+
*/
28+
void showMapTip( QgsMapLayer * thepLayer,
29+
QgsPoint & theMapPosition,
30+
QPoint & thePixelPosition,
31+
QgsMapCanvas *mpMapCanvas );
32+
/** Clear the current maptip if it exists
33+
* @param QgsMapCanvas mpMapCanvas - the canvas from which the tip should
34+
* be cleared.
35+
*/
36+
void clear( QgsMapCanvas *mpMapCanvas );
37+
38+
};

0 commit comments

Comments
 (0)
Please sign in to comment.