Skip to content

Commit ed915e7

Browse files
committedJun 8, 2017
sipify gui part 1
1 parent a7c9cc8 commit ed915e7

40 files changed

+2060
-1077
lines changed
 

‎python/auto_sip.blacklist

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,34 +54,6 @@ core/symbology-ng/qgslinesymbollayer.sip
5454
core/symbology-ng/qgsmarkersymbollayer.sip
5555
core/symbology-ng/qgssymbollayer.sip
5656
core/symbology-ng/qgssymbollayerregistry.sip
57-
gui/qgsmaptip.sip
58-
gui/qgsmaptool.sip
59-
gui/qgsmaptooladvanceddigitizing.sip
60-
gui/qgsmaptoolcapture.sip
61-
gui/qgsmaptooledit.sip
62-
gui/qgsmaptoolemitpoint.sip
63-
gui/qgsmaptoolidentify.sip
64-
gui/qgsmaptoolidentifyfeature.sip
65-
gui/qgsmaptoolpan.sip
66-
gui/qgsmaptoolzoom.sip
67-
gui/qgsmaplayerstylemanagerwidget.sip
68-
gui/qgsmessagebar.sip
69-
gui/qgsmessagebaritem.sip
70-
gui/qgsmessageviewer.sip
71-
gui/qgsnewhttpconnection.sip
72-
gui/qgsnewnamedialog.sip
73-
gui/qgsnewvectorlayerdialog.sip
74-
gui/qgsnewgeopackagelayerdialog.sip
75-
gui/qgsoptionsdialogbase.sip
76-
gui/qgsorderbydialog.sip
77-
gui/qgsowssourceselect.sip
78-
gui/qgspanelwidget.sip
79-
gui/qgspanelwidgetstack.sip
80-
gui/qgspasswordlineedit.sip
81-
gui/qgspixmaplabel.sip
82-
gui/qgspluginmanagerinterface.sip
83-
gui/qgspresetcolorrampdialog.sip
84-
gui/qgsprevieweffect.sip
8557
gui/qgsprojectionselectiondialog.sip
8658
gui/qgsprojectionselectiontreewidget.sip
8759
gui/qgsprojectionselectionwidget.sip
Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,44 @@
1-
/**
2-
* @brief The QgsMapLayerStyleManagerWidget class which is used to visually manage
3-
* the layer styles.
4-
*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaplayerstylemanagerwidget.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
513
class QgsMapLayerStyleManagerWidget : QgsMapLayerConfigWidget
614
{
15+
%Docstring
16+
The QgsMapLayerStyleManagerWidget class which is used to visually manage
17+
the layer styles.
18+
%End
19+
720
%TypeHeaderCode
821
#include "qgsmaplayerstylemanagerwidget.h"
922
%End
1023
public:
1124

12-
/**
13-
* @brief Style manager widget to manage the layers styles.
14-
* @param layer The layer for the widget
15-
* @param canvas The canvas object.
16-
* @param parent The parent.
17-
*/
1825
QgsMapLayerStyleManagerWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent = 0 );
26+
%Docstring
27+
Style manager widget to manage the layers styles.
28+
\param layer The layer for the widget
29+
\param canvas The canvas object.
30+
\param parent The parent.
31+
%End
1932

2033
public slots:
21-
void apply();
34+
virtual void apply();
35+
2236
};
37+
38+
/************************************************************************
39+
* This file has been generated automatically from *
40+
* *
41+
* src/gui/qgsmaplayerstylemanagerwidget.h *
42+
* *
43+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
44+
************************************************************************/

‎python/gui/qgsmaptip.sip

Lines changed: 62 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,70 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptip.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
18

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: QWidget
9+
10+
11+
class QgsMapTip : QWidget
712
{
8-
%TypeHeaderCode
9-
#include <qgsmaptip.h>
13+
%Docstring
14+
A maptip is a class to display a tip on a map canvas
15+
when a mouse is hovered over a feature.
16+
17+
Since QGIS 2.16 a maptip can show full html.
18+
QgsMapTip is a QgsWebView, so you can load full HTML/JS/CSS in it.
19+
20+
The code found in the map tips tab is inserted in a inline-block div
21+
so the frame can be resized based on the content size.
22+
23+
If no element in the html has a width attribute, the frame will squeeze down
24+
to the widest word. To avoid this you can wrap your HTML in a
25+
div style="width:300px" or similar.
26+
27+
JS can be included using the script tag as usual, while CSS files must be
28+
linked using link rel="stylesheet" href="URL.css" the html specs
29+
discourages link rel="stylesheet" in the body, but all browsers allow it.
30+
see https://jakearchibald.com/2016/link-in-body
1031
%End
1132

33+
%TypeHeaderCode
34+
#include "qgsmaptip.h"
35+
%End
1236
public:
13-
/** Default constructor
14-
*/
37+
1538
QgsMapTip();
16-
/** Destructor
17-
*/
18-
virtual ~QgsMapTip();
19-
/** Show a maptip at a given point on the map canvas
20-
* @param thepLayer a qgis vector map layer pointer that will
21-
* be used to provide the attribute data for the map tip.
22-
* @param mapPosition a reference to the position of the cursor
23-
* in map coordinatess.
24-
* @param pixelPosition a reference to the position of the cursor
25-
* in pixel coordinates.
26-
* @param mpMapCanvas a map canvas on which the tip is drawn
27-
*/
28-
void showMapTip( QgsMapLayer * thepLayer,
29-
QgsPointXY & mapPosition,
30-
QPoint & pixelPosition,
39+
%Docstring
40+
Default constructor
41+
%End
42+
43+
void showMapTip( QgsMapLayer *thepLayer,
44+
QgsPointXY &mapPosition,
45+
QPoint &pixelPosition,
3146
QgsMapCanvas *mpMapCanvas );
32-
/** Clear the current maptip if it exists
33-
* @param mpMapCanvas the canvas from which the tip should be cleared.
34-
*/
35-
void clear( QgsMapCanvas *mpMapCanvas );
47+
%Docstring
48+
Show a maptip at a given point on the map canvas
49+
\param thepLayer a qgis vector map layer pointer that will
50+
be used to provide the attribute data for the map tip.
51+
\param mapPosition a reference to the position of the cursor
52+
in map coordinatess.
53+
\param pixelPosition a reference to the position of the cursor
54+
in pixel coordinates.
55+
\param mpMapCanvas a map canvas on which the tip is drawn
56+
%End
57+
58+
void clear( QgsMapCanvas *mpMapCanvas = 0 );
59+
%Docstring
60+
Clear the current maptip if it exists
61+
\param mpMapCanvas the canvas from which the tip should be cleared.
62+
%End
3663
};
64+
/************************************************************************
65+
* This file has been generated automatically from *
66+
* *
67+
* src/gui/qgsmaptip.h *
68+
* *
69+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
70+
************************************************************************/

‎python/gui/qgsmaptool.sip

Lines changed: 176 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptool.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
113

214
%ModuleHeaderCode
315
// fix to allow compilation with sip 4.7 that for some reason
@@ -11,159 +23,254 @@
1123

1224
class QgsMapTool : QObject
1325
{
26+
%Docstring
27+
Abstract base class for all map tools.
28+
Map tools are user interactive tools for manipulating the
29+
map canvas. For example map pan and zoom features are
30+
implemented as map tools.
31+
%End
32+
1433
%TypeHeaderCode
15-
#include <qgsmaptool.h>
34+
#include "qgsmaptool.h"
1635
%End
1736

1837
%ConvertToSubClassCode
19-
if (dynamic_cast<QgsMapToolZoom*>(sipCpp) != NULL)
20-
sipType = sipType_QgsMapToolZoom;
21-
else if (dynamic_cast<QgsMapToolPan*>(sipCpp) != NULL)
22-
sipType = sipType_QgsMapToolPan;
23-
else if (dynamic_cast<QgsMapToolEmitPoint*>(sipCpp) != NULL)
24-
sipType = sipType_QgsMapToolEmitPoint;
25-
else if (dynamic_cast<QgsMapToolIdentify*>(sipCpp) != NULL)
26-
sipType = sipType_QgsMapToolIdentify;
27-
else
28-
sipType = NULL;
38+
if ( dynamic_cast<QgsMapToolZoom *>( sipCpp ) != NULL )
39+
sipType = sipType_QgsMapToolZoom;
40+
else if ( dynamic_cast<QgsMapToolPan *>( sipCpp ) != NULL )
41+
sipType = sipType_QgsMapToolPan;
42+
else if ( dynamic_cast<QgsMapToolEmitPoint *>( sipCpp ) != NULL )
43+
sipType = sipType_QgsMapToolEmitPoint;
44+
else if ( dynamic_cast<QgsMapToolIdentify *>( sipCpp ) != NULL )
45+
sipType = sipType_QgsMapToolIdentify;
46+
else
47+
sipType = NULL;
2948
%End
30-
3149
public:
3250

33-
//! Enumeration of flags that adjust the way the map tool operates
34-
//! @note added in QGIS 2.16
3551
enum Flag
3652
{
37-
Transient, /*!< Indicates that this map tool performs a transient (one-off) operation.
38-
If it does, the tool can be operated once and then a previous map
39-
tool automatically restored. */
40-
EditTool, /*!< Map tool is an edit tool, which can only be used when layer is editable*/
41-
AllowZoomRect, /*!< Allow zooming by rectangle (by holding shift and dragging) while the tool is active*/
53+
Transient,
54+
EditTool,
55+
AllowZoomRect,
4256
};
4357
typedef QFlags<QgsMapTool::Flag> Flags;
4458

45-
/** Returns the flags for the map tool.
46-
* @note added in QGIS 2.16
47-
*/
59+
4860
virtual Flags flags() const;
61+
%Docstring
62+
Returns the flags for the map tool.
63+
.. versionadded:: 2.16
64+
:rtype: Flags
65+
%End
4966

50-
//! virtual destructor
5167
virtual ~QgsMapTool();
5268

53-
//! Mouse move event for overriding. Default implementation does nothing.
5469
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
70+
%Docstring
71+
Mouse move event for overriding. Default implementation does nothing.
72+
%End
5573

56-
//! Mouse double click event for overriding. Default implementation does nothing.
5774
virtual void canvasDoubleClickEvent( QgsMapMouseEvent *e );
75+
%Docstring
76+
Mouse double click event for overriding. Default implementation does nothing.
77+
%End
5878

59-
//! Mouse press event for overriding. Default implementation does nothing.
6079
virtual void canvasPressEvent( QgsMapMouseEvent *e );
80+
%Docstring
81+
Mouse press event for overriding. Default implementation does nothing.
82+
%End
6183

62-
//! Mouse release event for overriding. Default implementation does nothing.
6384
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
85+
%Docstring
86+
Mouse release event for overriding. Default implementation does nothing.
87+
%End
6488

65-
//! Mouse wheel event for overriding. Default implementation does nothing.
6689
virtual void wheelEvent( QWheelEvent *e );
90+
%Docstring
91+
Mouse wheel event for overriding. Default implementation does nothing.
92+
%End
6793

68-
//! Key event for overriding. Default implementation does nothing.
6994
virtual void keyPressEvent( QKeyEvent *e );
95+
%Docstring
96+
Key event for overriding. Default implementation does nothing.
97+
%End
7098

71-
//! Key event for overriding. Default implementation does nothing.
7299
virtual void keyReleaseEvent( QKeyEvent *e );
100+
%Docstring
101+
Key event for overriding. Default implementation does nothing.
102+
%End
73103

74-
//! gesture event for overriding. Default implementation does nothing.
75104
virtual bool gestureEvent( QGestureEvent *e );
105+
%Docstring
106+
gesture event for overriding. Default implementation does nothing.
107+
:rtype: bool
108+
%End
76109

77-
/** Use this to associate a QAction to this maptool. Then when the setMapTool
78-
* method of mapcanvas is called the action state will be set to on.
79-
* Usually this will cause e.g. a toolbutton to appear pressed in and
80-
* the previously used toolbutton to pop out. */
81110
void setAction( QAction *action );
111+
%Docstring
112+
Use this to associate a QAction to this maptool. Then when the setMapTool
113+
method of mapcanvas is called the action state will be set to on.
114+
Usually this will cause e.g. a toolbutton to appear pressed in and
115+
the previously used toolbutton to pop out. *
116+
%End
82117

83-
/** Return associated action with map tool or NULL if no action is associated */
84118
QAction *action();
119+
%Docstring
120+
Return associated action with map tool or NULL if no action is associated
121+
:rtype: QAction
122+
%End
85123

86-
/** Use this to associate a button to this maptool. It has the same meaning
87-
* as setAction() function except it works with a button instead of an QAction. */
88124
void setButton( QAbstractButton *button );
125+
%Docstring
126+
Use this to associate a button to this maptool. It has the same meaning
127+
as setAction() function except it works with a button instead of an QAction. *
128+
%End
89129

90-
/** Return associated button with map tool or NULL if no button is associated */
91130
QAbstractButton *button();
131+
%Docstring
132+
Return associated button with map tool or NULL if no button is associated
133+
:rtype: QAbstractButton
134+
%End
92135

93-
/** Set a user defined cursor */
94136
virtual void setCursor( const QCursor &cursor );
137+
%Docstring
138+
Set a user defined cursor
139+
%End
95140

96-
//! called when set as currently active map tool
97141
virtual void activate();
142+
%Docstring
143+
called when set as currently active map tool
144+
%End
98145

99-
//! called when map tool is being deactivated
100146
virtual void deactivate();
147+
%Docstring
148+
called when map tool is being deactivated
149+
%End
101150

102-
//! returns pointer to the tool's map canvas
103151
QgsMapCanvas *canvas();
152+
%Docstring
153+
returns pointer to the tool's map canvas
154+
:rtype: QgsMapCanvas
155+
%End
104156

105-
//! Emit map tool changed with the old tool
106-
//! @note added in 2.3
107157
QString toolName();
158+
%Docstring
159+
.. versionadded:: 2.3
160+
:rtype: str
161+
%End
108162

109-
/** Get search radius in mm. Used by identify, tip etc.
110-
* The values is currently set in identify tool options (move somewhere else?)
111-
* and defaults to Qgis::DEFAULT_SEARCH_RADIUS_MM.
112-
* @note added in 2.3 */
113163
static double searchRadiusMM();
164+
%Docstring
165+
Get search radius in mm. Used by identify, tip etc.
166+
The values is currently set in identify tool options (move somewhere else?)
167+
and defaults to Qgis.DEFAULT_SEARCH_RADIUS_MM.
168+
.. versionadded:: 2.3
169+
:rtype: float
170+
%End
114171

115-
/** Get search radius in map units for given context. Used by identify, tip etc.
116-
* The values is calculated from searchRadiusMM().
117-
* @note added in 2.3 */
118172
static double searchRadiusMU( const QgsRenderContext &context );
173+
%Docstring
174+
Get search radius in map units for given context. Used by identify, tip etc.
175+
The values is calculated from searchRadiusMM().
176+
.. versionadded:: 2.3
177+
:rtype: float
178+
%End
119179

120-
/** Get search radius in map units for given canvas. Used by identify, tip etc.
121-
* The values is calculated from searchRadiusMM().
122-
* @note added in 2.3 */
123180
static double searchRadiusMU( QgsMapCanvas *canvas );
181+
%Docstring
182+
Get search radius in map units for given canvas. Used by identify, tip etc.
183+
The values is calculated from searchRadiusMM().
184+
.. versionadded:: 2.3
185+
:rtype: float
186+
%End
124187

125188
signals:
126-
//! emit a message
127189
void messageEmitted( const QString &message, QgsMessageBar::MessageLevel = QgsMessageBar::INFO );
190+
%Docstring
191+
emit a message
192+
%End
128193

129-
//! emit signal to clear previous message
130194
void messageDiscarded();
195+
%Docstring
196+
emit signal to clear previous message
197+
%End
131198

132-
//! signal emitted once the map tool is activated
133199
void activated();
200+
%Docstring
201+
signal emitted once the map tool is activated
202+
%End
134203

135-
//! signal emitted once the map tool is deactivated
136204
void deactivated();
205+
%Docstring
206+
signal emitted once the map tool is deactivated
207+
%End
137208

138209
protected:
139210

140-
//! constructor takes map canvas as a parameter
141211
QgsMapTool( QgsMapCanvas *canvas /TransferThis/ );
212+
%Docstring
213+
constructor takes map canvas as a parameter
214+
%End
142215

143-
//! transformation from screen coordinates to map coordinates
144216
QgsPointXY toMapCoordinates( QPoint point );
217+
%Docstring
218+
transformation from screen coordinates to map coordinates
219+
:rtype: QgsPointXY
220+
%End
145221

146-
//! transformation from screen coordinates to layer's coordinates
147222
QgsPointXY toLayerCoordinates( const QgsMapLayer *layer, QPoint point );
223+
%Docstring
224+
transformation from screen coordinates to layer's coordinates
225+
:rtype: QgsPointXY
226+
%End
148227

149-
//! transformation from map coordinates to layer's coordinates
150228
QgsPointXY toLayerCoordinates( const QgsMapLayer *layer, const QgsPointXY &point );
229+
%Docstring
230+
transformation from map coordinates to layer's coordinates
231+
:rtype: QgsPointXY
232+
%End
151233

152-
//!transformation from layer's coordinates to map coordinates (which is different in case reprojection is used)
153234
QgsPointXY toMapCoordinates( const QgsMapLayer *layer, const QgsPointXY &point );
235+
%Docstring
236+
transformation from layer's coordinates to map coordinates (which is different in case reprojection is used)
237+
:rtype: QgsPointXY
238+
%End
154239

155-
//!transformation from layer's coordinates to map coordinates (which is different in case reprojection is used)
156-
//! @note available in python bindings as toMapCoordinatesV2
157240
QgsPoint toMapCoordinates( const QgsMapLayer *layer, const QgsPoint &point ) /PyName=toMapCoordinatesV2/;
241+
%Docstring
242+
.. note::
243+
244+
available in Python bindings as toMapCoordinatesV2
245+
:rtype: QgsPoint
246+
%End
158247

159-
//! trnasformation of the rect from map coordinates to layer's coordinates
160248
QgsRectangle toLayerCoordinates( const QgsMapLayer *layer, const QgsRectangle &rect );
249+
%Docstring
250+
trnasformation of the rect from map coordinates to layer's coordinates
251+
:rtype: QgsRectangle
252+
%End
161253

162-
//! transformation from map coordinates to screen coordinates
163254
QPoint toCanvasCoordinates( const QgsPointXY &point );
255+
%Docstring
256+
transformation from map coordinates to screen coordinates
257+
:rtype: QPoint
258+
%End
164259

165260

166-
};
167261

168262

263+
264+
265+
};
266+
169267
QFlags<QgsMapTool::Flag> operator|(QgsMapTool::Flag f1, QFlags<QgsMapTool::Flag> f2);
268+
269+
270+
/************************************************************************
271+
* This file has been generated automatically from *
272+
* *
273+
* src/gui/qgsmaptool.h *
274+
* *
275+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
276+
************************************************************************/
Lines changed: 100 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,135 @@
1-
/***************************************************************************
2-
qgsmaptooladvanceddigitizing.h - map tool with event in map coordinates
3-
----------------------
4-
begin : October 2014
5-
copyright : (C) Denis Rouzaud
6-
email : denis.rouzaud@gmail.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-
* @brief The QgsMapToolAdvancedDigitizing class is a QgsMapTool which gives event directly in map coordinates and allows filtering its events.
18-
* Events from QgsMapTool are caught and their QMouseEvent are transformed into QgsMapMouseEvent (with map coordinates).
19-
* Events are then forwarded to corresponding virtual methods which can be reimplemented in subclasses.
20-
* An event filter can be set on the map tool to filter and modify the events in map coordinates (@see QgsMapToolMapEventFilter).
21-
* @note at the moment, the event filter is used by the CAD tools (@see QgsCadDocWidget).
22-
* @note the event filter definition is not exposed in python API to avoid any unexpected behavior.
23-
*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptooladvanceddigitizing.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
2413
class QgsMapToolAdvancedDigitizing : QgsMapToolEdit
2514
{
15+
%Docstring
16+
The QgsMapToolAdvancedDigitizing class is a QgsMapTool which gives event directly in map coordinates and allows filtering its events.
17+
Events from QgsMapTool are caught and their QMouseEvent are transformed into QgsMapMouseEvent (with map coordinates).
18+
Events are then forwarded to corresponding virtual methods which can be reimplemented in subclasses.
19+
.. seealso:: QgsMapToolMapEventFilter).
20+
.. seealso:: QgsCadDocWidget).
21+
.. note::
22+
23+
the event filter definition is not exposed in Python API to avoid any unexpected behavior.
24+
%End
25+
2626
%TypeHeaderCode
2727
#include "qgsmaptooladvanceddigitizing.h"
2828
%End
2929
public:
30-
//! Different capture modes
3130
enum CaptureMode
3231
{
33-
CaptureNone, //!< Do not capture
34-
CapturePoint, //!< Capture points
35-
CaptureSegment, //!< Capture a segment (i.e. 2 points)
36-
CaptureLine, //!< Capture lines
37-
CapturePolygon //!< Capture polygons
32+
CaptureNone,
33+
CapturePoint,
34+
CaptureSegment,
35+
CaptureLine,
36+
CapturePolygon
3837
};
3938

40-
/**
41-
* Creates an advanced digitizing maptool
42-
* @param canvas The map canvas on which the tool works
43-
* @param cadDockWidget The cad dock widget which will be used to adjust mouse events
44-
*/
4539
explicit QgsMapToolAdvancedDigitizing( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
40+
%Docstring
41+
Creates an advanced digitizing maptool
42+
\param canvas The map canvas on which the tool works
43+
\param cadDockWidget The cad dock widget which will be used to adjust mouse events
44+
%End
4645

47-
~QgsMapToolAdvancedDigitizing();
48-
49-
//! catch the mouse press event, filters it, transforms it to map coordinates and send it to virtual method
5046
virtual void canvasPressEvent( QgsMapMouseEvent *e );
51-
//! catch the mouse release event, filters it, transforms it to map coordinates and send it to virtual method
47+
%Docstring
48+
Catch the mouse press event, filters it, transforms it to map coordinates and send it to virtual method
49+
%End
5250
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
53-
//! catch the mouse move event, filters it, transforms it to map coordinates and send it to virtual method
51+
%Docstring
52+
Catch the mouse release event, filters it, transforms it to map coordinates and send it to virtual method
53+
%End
5454
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
55+
%Docstring
56+
Catch the mouse move event, filters it, transforms it to map coordinates and send it to virtual method
57+
%End
5558

56-
/**
57-
* The capture mode
58-
*
59-
* @return Capture mode
60-
*/
6159
CaptureMode mode() const;
60+
%Docstring
61+
The capture mode
62+
63+
:return: Capture mode
64+
:rtype: CaptureMode
65+
%End
6266

63-
/**
64-
* Set capture mode. This should correspond to the layer on which the digitizing
65-
* happens.
66-
*
67-
* @param mode Capture Mode
68-
*/
6967
void setMode( CaptureMode mode );
68+
%Docstring
69+
Set capture mode. This should correspond to the layer on which the digitizing
70+
happens.
71+
72+
\param mode Capture Mode
73+
%End
7074

71-
/**
72-
* Registers this maptool with the cad dock widget
73-
*/
7475
virtual void activate();
76+
%Docstring
77+
Registers this maptool with the cad dock widget
78+
%End
7579

76-
/**
77-
* Unregisters this maptool from the cad dock widget
78-
*/
7980
virtual void deactivate();
81+
%Docstring
82+
Unregisters this maptool from the cad dock widget
83+
%End
8084

8185
QgsAdvancedDigitizingDockWidget *cadDockWidget() const;
86+
%Docstring
87+
:rtype: QgsAdvancedDigitizingDockWidget
88+
%End
89+
8290

8391
protected:
84-
/**
85-
* Override this method when subclassing this class.
86-
* This will receive adapted events from the cad system whenever a
87-
* canvasPressEvent is triggered and it's not hidden by the cad's
88-
* construction mode.
89-
*
90-
* @param e Mouse events prepared by the cad system
91-
*/
92+
9293
virtual void cadCanvasPressEvent( QgsMapMouseEvent *e );
94+
%Docstring
95+
Override this method when subclassing this class.
96+
This will receive adapted events from the cad system whenever a
97+
canvasPressEvent is triggered and it's not hidden by the cad's
98+
construction mode.
99+
100+
\param e Mouse events prepared by the cad system
101+
%End
93102

94103

95-
/**
96-
* Override this method when subclassing this class.
97-
* This will receive adapted events from the cad system whenever a
98-
* canvasReleaseEvent is triggered and it's not hidden by the cad's
99-
* construction mode.
100-
*
101-
* @param e Mouse events prepared by the cad system
102-
*/
103104
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent *e );
105+
%Docstring
106+
Override this method when subclassing this class.
107+
This will receive adapted events from the cad system whenever a
108+
canvasReleaseEvent is triggered and it's not hidden by the cad's
109+
construction mode.
110+
111+
\param e Mouse events prepared by the cad system
112+
%End
104113

105114

106-
/**
107-
* Override this method when subclassing this class.
108-
* This will receive adapted events from the cad system whenever a
109-
* canvasMoveEvent is triggered and it's not hidden by the cad's
110-
* construction mode.
111-
*
112-
* @param e Mouse events prepared by the cad system
113-
*/
114115
virtual void cadCanvasMoveEvent( QgsMapMouseEvent *e );
116+
%Docstring
117+
Override this method when subclassing this class.
118+
This will receive adapted events from the cad system whenever a
119+
canvasMoveEvent is triggered and it's not hidden by the cad's
120+
construction mode.
121+
122+
\param e Mouse events prepared by the cad system
123+
%End
124+
125+
126+
115127
};
128+
129+
/************************************************************************
130+
* This file has been generated automatically from *
131+
* *
132+
* src/gui/qgsmaptooladvanceddigitizing.h *
133+
* *
134+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
135+
************************************************************************/

‎python/gui/qgsmaptoolcapture.sip

Lines changed: 98 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,149 @@
1-
/***************************************************************************
2-
qgsmaptoolcapture.h - map tool for capturing points, lines, polygons
3-
---------------------
4-
begin : January 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-
class QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptoolcapture.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
class QgsMapToolCapture : QgsMapToolAdvancedDigitizing
1715
{
16+
1817
%TypeHeaderCode
1918
#include "qgsmaptoolcapture.h"
2019
%End
2120
public:
22-
//! constructor
2321
QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode = CaptureNone );
22+
%Docstring
23+
constructor
24+
%End
2425

25-
//! destructor
2626
virtual ~QgsMapToolCapture();
2727

28-
//! active the tool
2928
virtual void activate();
30-
31-
//! deactive the tool
3229
virtual void deactivate();
3330

34-
/** Adds a whole curve (e.g. circularstring) to the captured geometry. Curve must be in map CRS*/
3531
int addCurve( QgsCurve *c );
32+
%Docstring
33+
Adds a whole curve (e.g. circularstring) to the captured geometry. Curve must be in map CRS
34+
:rtype: int
35+
%End
3636

37-
/**
38-
* Get the capture curve
39-
*
40-
* @return Capture curve
41-
*/
4237
const QgsCompoundCurve *captureCurve() const;
38+
%Docstring
39+
Get the capture curve
4340

41+
:return: Capture curve
42+
:rtype: QgsCompoundCurve
43+
%End
4444

45-
/**
46-
* Update the rubberband according to mouse position
47-
*
48-
* @param e The mouse event
49-
*/
5045
virtual void cadCanvasMoveEvent( QgsMapMouseEvent *e );
5146

52-
/**
53-
* Intercept key events like Esc or Del to delete the last point
54-
* @param e key event
55-
*/
5647
virtual void keyPressEvent( QKeyEvent *e );
48+
%Docstring
49+
Intercept key events like Esc or Del to delete the last point
50+
\param e key event
51+
%End
5752

58-
/**
59-
* Clean a temporary rubberband
60-
*/
61-
void deleteTempRubberBand();
62-
63-
private slots:
64-
void validationFinished();
65-
void currentLayerChanged( QgsMapLayer *layer );
66-
void addError( QgsGeometry::Error );
53+
virtual bool eventFilter( QObject *obj, QEvent *e );
6754

55+
void deleteTempRubberBand();
56+
%Docstring
57+
Clean a temporary rubberband
58+
%End
6859

6960
protected:
7061

71-
/** Converts a map point to layer coordinates
72-
* @param mapPoint the point in map coordinates
73-
* @param[in,out] layerPoint the point in layer coordinates
74-
* @return
75-
* 0 in case of success
76-
* 1 if the current layer is null or not a vector layer
77-
* 2 if the transformation failed
78-
*/
7962
int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint );
63+
%Docstring
64+
:rtype: int
65+
%End
8066

81-
/** Converts a point to map coordinates and layer coordinates
82-
* @param p the input point
83-
* @param[in,out] layerPoint the point in layer coordinates
84-
* @param[in,out] mapPoint the point in map coordinates
85-
* @return
86-
* 0 in case of success
87-
* 1 if the current layer is null or not a vector layer
88-
* 2 if the transformation failed
89-
*/
9067
int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint );
68+
%Docstring
69+
:rtype: int
70+
%End
9171

92-
/** Fetches the original point from the source layer if it has the same
93-
* CRS as the current layer.
94-
* @return 0 in case of success, 1 if not applicable (CRS mismatch), 2 in case of failure
95-
* @note added in 2.14
96-
*/
9772
int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint );
73+
%Docstring
74+
:rtype: int
75+
%End
9876

99-
/** Adds a point to the rubber band (in map coordinates) and to the capture list (in layer coordinates)
100-
* @return 0 in case of success, 1 if current layer is not a vector layer, 2 if coordinate transformation failed
101-
*/
10277
int addVertex( const QgsPointXY &point );
78+
%Docstring
79+
:rtype: int
80+
%End
10381

104-
/** Variant to supply more information in the case of snapping
105-
* @param mapPoint The vertex to add in map coordinates
106-
* @param match Data about the snapping match. Can be an invalid match, if point not snapped.
107-
* @note added in 2.14
108-
*/
10982
int addVertex( const QgsPointXY &mapPoint, const QgsPointLocator::Match &match );
83+
%Docstring
84+
Variant to supply more information in the case of snapping
85+
\param mapPoint The vertex to add in map coordinates
86+
\param match Data about the snapping match. Can be an invalid match, if point not snapped.
87+
.. versionadded:: 2.14
88+
:rtype: int
89+
%End
11090

111-
/** Removes the last vertex from mRubberBand and mCaptureList*/
11291
void undo();
92+
%Docstring
93+
Removes the last vertex from mRubberBand and mCaptureList
94+
%End
11395

114-
/**
115-
* Start capturing
116-
*/
11796
void startCapturing();
97+
%Docstring
98+
Start capturing
99+
%End
118100

119-
/**
120-
* Are we currently capturing?
121-
*
122-
* @return Is the tool in capture mode?
123-
*/
124101
bool isCapturing() const;
102+
%Docstring
103+
Are we currently capturing?
104+
105+
:return: Is the tool in capture mode?
106+
:rtype: bool
107+
%End
125108

126-
/**
127-
* Stop capturing
128-
*/
129109
void stopCapturing();
110+
%Docstring
111+
Stop capturing
112+
%End
130113

131-
/**
132-
* Number of points digitized
133-
*
134-
* @return Number of points
135-
*/
136114
int size();
115+
%Docstring
116+
Number of points digitized
117+
118+
:return: Number of points
119+
:rtype: int
120+
%End
137121

138-
/**
139-
* List of digitized points
140-
* @return List of points
141-
*/
142122
QList<QgsPointXY> points();
123+
%Docstring
124+
List of digitized points
125+
:return: List of points
126+
:rtype: list of QgsPointXY
127+
%End
143128

144-
/**
145-
* Set the points on which to work
146-
*
147-
* @param pointList A list of points
148-
*/
149129
void setPoints( const QList<QgsPointXY> &pointList );
130+
%Docstring
131+
Set the points on which to work
132+
133+
\param pointList A list of points
134+
%End
150135

151-
/**
152-
* Close an open polygon
153-
*/
154136
void closePolygon();
137+
%Docstring
138+
Close an open polygon
139+
%End
140+
155141
};
142+
143+
/************************************************************************
144+
* This file has been generated automatically from *
145+
* *
146+
* src/gui/qgsmaptoolcapture.h *
147+
* *
148+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
149+
************************************************************************/

‎python/gui/qgsmaptooledit.sip

Lines changed: 68 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,96 @@
1-
/***************************************************************************
2-
qgsmaptooledit.h - base class for editing map tools
3-
---------------------
4-
begin : Juli 2007
5-
copyright : (C) 2007 by Marco Hugentobler
6-
email : marco dot hugentobler at karto dot baug dot ethz dot ch
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-
/** Base class for map tools that edit vector geometry*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptooledit.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
1812
class QgsMapToolEdit: QgsMapTool
1913
{
14+
%Docstring
15+
Base class for map tools that edit vector geometry
16+
%End
17+
2018
%TypeHeaderCode
2119
#include "qgsmaptooledit.h"
2220
%End
23-
2421
public:
2522
QgsMapToolEdit( QgsMapCanvas *canvas );
26-
virtual ~QgsMapToolEdit();
2723

2824
virtual Flags flags() const;
2925

3026
double defaultZValue() const;
27+
%Docstring
28+
Return default Z value
29+
Use for set Z coordinate to new vertex for 2.5d geometries
30+
:rtype: float
31+
%End
32+
3133
protected:
3234

3335
static QColor digitizingStrokeColor();
36+
%Docstring
37+
Returns stroke color for rubber bands (from global settings)
38+
:rtype: QColor
39+
%End
3440
static int digitizingStrokeWidth();
41+
%Docstring
42+
Returns stroke width for rubber bands (from global settings)
43+
:rtype: int
44+
%End
3545
static QColor digitizingFillColor();
46+
%Docstring
47+
Returns fill color for rubber bands (from global settings)
48+
:rtype: QColor
49+
%End
3650

37-
/** Creates a rubber band with the color/line width from
38-
* the QGIS settings. The caller takes ownership of the
39-
* returned object
40-
* @param geometryType
41-
* @param alternativeBand if true, rubber band will be set with more transparency and a dash pattern. defaut is false.
42-
*/
4351
QgsRubberBand *createRubberBand( QgsWkbTypes::GeometryType geometryType = QgsWkbTypes::LineGeometry, bool alternativeBand = false ) /Factory/;
52+
%Docstring
53+
Creates a rubber band with the color/line width from
54+
the QGIS settings. The caller takes ownership of the
55+
returned object
56+
\param geometryType
57+
\param alternativeBand if true, rubber band will be set with more transparency and a dash pattern. defaut is false.
58+
:rtype: QgsRubberBand
59+
%End
4460

4561
QgsGeometryRubberBand *createGeometryRubberBand( QgsWkbTypes::GeometryType geometryType = QgsWkbTypes::LineGeometry, bool alternativeBand = false ) const /Factory/;
62+
%Docstring
63+
:rtype: QgsGeometryRubberBand
64+
%End
4665

47-
/** Returns the current vector layer of the map canvas or 0*/
4866
QgsVectorLayer *currentVectorLayer();
67+
%Docstring
68+
Returns the current vector layer of the map canvas or 0
69+
:rtype: QgsVectorLayer
70+
%End
4971

50-
/** Adds vertices to other features to keep topology up to date, e.g. to neighbouring polygons.
51-
* @param geom list of points (in layer coordinate system)
52-
* @return 0 in case of success
53-
*/
5472
int addTopologicalPoints( const QList<QgsPointXY> &geom );
73+
%Docstring
74+
Adds vertices to other features to keep topology up to date, e.g. to neighbouring polygons.
75+
\param geom list of points (in layer coordinate system)
76+
:return: 0 in case of success
77+
:rtype: int
78+
%End
5579

56-
/** Display a timed message bar noting the active layer is not vector. */
5780
void notifyNotVectorLayer();
58-
/** Display a timed message bar noting the active vector layer is not editable. */
81+
%Docstring
82+
Display a timed message bar noting the active layer is not vector.
83+
%End
5984
void notifyNotEditableLayer();
85+
%Docstring
86+
Display a timed message bar noting the active vector layer is not editable.
87+
%End
6088
};
89+
90+
/************************************************************************
91+
* This file has been generated automatically from *
92+
* *
93+
* src/gui/qgsmaptooledit.h *
94+
* *
95+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
96+
************************************************************************/

‎python/gui/qgsmaptoolemitpoint.sip

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptoolemitpoint.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
111

212
class QgsMapToolEmitPoint : QgsMapTool
313
{
4-
%TypeHeaderCode
5-
#include <qgsmaptoolemitpoint.h>
14+
%Docstring
15+
A map tool that simply emits a point when clicking on the map.
16+
Connecting a slot to its canvasClicked() signal will
17+
let you implement custom behavior for the passed in point.
618
%End
719

20+
%TypeHeaderCode
21+
#include "qgsmaptoolemitpoint.h"
22+
%End
823
public:
9-
//! constructor
1024
QgsMapToolEmitPoint( QgsMapCanvas *canvas );
25+
%Docstring
26+
constructor
27+
%End
1128

1229
virtual Flags flags() const;
13-
14-
//! Overridden mouse move event
1530
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
16-
17-
//! Overridden mouse press event - emits the signal
1831
virtual void canvasPressEvent( QgsMapMouseEvent *e );
19-
20-
//! Overridden mouse release event
2132
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
2233

2334
signals:
24-
//! signal emitted on canvas click
2535
void canvasClicked( const QgsPointXY &point, Qt::MouseButton button );
36+
%Docstring
37+
signal emitted on canvas click
38+
%End
2639
};
40+
41+
/************************************************************************
42+
* This file has been generated automatically from *
43+
* *
44+
* src/gui/qgsmaptoolemitpoint.h *
45+
* *
46+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
47+
************************************************************************/

‎python/gui/qgsmaptoolidentify.sip

Lines changed: 91 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptoolidentify.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
113
class QgsMapToolIdentify : QgsMapTool
214
{
3-
%TypeHeaderCode
4-
#include <qgsmaptoolidentify.h>
15+
%Docstring
16+
Map tool for identifying features in layers
17+
18+
after selecting a point, performs the identification:
19+
- for raster layers shows value of underlying pixel
20+
- for vector layers shows feature attributes within search radius
21+
(allows editing values when vector layer is in editing mode)
522
%End
623

24+
%TypeHeaderCode
25+
#include "qgsmaptoolidentify.h"
26+
%End
727
public:
828

929
enum IdentifyMode
@@ -23,16 +43,14 @@ class QgsMapToolIdentify : QgsMapTool
2343
};
2444
typedef QFlags<QgsMapToolIdentify::Type> LayerType;
2545

46+
2647
struct IdentifyResult
2748
{
2849
IdentifyResult();
2950

3051
IdentifyResult( QgsMapLayer *layer, const QgsFeature &feature, const QMap< QString, QString > &derivedAttributes );
31-
3252
IdentifyResult( QgsMapLayer *layer, const QString &label, const QMap< QString, QString > &attributes, const QMap< QString, QString > &derivedAttributes );
33-
3453
IdentifyResult( QgsMapLayer *layer, const QString &label, const QgsFields &fields, const QgsFeature &feature, const QMap< QString, QString > &derivedAttributes );
35-
3654
QgsMapLayer *mLayer;
3755
QString mLabel;
3856
QgsFields mFields;
@@ -42,85 +60,99 @@ class QgsMapToolIdentify : QgsMapTool
4260
QMap< QString, QVariant > mParams;
4361
};
4462

45-
//! constructor
4663
QgsMapToolIdentify( QgsMapCanvas *canvas );
64+
%Docstring
65+
constructor
66+
%End
4767

4868
virtual ~QgsMapToolIdentify();
4969

5070
virtual Flags flags() const;
51-
52-
//! Overridden mouse move event
5371
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
54-
55-
//! Overridden mouse press event
5672
virtual void canvasPressEvent( QgsMapMouseEvent *e );
57-
58-
//! Overridden mouse release event
5973
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
60-
6174
virtual void activate();
62-
6375
virtual void deactivate();
6476

65-
/** Performs the identification.
66-
@param x x coordinates of mouseEvent
67-
@param y y coordinates of mouseEvent
68-
@param layerList Performs the identification within the given list of layers. Default value is an empty list, i.e. uses all the layers.
69-
@param mode Identification mode. Can use Qgis default settings or a defined mode. Default mode is DefaultQgsSetting.
70-
@return a list of IdentifyResult*/
71-
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, const QList<QgsMapLayer*> &layerList = QList<QgsMapLayer*>(), IdentifyMode mode = DefaultQgsSetting );
72-
73-
/** Performs the identification.
74-
To avoid being forced to specify IdentifyMode with a list of layers
75-
this has been made private and two publics methods are offered
76-
@param x x coordinates of mouseEvent
77-
@param y y coordinates of mouseEvent
78-
@param mode Identification mode. Can use Qgis default settings or a defined mode.
79-
@param layerType Only performs identification in a certain type of layers (raster, vector). Default value is AllLayers.
80-
@return a list of IdentifyResult*/
77+
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, const QList<QgsMapLayer *> &layerList = QList<QgsMapLayer *>(), IdentifyMode mode = DefaultQgsSetting );
78+
%Docstring
79+
Performs the identification.
80+
\param x x coordinates of mouseEvent
81+
\param y y coordinates of mouseEvent
82+
\param layerList Performs the identification within the given list of layers. Default value is an empty list, i.e. uses all the layers.
83+
\param mode Identification mode. Can use Qgis default settings or a defined mode. Default mode is DefaultQgsSetting.
84+
:return: a list of IdentifyResult*
85+
:rtype: list of QgsMapToolIdentify.IdentifyResult
86+
%End
87+
8188
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, IdentifyMode mode, LayerType layerType = AllLayers );
89+
%Docstring
90+
Performs the identification.
91+
To avoid being forced to specify IdentifyMode with a list of layers
92+
this has been made private and two publics methods are offered
93+
\param x x coordinates of mouseEvent
94+
\param y y coordinates of mouseEvent
95+
\param mode Identification mode. Can use Qgis default settings or a defined mode.
96+
\param layerType Only performs identification in a certain type of layers (raster, vector). Default value is AllLayers.
97+
:return: a list of IdentifyResult*
98+
:rtype: list of QgsMapToolIdentify.IdentifyResult
99+
%End
82100

83-
//! return a pointer to the identify menu which will be used in layer selection mode
84-
//! this menu can also be customized
85101
QgsIdentifyMenu *identifyMenu();
102+
%Docstring
103+
this menu can also be customized
104+
:rtype: QgsIdentifyMenu
105+
%End
86106

87107
public slots:
88108
void formatChanged( QgsRasterLayer *layer );
89109

90110
signals:
91111
void identifyProgress( int, int );
92-
void identifyMessage( const QString& );
93-
void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult>& );
112+
void identifyMessage( const QString & );
113+
void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult> & );
94114

95115
protected:
96-
/** Performs the identification.
97-
To avoid being forced to specify IdentifyMode with a list of layers
98-
this has been made private and two publics methods are offered
99-
@param x x coordinates of mouseEvent
100-
@param y y coordinates of mouseEvent
101-
@param mode Identification mode. Can use Qgis default settings or a defined mode.
102-
@param layerList Performs the identification within the given list of layers.
103-
@param layerType Only performs identification in a certain type of layers (raster, vector).
104-
@return a list of IdentifyResult*/
105-
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, IdentifyMode mode, const QList<QgsMapLayer*> &layerList, LayerType layerType = AllLayers );
106-
107-
/** Call the right method depending on layer type */
108-
bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsMapLayer *layer, const QgsPointXY &point, const QgsRectangle &viewExtent, double mapUnitsPerPixel, LayerType layerType = AllLayers );
116+
117+
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, IdentifyMode mode, const QList<QgsMapLayer *> &layerList, LayerType layerType = AllLayers );
118+
%Docstring
119+
Performs the identification.
120+
To avoid being forced to specify IdentifyMode with a list of layers
121+
this has been made private and two publics methods are offered
122+
\param x x coordinates of mouseEvent
123+
\param y y coordinates of mouseEvent
124+
\param mode Identification mode. Can use Qgis default settings or a defined mode.
125+
\param layerList Performs the identification within the given list of layers.
126+
\param layerType Only performs identification in a certain type of layers (raster, vector).
127+
:return: a list of IdentifyResult*
128+
:rtype: list of QgsMapToolIdentify.IdentifyResult
129+
%End
130+
131+
132+
bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsMapLayer *layer, const QgsPointXY &point, const QgsRectangle &viewExtent, double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
133+
%Docstring
134+
Call the right method depending on layer type
135+
:rtype: bool
136+
%End
109137

110138
bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsRasterLayer *layer, QgsPointXY point, const QgsRectangle &viewExtent, double mapUnitsPerPixel );
139+
%Docstring
140+
:rtype: bool
141+
%End
111142
bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsVectorLayer *layer, const QgsPointXY &point );
143+
%Docstring
144+
:rtype: bool
145+
%End
146+
147+
};
112148

113-
private:
149+
QFlags<QgsMapToolIdentify::Type> operator|(QgsMapToolIdentify::Type f1, QFlags<QgsMapToolIdentify::Type> f2);
114150

115-
/** Desired units for distance display.
116-
* @note added in QGIS 2.14
117-
* @see displayAreaUnits()
118-
*/
119-
virtual QgsUnitTypes::DistanceUnit displayDistanceUnits() const;
120151

121-
/** Desired units for area display.
122-
* @note added in QGIS 2.14
123-
* @see displayDistanceUnits()
124-
*/
125-
virtual QgsUnitTypes::AreaUnit displayAreaUnits() const;
126-
};
152+
/************************************************************************
153+
* This file has been generated automatically from *
154+
* *
155+
* src/gui/qgsmaptoolidentify.h *
156+
* *
157+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
158+
************************************************************************/
Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,53 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptoolidentifyfeature.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
111
class QgsMapToolIdentifyFeature : QgsMapToolIdentify
212
{
3-
%TypeHeaderCode
4-
#include <qgsmaptoolidentifyfeature.h>
13+
%Docstring
14+
The QgsMapToolIdentifyFeature class is a map tool to identify a feature on a chosen layer.
15+
Once the map tool is enable, user can click on the map canvas to identify a feature.
16+
A signal will then be emitted.
517
%End
618

19+
%TypeHeaderCode
20+
#include "qgsmaptoolidentifyfeature.h"
21+
%End
722
public:
8-
/**
9-
* @brief QgsMapToolIdentifyFeature is a map tool to identify a feature on a chosen layer
10-
* @param canvas the map canvas
11-
* @param vl the vector layer. The map tool can be initialized without any layer and can be set afterward.
12-
*/
13-
QgsMapToolIdentifyFeature( QgsMapCanvas *canvas, QgsVectorLayer *vl = 0 );
1423

15-
~QgsMapToolIdentifyFeature();
24+
QgsMapToolIdentifyFeature( QgsMapCanvas *canvas, QgsVectorLayer *vl = 0 );
25+
%Docstring
26+
QgsMapToolIdentifyFeature is a map tool to identify a feature on a chosen layer
27+
\param canvas the map canvas
28+
\param vl the vector layer. The map tool can be initialized without any layer and can be set afterward.
29+
%End
1630

17-
//! change the layer used by the map tool to identify
1831
void setLayer( QgsVectorLayer *vl );
32+
%Docstring
33+
change the layer used by the map tool to identify
34+
%End
1935

20-
void canvasReleaseEvent( QgsMapMouseEvent *e );
36+
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
2137

2238
signals:
23-
void featureIdentified( QgsFeature );
39+
void featureIdentified( const QgsFeature & );
40+
void featureIdentified( QgsFeatureId );
41+
42+
protected:
43+
virtual void keyPressEvent( QKeyEvent *e );
44+
2445
};
46+
47+
/************************************************************************
48+
* This file has been generated automatically from *
49+
* *
50+
* src/gui/qgsmaptoolidentifyfeature.h *
51+
* *
52+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
53+
************************************************************************/

‎python/gui/qgsmaptoolpan.sip

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,50 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptoolpan.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
111

212
class QgsMapToolPan : QgsMapTool
313
{
4-
%TypeHeaderCode
5-
#include <qgsmaptoolpan.h>
14+
%Docstring
15+
A map tool for panning the map.
16+
.. seealso:: QgsMapTool
617
%End
718

19+
%TypeHeaderCode
20+
#include "qgsmaptoolpan.h"
21+
%End
822
public:
9-
//! constructor
1023
QgsMapToolPan( QgsMapCanvas *canvas );
24+
%Docstring
25+
constructor
26+
%End
27+
~QgsMapToolPan();
1128

12-
virtual Flags flags() const;
29+
virtual void activate();
1330

14-
//! Mouse press event
15-
virtual void canvasPressEvent( QgsMapMouseEvent *e );
31+
virtual void deactivate();
1632

17-
//! Overridden mouse move event
18-
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
1933

20-
//! Overridden mouse release event
34+
virtual Flags flags() const;
35+
virtual void canvasPressEvent( QgsMapMouseEvent *e );
36+
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
2137
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
38+
virtual void canvasDoubleClickEvent( QgsMapMouseEvent *e );
39+
virtual bool gestureEvent( QGestureEvent *e );
40+
2241

2342
};
2443

44+
/************************************************************************
45+
* This file has been generated automatically from *
46+
* *
47+
* src/gui/qgsmaptoolpan.h *
48+
* *
49+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
50+
************************************************************************/

‎python/gui/qgsmaptoolzoom.sip

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,47 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmaptoolzoom.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
111

212
class QgsMapToolZoom : QgsMapTool
313
{
4-
%TypeHeaderCode
5-
#include <qgsmaptoolzoom.h>
14+
%Docstring
15+
A map tool for zooming into the map.
16+
.. seealso:: QgsMapTool
617
%End
718

19+
%TypeHeaderCode
20+
#include "qgsmaptoolzoom.h"
21+
%End
822
public:
9-
//! constructor
1023
QgsMapToolZoom( QgsMapCanvas *canvas, bool zoomOut );
11-
24+
%Docstring
25+
constructor
26+
%End
1227
~QgsMapToolZoom();
1328

1429
virtual Flags flags() const;
15-
16-
//! Overridden mouse move event
1730
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
18-
19-
//! Overridden mouse press event
2031
virtual void canvasPressEvent( QgsMapMouseEvent *e );
21-
22-
//! Overridden mouse release event
2332
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
24-
25-
//! Flag to indicate a map canvas drag operation is taking place
2633
virtual void deactivate();
34+
35+
protected:
36+
37+
38+
2739
};
2840

41+
/************************************************************************
42+
* This file has been generated automatically from *
43+
* *
44+
* src/gui/qgsmaptoolzoom.h *
45+
* *
46+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
47+
************************************************************************/

‎python/gui/qgsmessagebar.sip

Lines changed: 118 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmessagebar.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
114
class QgsMessageBar: QFrame
215
{
3-
%TypeHeaderCode
4-
#include <qgsmessagebar.h>
16+
%Docstring
17+
A bar for displaying non-blocking messages to the user.
518
%End
619

20+
%TypeHeaderCode
21+
#include "qgsmessagebar.h"
22+
%End
723
public:
824
enum MessageLevel
925
{
@@ -14,97 +30,135 @@ class QgsMessageBar: QFrame
1430
};
1531

1632
QgsMessageBar( QWidget *parent /TransferThis/ = 0 );
17-
~QgsMessageBar();
18-
19-
/**
20-
* Display a message item on the bar after hiding the currently visible one
21-
* and putting it in a stack.
22-
* The message bar will take ownership of the item.
23-
*
24-
* @param item Item to display
25-
*/
26-
void pushItem( QgsMessageBarItem *item /Transfer/);
27-
28-
/** Display a widget as a message on the bar after hiding the currently visible one
29-
* and putting it in a stack.
30-
* @param widget message widget to display
31-
* @param level is QgsMessageBar::INFO, WARNING, CRITICAL or SUCCESS
32-
* @param duration timeout duration of message in seconds, 0 value indicates no timeout
33-
*/
33+
34+
void pushItem( QgsMessageBarItem *item /Transfer/ );
35+
%Docstring
36+
Display a message item on the bar after hiding the currently visible one
37+
and putting it in a stack.
38+
The message bar will take ownership of the item.
39+
40+
\param item Item to display
41+
%End
42+
3443
QgsMessageBarItem *pushWidget( QWidget *widget /Transfer/, MessageLevel level = INFO, int duration = 0 );
44+
%Docstring
45+
Display a widget as a message on the bar after hiding the currently visible one
46+
and putting it in a stack.
47+
\param widget message widget to display
48+
\param level is QgsMessageBar.INFO, WARNING, CRITICAL or SUCCESS
49+
\param duration timeout duration of message in seconds, 0 value indicates no timeout
50+
:rtype: QgsMessageBarItem
51+
%End
3552

36-
/** Remove the passed widget from the bar (if previously added),
37-
* then display the next one in the stack if any or hide the bar
38-
* @param item item to remove
39-
* @return true if the widget was removed, false otherwise
40-
*/
4153
bool popWidget( QgsMessageBarItem *item );
54+
%Docstring
55+
Remove the passed widget from the bar (if previously added),
56+
then display the next one in the stack if any or hide the bar
57+
\param item item to remove
58+
:return: true if the widget was removed, false otherwise
59+
:rtype: bool
60+
%End
4261

43-
//! make out a widget containing a message to be displayed on the bar
4462
static QgsMessageBarItem *createMessage( const QString &text, QWidget *parent = 0 ) /Factory/;
45-
//! make out a widget containing title and message to be displayed on the bar
46-
static QgsMessageBarItem *createMessage( const QString &title, const QString &text, QWidget *parent = 0 ) /Factory/;
47-
//! make out a widget containing title and message to be displayed on the bar
63+
%Docstring
64+
make out a widget containing a message to be displayed on the bar
65+
:rtype: QgsMessageBarItem
66+
%End
67+
static QgsMessageBarItem *createMessage( const QString &title, const QString &text, QWidget *parent = 0 ) /Factory/;
68+
%Docstring
69+
make out a widget containing title and message to be displayed on the bar
70+
:rtype: QgsMessageBarItem
71+
%End
4872
static QgsMessageBarItem *createMessage( QWidget *widget, QWidget *parent = 0 ) /Factory/;
73+
%Docstring
74+
make out a widget containing title and message to be displayed on the bar
75+
:rtype: QgsMessageBarItem
76+
%End
4977

50-
//! convenience method for pushing a message to the bar
5178
void pushMessage( const QString &text, MessageLevel level = INFO, int duration = 5 );
52-
//! convenience method for pushing a message with title to the bar
79+
%Docstring
80+
convenience method for pushing a message to the bar
81+
%End
5382
void pushMessage( const QString &title, const QString &text, MessageLevel level = INFO, int duration = 5 );
83+
%Docstring
84+
convenience method for pushing a message with title to the bar
85+
%End
5486

5587
QgsMessageBarItem *currentItem();
88+
%Docstring
89+
:rtype: QgsMessageBarItem
90+
%End
5691

5792
signals:
58-
//! emitted when a message widget is added to the bar
5993
void widgetAdded( QgsMessageBarItem *item );
94+
%Docstring
95+
emitted when a message widget is added to the bar
96+
%End
6097

61-
//! emitted when a message widget was removed from the bar
6298
void widgetRemoved( QgsMessageBarItem *item );
99+
%Docstring
100+
emitted when a message widget was removed from the bar
101+
%End
63102

64103
public slots:
65-
/** Remove the currently displayed widget from the bar and
66-
* display the next in the stack if any or hide the bar.
67-
* @return true if the widget was removed, false otherwise
68-
*/
104+
69105
bool popWidget();
106+
%Docstring
107+
Remove the currently displayed widget from the bar and
108+
display the next in the stack if any or hide the bar.
109+
:return: true if the widget was removed, false otherwise
110+
:rtype: bool
111+
%End
70112

71-
/** Remove all items from the bar's widget list
72-
* @return true if all items were removed, false otherwise
73-
*/
74113
bool clearWidgets();
114+
%Docstring
115+
Remove all items from the bar's widget list
116+
:return: true if all items were removed, false otherwise
117+
:rtype: bool
118+
%End
75119

76-
/**
77-
* Pushes a success message with default timeout to the message bar
78-
* @param title title string for message
79-
* @param message The message to be displayed
80-
* @note added in 2.8
81-
*/
82120
void pushSuccess( const QString &title, const QString &message );
121+
%Docstring
122+
Pushes a success message with default timeout to the message bar
123+
\param title title string for message
124+
\param message The message to be displayed
125+
.. versionadded:: 2.8
126+
%End
83127

84-
/**
85-
* Pushes a information message with default timeout to the message bar
86-
* @param title title string for message
87-
* @param message The message to be displayed
88-
* @note added in 2.8
89-
*/
90128
void pushInfo( const QString &title, const QString &message );
129+
%Docstring
130+
Pushes a information message with default timeout to the message bar
131+
\param title title string for message
132+
\param message The message to be displayed
133+
.. versionadded:: 2.8
134+
%End
91135

92-
/**
93-
* Pushes a warning with default timeout to the message bar
94-
* @param title title string for message
95-
* @param message The message to be displayed
96-
* @note added in 2.8
97-
*/
98136
void pushWarning( const QString &title, const QString &message );
137+
%Docstring
138+
Pushes a warning with default timeout to the message bar
139+
\param title title string for message
140+
\param message The message to be displayed
141+
.. versionadded:: 2.8
142+
%End
99143

100-
/**
101-
* Pushes a critical warning with default timeout to the message bar
102-
* @param title title string for message
103-
* @param message The message to be displayed
104-
* @note added in 2.8
105-
*/
106144
void pushCritical( const QString &title, const QString &message );
145+
%Docstring
146+
Pushes a critical warning with default timeout to the message bar
147+
\param title title string for message
148+
\param message The message to be displayed
149+
.. versionadded:: 2.8
150+
%End
107151

108152
protected:
109-
void mousePressEvent( QMouseEvent *e );
153+
virtual void mousePressEvent( QMouseEvent *e );
154+
155+
110156
};
157+
158+
/************************************************************************
159+
* This file has been generated automatically from *
160+
* *
161+
* src/gui/qgsmessagebar.h *
162+
* *
163+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
164+
************************************************************************/

‎python/gui/qgsmessagebaritem.sip

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,102 @@
1-
class QgsMessageBarItem: QWidget
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmessagebaritem.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
class QgsMessageBarItem : QWidget
213
{
14+
315
%TypeHeaderCode
4-
#include <qgsmessagebaritem.h>
5-
#include <qgsmessagebar.h>
16+
#include "qgsmessagebaritem.h"
617
%End
7-
818
public:
9-
//! make out a widget containing a message to be displayed on the bar
1019
QgsMessageBarItem( const QString &text, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO, int duration = 0, QWidget *parent /TransferThis/ = 0 );
20+
%Docstring
21+
make out a widget containing a message to be displayed on the bar
22+
%End
1123

12-
//! make out a widget containing title and message to be displayed on the bar
1324
QgsMessageBarItem( const QString &title, const QString &text, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO, int duration = 0, QWidget *parent /TransferThis/ = 0 );
25+
%Docstring
26+
make out a widget containing title and message to be displayed on the bar
27+
%End
1428

15-
//! make out a widget containing title, message and widget to be displayed on the bar
1629
QgsMessageBarItem( const QString &title, const QString &text, QWidget *widget, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO, int duration = 0, QWidget *parent /TransferThis/ = 0 );
30+
%Docstring
31+
make out a widget containing title, message and widget to be displayed on the bar
32+
%End
1733

18-
//! make out a widget containing a widget to be displayed on the bar
1934
QgsMessageBarItem( QWidget *widget, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO, int duration = 0, QWidget *parent /TransferThis/ = 0 );
35+
%Docstring
36+
make out a widget containing a widget to be displayed on the bar
37+
%End
2038

2139
QgsMessageBarItem *setText( const QString &text );
40+
%Docstring
41+
:rtype: QgsMessageBarItem
42+
%End
2243

2344
QgsMessageBarItem *setTitle( const QString &title );
45+
%Docstring
46+
:rtype: QgsMessageBarItem
47+
%End
2448

2549
QgsMessageBarItem *setLevel( QgsMessageBar::MessageLevel level );
50+
%Docstring
51+
:rtype: QgsMessageBarItem
52+
%End
2653

2754
QgsMessageBarItem *setWidget( QWidget *widget );
55+
%Docstring
56+
:rtype: QgsMessageBarItem
57+
%End
2858

2959
QgsMessageBarItem *setIcon( const QIcon &icon );
60+
%Docstring
61+
:rtype: QgsMessageBarItem
62+
%End
3063

3164
QgsMessageBarItem *setDuration( int duration );
65+
%Docstring
66+
:rtype: QgsMessageBarItem
67+
%End
3268

33-
//! returns the duration in second of the message
3469
int duration() const;
70+
%Docstring
71+
returns the duration in second of the message
72+
:rtype: int
73+
%End
3574

36-
//! returns the level
3775
QgsMessageBar::MessageLevel level();
76+
%Docstring
77+
returns the level
78+
:rtype: QgsMessageBar.MessageLevel
79+
%End
3880

39-
//! returns the styleSheet
4081
QString getStyleSheet();
82+
%Docstring
83+
returns the styleSheet
84+
:rtype: str
85+
%End
4186

4287
signals:
43-
//! emitted when the message level has changed
4488
void styleChanged( const QString &styleSheet );
89+
%Docstring
90+
emitted when the message level has changed
91+
%End
92+
93+
4594
};
4695

96+
/************************************************************************
97+
* This file has been generated automatically from *
98+
* *
99+
* src/gui/qgsmessagebaritem.h *
100+
* *
101+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
102+
************************************************************************/

‎python/gui/qgsmessageviewer.sip

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsmessageviewer.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
18

2-
class QgsMessageViewer: QDialog, QgsMessageOutput //, Ui::QgsMessageViewer
9+
10+
11+
12+
13+
class QgsMessageViewer: QDialog, QgsMessageOutput
314
{
4-
%TypeHeaderCode
5-
#include <qgsmessageviewer.h>
15+
%Docstring
16+
A generic message view for displaying QGIS messages.
617
%End
718

19+
%TypeHeaderCode
20+
#include "qgsmessageviewer.h"
21+
%End
822
public:
9-
QgsMessageViewer( QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags &fl = QgsGuiUtils::ModalDialogFlags );
23+
QgsMessageViewer( QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, bool deleteOnClose = true );
1024
~QgsMessageViewer();
1125

1226
virtual void setMessage( const QString &message, MessageType msgType );
@@ -17,25 +31,24 @@ class QgsMessageViewer: QDialog, QgsMessageOutput //, Ui::QgsMessageViewer
1731

1832
virtual void setTitle( const QString &title );
1933

20-
// Call one of the setMessage...() functions first.
21-
// Subsequent calls to appendMessage use the format as determined
22-
// by the call to setMessage...()
2334

24-
// Treats the given text as html.
2535
void setMessageAsHtml( const QString &msg );
26-
// Treats the given text as plain text
2736
void setMessageAsPlainText( const QString &msg );
28-
// A checkbox that can be used for something like
29-
// "don't show this message again"
3037
void setCheckBoxText( const QString &text );
31-
// Make the check box visible/invisible
3238
void setCheckBoxVisible( bool visible );
33-
// Sets the check state
3439
void setCheckBoxState( Qt::CheckState state );
35-
// Get checkbox state
3640
Qt::CheckState checkBoxState();
37-
// Specifies a QgsSettings tag to store/retrieve the checkbox
38-
// state to/from. Use an empty QString to disable this feature.
41+
%Docstring
42+
:rtype: Qt.CheckState
43+
%End
3944
void setCheckBoxQgsSettingsLabel( const QString &label );
45+
4046
};
4147

48+
/************************************************************************
49+
* This file has been generated automatically from *
50+
* *
51+
* src/gui/qgsmessageviewer.h *
52+
* *
53+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
54+
************************************************************************/
Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
1-
/** Dialog to set up parameters to create a new GeoPackage layer, and on accept() to create it and add it to the layers */
2-
class QgsNewGeoPackageLayerDialog : QDialog
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsnewgeopackagelayerdialog.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
class QgsNewGeoPackageLayerDialog: QDialog
313
{
4-
%TypeHeaderCode
5-
#include <qgsnewgeopackagelayerdialog.h>
14+
%Docstring
15+
Dialog to set up parameters to create a new GeoPackage layer, and on accept() to create it and add it to the layers *
616
%End
717

18+
%TypeHeaderCode
19+
#include "qgsnewgeopackagelayerdialog.h"
20+
%End
821
public:
9-
/** Constructor */
10-
QgsNewGeoPackageLayerDialog( QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags &fl = QgsGuiUtils::ModalDialogFlags );
11-
22+
QgsNewGeoPackageLayerDialog( QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
23+
%Docstring
24+
Constructor
25+
%End
1226
~QgsNewGeoPackageLayerDialog();
1327

1428
void setCrs( const QgsCoordinateReferenceSystem &crs );
29+
%Docstring
30+
Sets the ``crs`` value for the new layer in the dialog.
31+
.. versionadded:: 3.0
32+
%End
33+
1534
};
35+
36+
/************************************************************************
37+
* This file has been generated automatically from *
38+
* *
39+
* src/gui/qgsnewgeopackagelayerdialog.h *
40+
* *
41+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
42+
************************************************************************/

‎python/gui/qgsnewhttpconnection.sip

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,45 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsnewhttpconnection.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
111
class QgsNewHttpConnection : QDialog
212
{
3-
%TypeHeaderCode
4-
#include <qgsnewhttpconnection.h>
13+
%Docstring
14+
Dialog to allow the user to configure and save connection
15+
information for an HTTP Server for WMS, etc.
516
%End
617

18+
%TypeHeaderCode
19+
#include "qgsnewhttpconnection.h"
20+
%End
721
public:
8-
//! Constructor
9-
QgsNewHttpConnection( QWidget *parent /TransferThis/ = 0, const QString &baseKey = "/Qgis/connections-wms/", const QString &connName = QString::null, const Qt::WindowFlags &fl = QgsGuiUtils::ModalDialogFlags );
10-
//! Destructor
11-
~QgsNewHttpConnection();
22+
QgsNewHttpConnection( QWidget *parent /TransferThis/ = 0, const QString &baseKey = "qgis/connections-wms/", const QString &connName = QString::null, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
23+
%Docstring
24+
Constructor
25+
%End
26+
1227
public slots:
13-
//! Saves the connection to ~/.qt/qgisrc
14-
void accept();
28+
virtual void accept();
29+
1530

1631
void on_txtName_textChanged( const QString & );
1732

1833
void on_txtUrl_textChanged( const QString & );
1934

2035
void on_buttonBox_helpRequested();
36+
2137
};
38+
39+
/************************************************************************
40+
* This file has been generated automatically from *
41+
* *
42+
* src/gui/qgsnewhttpconnection.h *
43+
* *
44+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
45+
************************************************************************/

‎python/gui/qgsnewnamedialog.sip

Lines changed: 106 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,136 @@
1-
/** \ingroup gui
2-
* New name, for example new layer name dialog. If existing names are provided,
3-
* the dialog warns users if an entered name already exists.
4-
* @note added in 2.10
5-
*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsnewnamedialog.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
612
class QgsNewNameDialog : QgsDialog
713
{
8-
%TypeHeaderCode
9-
#include <qgsnewnamedialog.h>
14+
%Docstring
15+
New name, for example new layer name dialog. If existing names are provided,
16+
the dialog warns users if an entered name already exists.
17+
.. versionadded:: 2.10
1018
%End
1119

20+
%TypeHeaderCode
21+
#include "qgsnewnamedialog.h"
22+
%End
1223
public:
13-
/** New dialog constructor.
14-
* @param source original data source name, e.g. original layer name of the layer to be copied
15-
* @param initial initial name
16-
* @param extensions base name extensions, e.g. raster base name band extensions or vector layer type extensions
17-
* @param existing existing names
18-
* @param regexp regular expression to be used as validator, for example db tables should have "[A-Za-z_][A-Za-z0-9_]+"
19-
* @param cs case sensitivity for new name to existing names comparison
20-
* @param parent
21-
* @param flags
22-
*/
23-
QgsNewNameDialog( const QString& source = QString::null, const QString& initial = QString::null,
24-
const QStringList& extensions = QStringList(), const QStringList& existing = QStringList(),
25-
const QRegExp& regexp = QRegExp(), Qt::CaseSensitivity cs = Qt::CaseSensitive,
26-
QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags &flags = QgsGuiUtils::ModalDialogFlags );
27-
28-
/** Sets the hint string for the dialog (the text shown above the name
29-
* input box).
30-
* @param hintString hint text
31-
* @see hintString()
32-
* @note added in QGIS 2.12
33-
*/
24+
25+
QgsNewNameDialog( const QString &source = QString::null, const QString &initial = QString::null,
26+
const QStringList &extensions = QStringList(), const QStringList &existing = QStringList(),
27+
const QRegExp &regexp = QRegExp(), Qt::CaseSensitivity cs = Qt::CaseSensitive,
28+
QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
29+
%Docstring
30+
New dialog constructor.
31+
\param source original data source name, e.g. original layer name of the layer to be copied
32+
\param initial initial name
33+
\param extensions base name extensions, e.g. raster base name band extensions or vector layer type extensions
34+
\param existing existing names
35+
\param regexp regular expression to be used as validator, for example db tables should have "[A-Za-z_][A-Za-z0-9_]+"
36+
\param cs case sensitivity for new name to existing names comparison
37+
\param parent
38+
\param flags
39+
%End
40+
3441
void setHintString( const QString &hintString );
42+
%Docstring
43+
Sets the hint string for the dialog (the text shown above the name
44+
input box).
45+
\param hintString hint text
46+
.. seealso:: hintString()
47+
.. versionadded:: 2.12
48+
%End
3549

36-
/** Returns the hint string for the dialog (the text shown above the name
37-
* input box).
38-
* @see setHintString()
39-
* @note added in QGIS 2.12
40-
*/
4150
QString hintString() const;
51+
%Docstring
52+
Returns the hint string for the dialog (the text shown above the name
53+
input box).
54+
.. seealso:: setHintString()
55+
.. versionadded:: 2.12
56+
:rtype: str
57+
%End
4258

43-
/** Sets whether users are permitted to overwrite existing names. If true, then
44-
* the dialog will reflect that the new name will overwrite an existing name. If false,
45-
* then the dialog will not accept names which already exist.
46-
* @note added in QGIS 2.12
47-
* @see overwriteEnabled()
48-
*/
4959
void setOverwriteEnabled( bool enabled );
60+
%Docstring
61+
Sets whether users are permitted to overwrite existing names. If true, then
62+
the dialog will reflect that the new name will overwrite an existing name. If false,
63+
then the dialog will not accept names which already exist.
64+
.. versionadded:: 2.12
65+
.. seealso:: overwriteEnabled()
66+
%End
5067

51-
/** Returns whether users are permitted to overwrite existing names.
52-
* @note added in QGIS 2.12
53-
* @see setOverwriteEnabled()
54-
*/
5568
bool overwriteEnabled() const;
69+
%Docstring
70+
Returns whether users are permitted to overwrite existing names.
71+
.. versionadded:: 2.12
72+
.. seealso:: setOverwriteEnabled()
73+
:rtype: bool
74+
%End
5675

57-
/** Sets the string used for warning users if a conflicting name exists.
58-
* @param string warning string. If empty a default warning string will be used.
59-
* @note added in QGIS 2.12
60-
* @see conflictingNameWarning()
61-
*/
6276
void setConflictingNameWarning( const QString &string );
77+
%Docstring
78+
Sets the string used for warning users if a conflicting name exists.
79+
\param string warning string. If empty a default warning string will be used.
80+
.. versionadded:: 2.12
81+
.. seealso:: conflictingNameWarning()
82+
%End
6383

64-
/** Returns the string used for warning users if a conflicting name exists.
65-
* @note added in QGIS 2.12
66-
* @see setConflictingNameWarning()
67-
*/
6884
QString conflictingNameWarning() const;
85+
%Docstring
86+
Returns the string used for warning users if a conflicting name exists.
87+
.. versionadded:: 2.12
88+
.. seealso:: setConflictingNameWarning()
89+
:rtype: str
90+
%End
6991

70-
/** Name entered by user.
71-
* @return new name
72-
*/
7392
QString name() const;
93+
%Docstring
94+
Name entered by user.
95+
:return: new name
96+
:rtype: str
97+
%End
7498

75-
/** Test if name or name with at least one extension exists.
76-
* @param name name or base name
77-
* @param extensions base name extensions
78-
* @param existing existing names
79-
* @param cs case sensitivity for new name to existing names comparison
80-
* @return true if name exists
81-
*/
82-
static bool exists( const QString& name, const QStringList& extensions,
99+
static bool exists( const QString &name, const QStringList &extensions,
83100
const QStringList &existing, Qt::CaseSensitivity cs = Qt::CaseSensitive );
101+
%Docstring
102+
Test if name or name with at least one extension exists.
103+
\param name name or base name
104+
\param extensions base name extensions
105+
\param existing existing names
106+
\param cs case sensitivity for new name to existing names comparison
107+
:return: true if name exists
108+
:rtype: bool
109+
%End
84110
public slots:
85111
void nameChanged();
86112

87113
protected:
88114

89115
QString highlightText( const QString &text );
116+
%Docstring
117+
:rtype: str
118+
%End
90119
static QStringList fullNames( const QString &name, const QStringList &extensions );
91-
// get list of existing names
92-
static QStringList matching( const QStringList& newNames, const QStringList& existingNames,
120+
%Docstring
121+
:rtype: list of str
122+
%End
123+
static QStringList matching( const QStringList &newNames, const QStringList &existingNames,
93124
Qt::CaseSensitivity cs = Qt::CaseSensitive );
125+
%Docstring
126+
:rtype: list of str
127+
%End
94128
};
95129

130+
/************************************************************************
131+
* This file has been generated automatically from *
132+
* *
133+
* src/gui/qgsnewnamedialog.h *
134+
* *
135+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
136+
************************************************************************/
Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,80 @@
1-
class QgsNewVectorLayerDialog : QDialog
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsnewvectorlayerdialog.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
class QgsNewVectorLayerDialog: QDialog
213
{
14+
315
%TypeHeaderCode
4-
#include <qgsnewvectorlayerdialog.h>
16+
#include "qgsnewvectorlayerdialog.h"
517
%End
6-
718
public:
819

9-
// run the dialog, create the layer.
10-
// @return fileName on success, empty string use aborted, QString::null if creation failed
11-
static QString runAndCreateLayer( QWidget *parent = 0, QString *enc = 0 );
20+
static QString runAndCreateLayer( QWidget *parent = 0, QString *enc = 0, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
21+
%Docstring
22+
Runs the dialog and creates a layer matching the dialog parameters.
23+
:return: fileName on success, empty string use aborted, QString.null if creation failed
24+
:rtype: str
25+
%End
1226

13-
QgsNewVectorLayerDialog( QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags &fl = QgsGuiUtils::ModalDialogFlags );
27+
QgsNewVectorLayerDialog( QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
1428
~QgsNewVectorLayerDialog();
15-
/** Returns the selected geometry type*/
1629
QgsWkbTypes::Type selectedType() const;
17-
/** Appends the chosen attribute names and types to at*/
30+
%Docstring
31+
Returns the selected geometry type
32+
:rtype: QgsWkbTypes.Type
33+
%End
1834
void attributes( QList< QPair<QString, QString> > &at ) const;
19-
/** Returns the file format for storage*/
35+
%Docstring
36+
Appends the chosen attribute names and types to at
37+
%End
2038
QString selectedFileFormat() const;
21-
/** Returns the file format for storage*/
39+
%Docstring
40+
Returns the file format for storage
41+
:rtype: str
42+
%End
2243
QString selectedFileEncoding() const;
44+
%Docstring
45+
Returns the file format for storage
46+
:rtype: str
47+
%End
2348

2449
QgsCoordinateReferenceSystem crs() const;
50+
%Docstring
51+
Returns the selected CRS for the new layer.
52+
.. seealso:: setCrs()
53+
:rtype: QgsCoordinateReferenceSystem
54+
%End
55+
2556
void setCrs( const QgsCoordinateReferenceSystem &crs );
57+
%Docstring
58+
Sets the ``crs`` value for the new layer in the dialog.
59+
.. versionadded:: 3.0
60+
.. seealso:: crs()
61+
%End
2662

2763
protected slots:
2864
void on_mAddAttributeButton_clicked();
2965
void on_mRemoveAttributeButton_clicked();
3066
void on_mFileFormatComboBox_currentIndexChanged( int index );
3167
void on_mTypeBox_currentIndexChanged( int index );
3268
void on_buttonBox_helpRequested();
33-
void nameChanged( const QString& );
69+
void nameChanged( const QString & );
3470
void selectionChanged();
71+
3572
};
73+
74+
/************************************************************************
75+
* This file has been generated automatically from *
76+
* *
77+
* src/gui/qgsnewvectorlayerdialog.h *
78+
* *
79+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
80+
************************************************************************/

‎python/gui/qgsoptionsdialogbase.sip

Lines changed: 112 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,130 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsoptionsdialogbase.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
15+
116
class QgsSearchHighlightOptionWidget : QObject
217
{
18+
%Docstring
19+
Container for a widget to be used to search text in the option dialog
20+
If the widget type is handled, it is valid.
21+
It can perform a text search in the widget and highlight it in case of success.
22+
This uses stylesheets.
23+
.. versionadded:: 3.0
24+
%End
25+
326
%TypeHeaderCode
4-
#include <qgsoptionsdialogbase.h>
27+
#include "qgsoptionsdialogbase.h"
528
%End
629
public:
30+
731
explicit QgsSearchHighlightOptionWidget( QWidget *widget = 0 );
8-
~QgsSearchHighlightOptionWidget();
32+
%Docstring
33+
Constructor
34+
\param widget the widget used to search text into
35+
%End
936

1037
bool isValid();
38+
%Docstring
39+
Returns if it valid: if the widget type is handled and if the widget is not still available
40+
:rtype: bool
41+
%End
1142

12-
bool searchHighlight( QString searchText );
43+
bool searchHighlight( const QString &searchText );
44+
%Docstring
45+
search for a text pattern and highlight the widget if the text is found
46+
:return: true if the text pattern is found
47+
:rtype: bool
48+
%End
1349

1450
void reset();
51+
%Docstring
52+
reset the style to the original state
53+
%End
1554

1655
QWidget *widget();
56+
%Docstring
57+
return the widget
58+
:rtype: QWidget
59+
%End
60+
1761
};
1862

1963

2064

2165
class QgsOptionsDialogBase : QDialog
2266
{
67+
%Docstring
68+
A base dialog for options and properties dialogs that offers vertical tabs.
69+
It handles saving/restoring of geometry, splitter and current tab states,
70+
switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
71+
and connecting QDialogButtonBox's accepted/rejected signals to dialog's accept/reject slots
72+
73+
To use:
74+
1) Start with copy of qgsoptionsdialog_template.ui and build options/properties dialog.
75+
2) In source file for dialog, inherit this class instead of QDialog, then in constructor:
76+
...
77+
setupUi( this ); // set up .ui file objects
78+
initOptionsBase( false ); // set up this class to use .ui objects, optionally restoring base ui
79+
...
80+
restoreOptionsBaseUi(); // restore the base ui with initOptionsBase or use this later on
81+
%End
82+
2383
%TypeHeaderCode
24-
#include <qgsoptionsdialogbase.h>
84+
#include "qgsoptionsdialogbase.h"
2585
%End
2686
public:
27-
/** Constructor
28-
* @param settingsKey QgsSettings subgroup key for saving/restore ui states, e.g. "ProjectProperties".
29-
* @param parent parent object (owner)
30-
* @param fl widget flags
31-
* @param settings custom QgsSettings pointer
32-
*/
33-
QgsOptionsDialogBase( const QString &settingsKey, QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags &fl = 0, QgsSettings *settings = 0 );
87+
88+
QgsOptionsDialogBase( const QString &settingsKey, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = 0, QgsSettings *settings = 0 );
89+
%Docstring
90+
Constructor
91+
\param settingsKey QgsSettings subgroup key for saving/restore ui states, e.g. "ProjectProperties".
92+
\param parent parent object (owner)
93+
\param fl widget flags
94+
\param settings custom QgsSettings pointer
95+
%End
3496
~QgsOptionsDialogBase();
3597

36-
/** Set up the base ui connections for vertical tabs.
37-
* @param restoreUi Whether to restore the base ui at this time.
38-
* @param title the window title
39-
*/
4098
void initOptionsBase( bool restoreUi = true, const QString &title = QString() );
99+
%Docstring
100+
Set up the base ui connections for vertical tabs.
101+
\param restoreUi Whether to restore the base ui at this time.
102+
\param title the window title
103+
%End
41104

42-
// set custom QgsSettings pointer if dialog used outside QGIS (in plugin)
43105
void setSettings( QgsSettings *settings );
44106

45-
/** Restore the base ui.
46-
* Sometimes useful to do at end of subclass's constructor.
47-
* @param title the window title (it does not need to be defined if previously given to initOptionsBase();
48-
*/
49107
void restoreOptionsBaseUi( const QString &title = QString() );
108+
%Docstring
109+
Restore the base ui.
110+
Sometimes useful to do at end of subclass's constructor.
111+
\param title the window title (it does not need to be defined if previously given to initOptionsBase();
112+
%End
50113

51-
/** Determine if the options list is in icon only mode
52-
*/
53114
bool iconOnly();
115+
%Docstring
116+
Determine if the options list is in icon only mode
117+
:rtype: bool
118+
%End
54119

55120
public slots:
56121

57-
/**
58-
* searchText searches for a text in all the pages of the stacked widget and highlight the results
59-
* @param text the text to search
60-
*/
61-
void searchText( QString text );
122+
void searchText( const QString &text );
123+
%Docstring
124+
searchText searches for a text in all the pages of the stacked widget and highlight the results
125+
\param text the text to search
126+
.. versionadded:: 3.0
127+
%End
62128

63129
protected slots:
64130
void updateOptionsListVerticalTabs();
@@ -67,10 +133,27 @@ class QgsOptionsDialogBase : QDialog
67133
void warnAboutMissingObjects();
68134

69135
protected:
70-
void showEvent( QShowEvent *e );
71-
void paintEvent( QPaintEvent *e );
136+
virtual void showEvent( QShowEvent *e );
137+
138+
virtual void paintEvent( QPaintEvent *e );
139+
72140

73141
virtual void updateWindowTitle();
74142

75143
void registerTextSearchWidgets();
144+
%Docstring
145+
register widgets in the dialog to search for text in it
146+
it is automatically called if a line edit has "mSearchLineEdit" as object name.
147+
.. versionadded:: 3.0
148+
%End
149+
150+
76151
};
152+
153+
/************************************************************************
154+
* This file has been generated automatically from *
155+
* *
156+
* src/gui/qgsoptionsdialogbase.h *
157+
* *
158+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
159+
************************************************************************/

‎python/gui/qgsorderbydialog.sip

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,59 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsorderbydialog.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
114
class QgsOrderByDialog : QDialog
215
{
16+
%Docstring
17+
This is a dialog to build and manage a list of order by clauses.
18+
19+
.. versionadded:: 2.14
20+
%End
21+
322
%TypeHeaderCode
423
#include "qgsorderbydialog.h"
524
%End
625
public:
7-
/**
8-
* Create a new order by dialog. This helps building order by structures.
9-
*
10-
* @param layer The vector layer for which the order by should be produced
11-
* @param parent The parent widget, optional
12-
*/
26+
1327
QgsOrderByDialog( QgsVectorLayer *layer, QWidget *parent /TransferThis/ = 0 );
28+
%Docstring
29+
Create a new order by dialog. This helps building order by structures.
30+
31+
\param layer The vector layer for which the order by should be produced
32+
\param parent The parent widget, optional
33+
%End
1434

15-
/**
16-
* Set the order by to manage
17-
*/
1835
void setOrderBy( const QgsFeatureRequest::OrderBy &orderBy );
36+
%Docstring
37+
Set the order by to manage
38+
%End
1939

20-
/**
21-
* Get the order by defined in the dialog
22-
*/
2340
QgsFeatureRequest::OrderBy orderBy();
41+
%Docstring
42+
Get the order by defined in the dialog
43+
:rtype: QgsFeatureRequest.OrderBy
44+
%End
2445

2546
protected:
2647

27-
bool eventFilter( QObject *obj, QEvent *e );
28-
};
48+
virtual bool eventFilter( QObject *obj, QEvent *e );
49+
50+
51+
};
52+
53+
/************************************************************************
54+
* This file has been generated automatically from *
55+
* *
56+
* src/gui/qgsorderbydialog.h *
57+
* *
58+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
59+
************************************************************************/

‎python/gui/qgsowssourceselect.sip

Lines changed: 171 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,266 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsowssourceselect.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
18

2-
/*!
3-
* \brief Dialog to create connections and add layers from WMS, WFS, WCS etc.
4-
*
5-
* This dialog allows the user to define and save connection information
6-
* for WMS servers, etc.
7-
*
8-
* The user can then connect and add
9-
* layers from the WMS server to the map canvas.
10-
*/
11-
class QgsOWSSourceSelect : QDialog
9+
10+
11+
12+
13+
14+
class QgsOWSSourceSelect : QDialog, protected Ui::QgsOWSSourceSelectBase
1215
{
13-
%TypeHeaderCode
14-
#include <qgsowssourceselect.h>
16+
%Docstring
17+
Dialog to create connections and add layers from WMS, WFS, WCS etc.
18+
19+
This dialog allows the user to define and save connection information
20+
for WMS servers, etc.
21+
22+
The user can then connect and add
23+
layers from the WMS server to the map canvas.
1524
%End
1625

26+
%TypeHeaderCode
27+
#include "qgsowssourceselect.h"
28+
%End
1729
public:
18-
/** Formats supported by provider */
1930
struct SupportedFormat
2031
{
2132
QString format;
2233
QString label;
2334
};
2435

25-
//! Constructor
26-
QgsOWSSourceSelect( const QString &service, QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags &fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None);
27-
//! Destructor
36+
QgsOWSSourceSelect( const QString &service, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
37+
%Docstring
38+
Constructor
39+
%End
40+
2841
~QgsOWSSourceSelect();
2942

3043
public slots:
3144

32-
//! Opens the create connection dialog to build a new connection
3345
void on_mNewButton_clicked();
34-
//! Opens a dialog to edit an existing connection
46+
%Docstring
47+
Opens the create connection dialog to build a new connection
48+
%End
3549
void on_mEditButton_clicked();
36-
//! Deletes the selected connection
50+
%Docstring
51+
Opens a dialog to edit an existing connection
52+
%End
3753
void on_mDeleteButton_clicked();
38-
//! Saves connections to the file
54+
%Docstring
55+
Deletes the selected connection
56+
%End
3957
void on_mSaveButton_clicked();
40-
//! Loads connections from the file
58+
%Docstring
59+
Saves connections to the file
60+
%End
4161
void on_mLoadButton_clicked();
62+
%Docstring
63+
Loads connections from the file
64+
%End
4265

43-
/** Connects to the database using the stored connection parameters.
44-
* Once connected, available layers are displayed.
45-
*/
4666
void on_mConnectButton_clicked();
67+
%Docstring
68+
Connects to the database using the stored connection parameters.
69+
Once connected, available layers are displayed.
70+
%End
4771

48-
//! Determines the layers the user selected
4972
virtual void addClicked();
73+
%Docstring
74+
Determines the layers the user selected
75+
%End
5076

5177
void searchFinished();
5278

53-
//! Opens the Spatial Reference System dialog.
5479
void on_mChangeCRSButton_clicked();
80+
%Docstring
81+
Opens the Spatial Reference System dialog.
82+
%End
5583

56-
//! Signaled when a layer selection is changed.
5784
virtual void on_mLayersTreeWidget_itemSelectionChanged();
85+
%Docstring
86+
Signaled when a layer selection is changed.
87+
%End
5888

59-
//! Set status message to theMessage
6089
void showStatusMessage( const QString &message );
90+
%Docstring
91+
Set status message to theMessage
92+
%End
6193

62-
//! show whatever error is exposed.
6394
void showError( const QString &title, const QString &format, const QString &error );
95+
%Docstring
96+
show whatever error is exposed.
97+
%End
6498

65-
//! Stores the selected datasource whenerver it is changed
6699
void on_mConnectionsComboBox_activated( int );
100+
%Docstring
101+
Stores the selected datasource whenerver it is changed
102+
%End
67103

68-
//! Add some default wms servers to the list
69104
void on_mAddDefaultButton_clicked();
105+
%Docstring
106+
Add some default wms servers to the list
107+
%End
70108

71109
void on_mDialogButtonBox_helpRequested();
72110

73111
signals:
74-
void addRasterLayer( const QString & rasterLayerPath,
75-
const QString & baseName,
112+
void addRasterLayer( const QString &rasterLayerPath,
113+
const QString &baseName,
76114
const QString &providerKey );
77115
void connectionsChanged();
78116

79117
protected:
80-
/**
81-
* List of image formats (encodings) supported by provider
82-
* @return list of format/label pairs
83-
*/
118+
84119
virtual QList<QgsOWSSourceSelect::SupportedFormat> providerFormats();
120+
%Docstring
121+
List of image formats (encodings) supported by provider
122+
:return: list of format/label pairs
123+
:rtype: list of QgsOWSSourceSelect.SupportedFormat
124+
%End
85125

86-
//! List of formats supported for currently selected layer item(s)
87126
virtual QStringList selectedLayersFormats();
127+
%Docstring
128+
List of formats supported for currently selected layer item(s)
129+
:rtype: list of str
130+
%End
88131

89-
//! Server CRS supported for currently selected layer item(s)
90132
virtual QStringList selectedLayersCrses();
133+
%Docstring
134+
Server CRS supported for currently selected layer item(s)
135+
:rtype: list of str
136+
%End
91137

92-
//! List of times (temporalDomain timePosition/timePeriod for currently selected layer item(s)
93138
virtual QStringList selectedLayersTimes();
139+
%Docstring
140+
List of times (temporalDomain timePosition/timePeriod for currently selected layer item(s)
141+
:rtype: list of str
142+
%End
94143

95-
//virtual QStringList layerCrs( int id );
96144

97-
//! Populate the connection list combo box
98145
void populateConnectionList();
146+
%Docstring
147+
Populate the connection list combo box
148+
%End
99149

100-
//! Populate supported formats
101150
void populateFormats();
151+
%Docstring
152+
Populate supported formats
153+
%End
102154

103-
//! Clear previously set formats
104155
void clearFormats();
156+
%Docstring
157+
Clear previously set formats
158+
%End
105159

106-
//! Set supported CRSs
107160
void populateCrs();
161+
%Docstring
162+
Set supported CRSs
163+
%End
108164

109-
//! Clear CRSs
110165
void clearCrs();
166+
%Docstring
167+
Clear CRSs
168+
%End
111169

112-
//! Populate times
113170
void populateTimes();
171+
%Docstring
172+
Populate times
173+
%End
114174

115-
//! Clear times
116175
void clearTimes();
176+
%Docstring
177+
Clear times
178+
%End
117179

118-
//! Connection name
119180
QString connName();
181+
%Docstring
182+
Connection name
183+
:rtype: str
184+
%End
120185

121-
//! Connection info (uri)
122186
QString connectionInfo();
187+
%Docstring
188+
Connection info (uri)
189+
:rtype: str
190+
%End
123191

124-
//! Set the server connection combo box to that stored in the config file.
125192
void setConnectionListPosition();
193+
%Docstring
194+
Set the server connection combo box to that stored in the config file.
195+
%End
126196

127-
//! Add a few example servers to the list.
128197
void addDefaultServers();
198+
%Docstring
199+
Add a few example servers to the list.
200+
%End
201+
202+
203+
129204

130-
/**
131-
* \brief Populate the layer list.
132-
*
133-
* \retval false if the layers could not be retrieved or parsed
134-
*/
135205
virtual void populateLayerList();
206+
%Docstring
207+
Populate the layer list.
208+
209+
\retval false if the layers could not be retrieved or parsed
210+
%End
211+
136212

137-
//! create an item including possible parents
138-
//! @note not available in python bindings
139-
/*
140-
QgsNumericSortTreeWidgetItem *createItem( int id,
141-
const QStringList &names,
142-
QMap<int, QgsNumericSortTreeWidgetItem *> &items,
143-
int &layerAndStyleCount,
144-
const QMap<int, int> &layerParents,
145-
const QMap<int, QStringList> &layerParentNames ) /Factory/;
146-
*/
147-
148-
//! Returns a textual description for the authority id
149213
QString descriptionForAuthId( const QString &authId );
214+
%Docstring
215+
Returns a textual description for the authority id
216+
:rtype: str
217+
%End
218+
219+
220+
150221

151222
void addWmsListRow( const QDomElement &item, int row );
223+
%Docstring
224+
layer name derived from latest layer selection (updated as long it's not edited manually)
225+
%End
152226
void addWmsListItem( const QDomElement &el, int row, int column );
153227

154228
virtual void enableLayersForCrs( QTreeWidgetItem *item );
155229

156-
//! Returns currently selected format
157230
QString selectedFormat();
231+
%Docstring
232+
Returns currently selected format
233+
:rtype: str
234+
%End
158235

159-
//! Returns currently selected Crs
160236
QString selectedCrs();
237+
%Docstring
238+
Returns currently selected Crs
239+
:rtype: str
240+
%End
161241

162-
//! Returns currently selected time
163242
QString selectedTime();
243+
%Docstring
244+
Returns currently selected time
245+
:rtype: str
246+
%End
164247

165-
//! Returns currently selected cache load control
166248
QNetworkRequest::CacheLoadControl selectedCacheLoadControl();
249+
%Docstring
250+
Returns currently selected cache load control
251+
:rtype: QNetworkRequest.CacheLoadControl
252+
%End
253+
254+
255+
256+
167257

168258
};
259+
260+
/************************************************************************
261+
* This file has been generated automatically from *
262+
* *
263+
* src/gui/qgsowssourceselect.h *
264+
* *
265+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
266+
************************************************************************/

0 commit comments

Comments
 (0)
Please sign in to comment.