Skip to content

Commit 10d34ec

Browse files
committedApr 24, 2017
sipify batch
* QgsBearingUtils * QgsBrowserModel * QgsColorScheme, QgsColorSchemeRegistry * QgsContextHelp * QgsCoordinateReferenceSystem * QgsCoordinateTransform * QgsFeedback
1 parent 6e7b753 commit 10d34ec

16 files changed

+1405
-1016
lines changed
 

‎python/auto_sip.blacklist

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ core/conversions.sip
22
core/qgsexception.sip
33
core/qgis.sip
44
core/qgsapplication.sip
5-
core/qgsbearingutils.sip
6-
core/qgsbrowsermodel.sip
7-
core/qgscolorscheme.sip
8-
core/qgscolorschemeregistry.sip
9-
core/qgscontexthelp.sip
10-
core/qgscoordinatereferencesystem.sip
11-
core/qgscoordinatetransform.sip
125
core/qgscredentials.sip
136
core/qgscrscache.sip
147
core/qgsdataitem.sip
@@ -28,7 +21,6 @@ core/qgsexpressioncontextgenerator.sip
2821
core/qgsfeaturefilterprovider.sip
2922
core/qgsfeatureiterator.sip
3023
core/qgsfeaturerequest.sip
31-
core/qgsfeedback.sip
3224
core/qgsfield.sip
3325
core/qgsfieldconstraints.sip
3426
core/qgsfields.sip

‎python/core/qgsbearingutils.sip

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,42 @@
1-
/**
2-
* \class QgsBearingUtils
3-
* \ingroup core
4-
* Utilities for calculating bearings and directions.
5-
* \note Added in version 2.18
6-
*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsbearingutils.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
713
class QgsBearingUtils
814
{
15+
%Docstring
16+
Utilities for calculating bearings and directions.
17+
.. versionadded:: 2.18
18+
%End
19+
920
%TypeHeaderCode
10-
#include <qgsbearingutils.h>
21+
#include "qgsbearingutils.h"
1122
%End
1223
public:
1324

14-
/**
15-
* Returns the direction to true north from a specified point and for a specified
16-
* coordinate reference system. The returned value is in degrees clockwise from
17-
* vertical. An exception will be thrown if the bearing could not be calculated.
18-
*/
19-
static double bearingTrueNorth( const QgsCoordinateReferenceSystem& crs,
20-
const QgsPoint& point );
25+
static double bearingTrueNorth( const QgsCoordinateReferenceSystem &crs,
26+
const QgsPoint &point );
27+
%Docstring
28+
Returns the direction to true north from a specified point and for a specified
29+
coordinate reference system. The returned value is in degrees clockwise from
30+
vertical. An exception will be thrown if the bearing could not be calculated.
31+
:rtype: float
32+
%End
33+
2134
};
35+
36+
/************************************************************************
37+
* This file has been generated automatically from *
38+
* *
39+
* src/core/qgsbearingutils.h *
40+
* *
41+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
42+
************************************************************************/

‎python/core/qgsbrowsermodel.sip

Lines changed: 131 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,191 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsbrowsermodel.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
112
class QgsBrowserModel : QAbstractItemModel
213
{
14+
315
%TypeHeaderCode
4-
#include <qgsbrowsermodel.h>
16+
#include "qgsbrowsermodel.h"
517
%End
6-
718
public:
819
explicit QgsBrowserModel( QObject *parent = 0 );
920
~QgsBrowserModel();
1021

1122
enum ItemDataRole
1223
{
13-
PathRole, /*!< Item path used to access path in the tree, see QgsDataItem::mPath */
14-
CommentRole, /*!< Item comment */
24+
PathRole
25+
CommentRole
1526
};
16-
// implemented methods from QAbstractItemModel for read-only access
1727

18-
/** Used by other components to obtain information about each item provided by the model.
19-
In many models, the combination of flags should include Qt::ItemIsEnabled and Qt::ItemIsSelectable. */
2028
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
29+
%Docstring
30+
Used by other components to obtain information about each item provided by the model.
31+
In many models, the combination of flags should include Qt.ItemIsEnabled and Qt.ItemIsSelectable. *
32+
:rtype: Qt.ItemFlags
33+
%End
2134

22-
/** Used to supply item data to views and delegates. Generally, models only need to supply data
23-
for Qt::DisplayRole and any application-specific user roles, but it is also good practice
24-
to provide data for Qt::ToolTipRole, Qt::AccessibleTextRole, and Qt::AccessibleDescriptionRole.
25-
See the Qt::ItemDataRole enum documentation for information about the types associated with each role. */
2635
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
36+
%Docstring
37+
Used to supply item data to views and delegates. Generally, models only need to supply data
38+
for Qt.DisplayRole and any application-specific user roles, but it is also good practice
39+
to provide data for Qt.ToolTipRole, Qt.AccessibleTextRole, and Qt.AccessibleDescriptionRole.
40+
See the Qt.ItemDataRole enum documentation for information about the types associated with each role. *
41+
:rtype: QVariant
42+
%End
2743

28-
/** Provides views with information to show in their headers. The information is only retrieved
29-
by views that can display header information. */
3044
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
45+
%Docstring
46+
Provides views with information to show in their headers. The information is only retrieved
47+
by views that can display header information. *
48+
:rtype: QVariant
49+
%End
3150

32-
/** Provides the number of rows of data exposed by the model. */
3351
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
52+
%Docstring
53+
Provides the number of rows of data exposed by the model.
54+
:rtype: int
55+
%End
3456

35-
/** Provides the number of columns of data exposed by the model. List models do not provide this function
36-
because it is already implemented in QAbstractListModel. */
3757
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
58+
%Docstring
59+
Provides the number of columns of data exposed by the model. List models do not provide this function
60+
because it is already implemented in QAbstractListModel. *
61+
:rtype: int
62+
%End
3863

39-
/** Returns the index of the item in the model specified by the given row, column and parent index. */
40-
virtual QModelIndex index( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
64+
virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
65+
%Docstring
66+
Returns the index of the item in the model specified by the given row, column and parent index.
67+
:rtype: QModelIndex
68+
%End
4169

4270
QModelIndex findItem( QgsDataItem *item, QgsDataItem *parent = 0 ) const;
71+
%Docstring
72+
:rtype: QModelIndex
73+
%End
4374

44-
/** Returns the parent of the model item with the given index.
45-
* If the item has no parent, an invalid QModelIndex is returned.
46-
*/
4775
virtual QModelIndex parent( const QModelIndex &index ) const;
76+
%Docstring
77+
Returns the parent of the model item with the given index.
78+
If the item has no parent, an invalid QModelIndex is returned.
79+
:rtype: QModelIndex
80+
%End
4881

49-
/** Returns a list of mime that can describe model indexes */
5082
virtual QStringList mimeTypes() const;
83+
%Docstring
84+
Returns a list of mime that can describe model indexes
85+
:rtype: list of str
86+
%End
5187

52-
/** Returns an object that contains serialized items of data corresponding to the list of indexes specified */
53-
virtual QMimeData * mimeData( const QModelIndexList &indexes ) const;
88+
virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
89+
%Docstring
90+
Returns an object that contains serialized items of data corresponding to the list of indexes specified
91+
:rtype: QMimeData
92+
%End
5493

55-
/** Handles the data supplied by a drag and drop operation that ended with the given action */
56-
virtual bool dropMimeData( const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent );
94+
virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
95+
%Docstring
96+
Handles the data supplied by a drag and drop operation that ended with the given action
97+
:rtype: bool
98+
%End
5799

58100
QgsDataItem *dataItem( const QModelIndex &idx ) const;
101+
%Docstring
102+
:rtype: QgsDataItem
103+
%End
104+
105+
virtual bool hasChildren( const QModelIndex &parent = QModelIndex() ) const;
59106

60-
bool hasChildren( const QModelIndex &parent = QModelIndex() ) const;
61107

62-
//! Refresh item specified by path
63-
void refresh( const QString& path );
108+
void refresh( const QString &path );
109+
%Docstring
110+
Refresh item specified by path
111+
%End
64112

65-
//! Refresh item children
66113
void refresh( const QModelIndex &index = QModelIndex() );
114+
%Docstring
115+
Refresh item children
116+
%End
67117

68-
/** Return index of item with given path. It only searches in currently fetched
69-
* items, i.e. it does not fetch children.
70-
* @param path item path
71-
* @param matchFlag supported is Qt::MatchExactly and Qt::MatchStartsWith which has reverse meaning, i.e. find
72-
* item with the longest match from start with path (to get as close/deep as possible to deleted item).
73-
* @return model index, invalid if item not found */
74-
QModelIndex findPath( const QString& path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
118+
QModelIndex findPath( const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
119+
%Docstring
120+
Return index of item with given path. It only searches in currently fetched
121+
items, i.e. it does not fetch children.
122+
\param path item path
123+
\param matchFlag supported is Qt.MatchExactly and Qt.MatchStartsWith which has reverse meaning, i.e. find
124+
item with the longest match from start with path (to get as close/deep as possible to deleted item).
125+
:return: model index, invalid if item not found *
126+
:rtype: QModelIndex
127+
%End
75128

76-
//! @note not available in python bindings
77-
// static QModelIndex findPath( QAbstractItemModel *model, const QString& path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
78129

79130
void connectItem( QgsDataItem *item );
80131

81-
bool canFetchMore( const QModelIndex & parent ) const;
82-
void fetchMore( const QModelIndex & parent );
132+
virtual bool canFetchMore( const QModelIndex &parent ) const;
133+
134+
virtual void fetchMore( const QModelIndex &parent );
135+
83136

84137
signals:
85-
/** Emitted when item children fetch was finished */
86-
void stateChanged( const QModelIndex & index, QgsDataItem::State oldState );
138+
void stateChanged( const QModelIndex &index, QgsDataItem::State oldState );
139+
%Docstring
140+
Emitted when item children fetch was finished
141+
%End
87142

88143
public slots:
89-
//! Reload the whole model
90144
void reload();
145+
%Docstring
146+
Reload the whole model
147+
%End
91148
void beginInsertItems( QgsDataItem *parent, int first, int last );
92149
void endInsertItems();
93150
void beginRemoveItems( QgsDataItem *parent, int first, int last );
94151
void endRemoveItems();
95-
void itemDataChanged( QgsDataItem * item );
96-
void itemStateChanged( QgsDataItem * item, QgsDataItem::State oldState );
97-
98-
/**
99-
* Adds a directory to the favorites group.
100-
* @note added in QGIS 3.0
101-
* @see removeFavorite()
102-
*/
103-
void addFavoriteDirectory( const QString& directory );
104-
105-
/**
106-
* Removes a favorite directory from its corresponding model index.
107-
* @note added in QGIS 3.0
108-
* @see addFavoriteDirectory()
109-
*/
152+
void itemDataChanged( QgsDataItem *item );
153+
void itemStateChanged( QgsDataItem *item, QgsDataItem::State oldState );
154+
155+
void addFavoriteDirectory( const QString &directory );
156+
%Docstring
157+
Adds a directory to the favorites group.
158+
.. versionadded:: 3.0
159+
\see removeFavorite()
160+
%End
161+
110162
void removeFavorite( const QModelIndex &index );
163+
%Docstring
164+
Removes a favorite directory from its corresponding model index.
165+
.. versionadded:: 3.0
166+
\see addFavoriteDirectory()
167+
%End
111168

112169
void updateProjectHome();
113170

114-
/** Hide the given path in the browser model */
115171
void hidePath( QgsDataItem *item );
172+
%Docstring
173+
Hide the given path in the browser model
174+
%End
116175

117176
protected:
118-
//! Populates the model
119177
void addRootItems();
178+
%Docstring
179+
Populates the model
180+
%End
120181
void removeRootItems();
182+
121183
};
184+
185+
/************************************************************************
186+
* This file has been generated automatically from *
187+
* *
188+
* src/core/qgsbrowsermodel.h *
189+
* *
190+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
191+
************************************************************************/

‎python/core/qgscolorscheme.sip

Lines changed: 170 additions & 136 deletions
Large diffs are not rendered by default.
Lines changed: 80 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,102 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgscolorschemeregistry.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
111

2-
/** \ingroup core
3-
* \class QgsColorSchemeRegistry
4-
* \brief Registry of color schemes
5-
*
6-
* A registry of QgsColorScheme color schemes. This class can be created directly, or
7-
* accessed via a global instance.
8-
* \note Added in version 2.5
9-
*/
1012
class QgsColorSchemeRegistry
1113
{
14+
%Docstring
15+
Registry of color schemes
16+
17+
A registry of QgsColorScheme color schemes. This class can be created directly, or
18+
accessed via a QgsApplication.colorSchemeRegistry().
19+
.. versionadded:: 2.5
20+
%End
21+
1222
%TypeHeaderCode
13-
#include <qgscolorschemeregistry.h>
23+
#include "qgscolorschemeregistry.h"
1424
%End
1525
public:
1626

17-
/** Constructor for an empty color scheme registry
18-
*/
1927
QgsColorSchemeRegistry();
28+
%Docstring
29+
Constructor for an empty color scheme registry
30+
%End
2031

2132
virtual ~QgsColorSchemeRegistry();
2233

23-
/** Adds all color schemes from the global instance to this color scheme.
24-
* @see addDefaultSchemes
25-
* @see addColorScheme
26-
*/
2734
void populateFromInstance();
35+
%Docstring
36+
Adds all color schemes from the global instance to this color scheme.
37+
\see addDefaultSchemes
38+
\see addColorScheme
39+
%End
2840

29-
/** Adds all default color schemes to this color scheme.
30-
* @see populateFromInstance
31-
* @see addColorScheme
32-
* @see addUserSchemes
33-
*/
3441
void addDefaultSchemes();
42+
%Docstring
43+
Adds all default color schemes to this color scheme.
44+
\see populateFromInstance
45+
\see addColorScheme
46+
\see addUserSchemes
47+
%End
3548

36-
/** Creates schemes for all gpl palettes in the user's palettes folder.
37-
* @see populateFromInstance
38-
* @see addDefaultSchemes
39-
* @see addColorScheme
40-
*/
4149
void addUserSchemes();
50+
%Docstring
51+
Creates schemes for all gpl palettes in the user's palettes folder.
52+
\see populateFromInstance
53+
\see addDefaultSchemes
54+
\see addColorScheme
55+
%End
56+
57+
void addColorScheme( QgsColorScheme *scheme /Transfer/ );
58+
%Docstring
59+
Adds a color scheme to the registry. Ownership of the scheme is transferred
60+
to the registry.
61+
\param scheme color scheme to add
62+
\see populateFromInstance
63+
\see removeColorScheme
64+
%End
65+
66+
bool removeColorScheme( QgsColorScheme *scheme );
67+
%Docstring
68+
Removes all matching color schemes from the registry
69+
\param scheme color scheme to remove
70+
:return: true if scheme was found and removed
71+
\see addColorScheme
72+
:rtype: bool
73+
%End
4274

43-
/** Adds a color scheme to the registry. Ownership of the scheme is transferred
44-
* to the registry.
45-
* @param scheme color scheme to add
46-
* @see populateFromInstance
47-
* @see removeColorScheme
48-
*/
49-
void addColorScheme( QgsColorScheme* scheme /Transfer/ );
50-
51-
/** Removes all matching color schemes from the registry
52-
* @param scheme color scheme to remove
53-
* @returns true if scheme was found and removed
54-
* @see addColorScheme
55-
*/
56-
bool removeColorScheme( QgsColorScheme* scheme );
57-
58-
/** Returns all color schemes in the registry
59-
* @returns list of color schemes
60-
*/
6175
QList<QgsColorScheme *> schemes() const;
76+
%Docstring
77+
Returns all color schemes in the registry
78+
:return: list of color schemes
79+
:rtype: list of QgsColorScheme
80+
%End
6281

63-
/** Returns all color schemes in the registry which have a specified flag set
64-
* @param flag flag to match
65-
* @returns list of color schemes with flag set
66-
*/
6782
QList<QgsColorScheme *> schemes( const QgsColorScheme::SchemeFlag flag ) const;
83+
%Docstring
84+
Returns all color schemes in the registry which have a specified flag set
85+
\param flag flag to match
86+
:return: list of color schemes with flag set
87+
:rtype: list of QgsColorScheme
88+
%End
89+
90+
6891

69-
/** Return color schemes of a specific type
70-
* @param schemeList destination list for matching schemes
71-
* @note not available in python bindings
72-
*/
73-
// template<class T> void schemes( QList<T*>& schemeList );
7492
};
93+
94+
95+
96+
/************************************************************************
97+
* This file has been generated automatically from *
98+
* *
99+
* src/core/qgscolorschemeregistry.h *
100+
* *
101+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
102+
************************************************************************/

‎python/core/qgscontexthelp.sip

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
1-
/** \ingroup core
2-
* Provides a context based help browser for a dialog.
3-
*
4-
* The help text is stored in SQLite and accessed by a context identifier
5-
* unique to each dialog. This is a singleton class which invokes the help
6-
* viewer using QProcess and ensures that only one viewer is open.
7-
* The viewer will be terminated if open when the main application quits.
8-
*
9-
*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgscontexthelp.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
1012
class QgsContextHelp : QObject
1113
{
14+
%Docstring
15+
Provides a context based help browser for a dialog.
16+
17+
The help text is stored in SQLite and accessed by a context identifier
18+
unique to each dialog. This is a singleton class which invokes the help
19+
viewer using QProcess and ensures that only one viewer is open.
20+
The viewer will be terminated if open when the main application quits.
21+
%End
22+
1223
%TypeHeaderCode
13-
#include <qgscontexthelp.h>
24+
#include "qgscontexthelp.h"
1425
%End
1526
public:
16-
static void run( const QString& context );
27+
static void run( const QString &context );
1728

1829
private:
19-
//! Constructor
20-
QgsContextHelp();
21-
//! Destructor
22-
~QgsContextHelp();
30+
QgsContextHelp() ;
31+
private:
32+
~QgsContextHelp() ;
2333
};
34+
35+
/************************************************************************
36+
* This file has been generated automatically from *
37+
* *
38+
* src/core/qgscontexthelp.h *
39+
* *
40+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
41+
************************************************************************/

‎python/core/qgscoordinatereferencesystem.sip

Lines changed: 588 additions & 440 deletions
Large diffs are not rendered by default.

‎python/core/qgscoordinatetransform.sip

Lines changed: 211 additions & 203 deletions
Large diffs are not rendered by default.

‎python/core/qgsfeedback.sip

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

2-
/** \ingroup core
3-
* Base class for feedback objects to be used for cancelation of something running in a worker thread.
4-
* The class may be used as is or it may be subclassed for extended functionality
5-
* for a particular operation (e.g. report progress or pass some data for preview).
6-
*
7-
* When cancel() is called, the internal code has two options to check for cancelation state:
8-
* - if the worker thread uses an event loop (e.g. for network communication), the code can
9-
* make a queued connection to canceled() signal and handle the cancelation in its slot.
10-
* - if the worker thread does not use an event loop, it can poll isCanceled() method regularly
11-
* to see if the operation should be canceled.
12-
*
13-
* The class is meant to be created and destroyed in the main thread.
14-
*
15-
* For map rendering, the object may be created in constructor of a QgsMapLayerRenderer
16-
* subclass and available with QgsMapLayerRenderer::feedback() method. When a map rendering job
17-
* gets canceled, the cancel() method is called on the feedback object of all layers.
18-
*
19-
* @note added in QGIS 3.0
20-
*/
2112
class QgsFeedback : QObject
2213
{
23-
%TypeHeaderCode
24-
#include <qgsfeedback.h>
25-
%End
14+
%Docstring
15+
Base class for feedback objects to be used for cancelation of something running in a worker thread.
16+
The class may be used as is or it may be subclassed for extended functionality
17+
for a particular operation (e.g. report progress or pass some data for preview).
2618

27-
public:
28-
//! Construct a feedback object
29-
QgsFeedback( QObject* parent /TransferThis/ = nullptr );
19+
When cancel() is called, the internal code has two options to check for cancelation state:
20+
- if the worker thread uses an event loop (e.g. for network communication), the code can
21+
make a queued connection to canceled() signal and handle the cancelation in its slot.
22+
- if the worker thread does not use an event loop, it can poll isCanceled() method regularly
23+
to see if the operation should be canceled.
3024

31-
virtual ~QgsFeedback();
25+
The class is meant to be created and destroyed in the main thread.
3226

33-
//! Tells the internal routines that the current operation should be canceled. This should be run by the main thread
27+
For map rendering, the object may be created in constructor of a QgsMapLayerRenderer
28+
subclass and available with QgsMapLayerRenderer.feedback() method. When a map rendering job
29+
gets canceled, the cancel() method is called on the feedback object of all layers.
30+
31+
.. versionadded:: 3.0
32+
%End
33+
34+
%TypeHeaderCode
35+
#include "qgsfeedback.h"
36+
%End
37+
public:
38+
QgsFeedback( QObject *parent /TransferThis/ = 0 );
39+
%Docstring
40+
Construct a feedback object
41+
%End
3442
void cancel();
43+
%Docstring
44+
Tells the internal routines that the current operation should be canceled. This should be run by the main thread
45+
%End
3546

36-
//! Tells whether the operation has been canceled already
3747
bool isCanceled() const;
48+
%Docstring
49+
Tells whether the operation has been canceled already
50+
:rtype: bool
51+
%End
3852

3953
void setProgress( double progress );
54+
%Docstring
55+
Sets the current progress for the feedback object. The ``progress``
56+
argument is in percentage and valid values range from 0-100.
57+
\see progress()
58+
\see progressChanged()
59+
.. versionadded:: 3.0
60+
%End
4061

4162
double progress() const;
63+
%Docstring
64+
Returns the current progress reported by the feedback object. Depending on how the
65+
feedback object is used progress reporting may not be supported. The returned value
66+
is in percentage and ranges from 0-100.
67+
\see setProgress()
68+
\see progressChanged()
69+
.. versionadded:: 3.0
70+
:rtype: float
71+
%End
4272

4373
signals:
44-
//! Internal routines can connect to this signal if they use event loop
4574
void canceled();
75+
%Docstring
76+
Internal routines can connect to this signal if they use event loop
77+
%End
4678

4779
void progressChanged( double progress );
48-
80+
%Docstring
81+
Emitted when the feedback object reports a progress change. Depending on how the
82+
feedback object is used progress reporting may not be supported. The ``progress``
83+
argument is in percentage and ranges from 0-100.
84+
.. versionadded:: 3.0
85+
\see setProgress()
86+
\see progress()
87+
%End
4988

5089
};
90+
91+
/************************************************************************
92+
* This file has been generated automatically from *
93+
* *
94+
* src/core/qgsfeedback.h *
95+
* *
96+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
97+
************************************************************************/

‎src/core/qgsbrowsermodel.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* \class QgsBrowserWatcher
3030
* \note not available in Python bindings
3131
*/
32+
#ifndef SIP_RUN
3233
class CORE_EXPORT QgsBrowserWatcher : public QFutureWatcher<QVector <QgsDataItem *> >
3334
{
3435
Q_OBJECT
@@ -44,6 +45,7 @@ class CORE_EXPORT QgsBrowserWatcher : public QFutureWatcher<QVector <QgsDataItem
4445
private:
4546
QgsDataItem *mItem = nullptr;
4647
};
48+
#endif
4749

4850
/** \ingroup core
4951
* \class QgsBrowserModel
@@ -122,7 +124,7 @@ class CORE_EXPORT QgsBrowserModel : public QAbstractItemModel
122124
QModelIndex findPath( const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
123125

124126
//! \note not available in Python bindings
125-
static QModelIndex findPath( QAbstractItemModel *model, const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
127+
static QModelIndex findPath( QAbstractItemModel *model, const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly ) SIP_SKIP;
126128

127129
void connectItem( QgsDataItem *item );
128130

‎src/core/qgscolorscheme.h

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <QObject>
2525

2626
#include "qgis_core.h"
27+
#include "qgis.h"
2728

2829
/** \ingroup core
2930
* List of colors paired with a friendly display name identifying the color
@@ -42,6 +43,24 @@ typedef QList< QPair< QColor, QString > > QgsNamedColorList;
4243
*/
4344
class CORE_EXPORT QgsColorScheme
4445
{
46+
47+
#ifdef SIP_RUN
48+
SIP_CONVERT_TO_SUBCLASS_CODE
49+
if ( dynamic_cast<QgsUserColorScheme *>( sipCpp ) != NULL )
50+
sipType = sipType_QgsUserColorScheme;
51+
else if ( dynamic_cast<QgsRecentColorScheme *>( sipCpp ) != NULL )
52+
sipType = sipType_QgsRecentColorScheme;
53+
else if ( dynamic_cast<QgsCustomColorScheme *>( sipCpp ) != NULL )
54+
sipType = sipType_QgsCustomColorScheme;
55+
else if ( dynamic_cast<QgsProjectColorScheme *>( sipCpp ) != NULL )
56+
sipType = sipType_QgsProjectColorScheme;
57+
else if ( dynamic_cast<QgsGplColorScheme *>( sipCpp ) != NULL )
58+
sipType = sipType_QgsGplColorScheme;
59+
else
60+
sipType = sipType_QgsColorScheme;
61+
SIP_END
62+
#endif
63+
4564
public:
4665

4766
/** Flags for controlling behavior of color scheme
@@ -102,7 +121,7 @@ class CORE_EXPORT QgsColorScheme
102121
/** Clones a color scheme
103122
* \returns copy of color scheme
104123
*/
105-
virtual QgsColorScheme *clone() const = 0;
124+
virtual QgsColorScheme *clone() const = 0 SIP_FACTORY;
106125
};
107126

108127
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsColorScheme::SchemeFlags )
@@ -149,7 +168,7 @@ class CORE_EXPORT QgsUserColorScheme : public QgsGplColorScheme
149168

150169
virtual QString schemeName() const override;
151170

152-
virtual QgsUserColorScheme *clone() const override;
171+
virtual QgsUserColorScheme *clone() const override SIP_FACTORY;
153172

154173
virtual bool isEditable() const override { return true; }
155174

@@ -199,7 +218,7 @@ class CORE_EXPORT QgsRecentColorScheme : public QgsColorScheme
199218
virtual QgsNamedColorList fetchColors( const QString &context = QString(),
200219
const QColor &baseColor = QColor() ) override;
201220

202-
QgsRecentColorScheme *clone() const override;
221+
QgsRecentColorScheme *clone() const override SIP_FACTORY;
203222

204223
/** Adds a color to the list of recent colors.
205224
* \param color color to add
@@ -237,7 +256,7 @@ class CORE_EXPORT QgsCustomColorScheme : public QgsColorScheme
237256

238257
virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() ) override;
239258

240-
QgsCustomColorScheme *clone() const override;
259+
QgsCustomColorScheme *clone() const override SIP_FACTORY;
241260
};
242261

243262
/** \ingroup core
@@ -262,7 +281,7 @@ class CORE_EXPORT QgsProjectColorScheme : public QgsColorScheme
262281

263282
virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() ) override;
264283

265-
QgsProjectColorScheme *clone() const override;
284+
QgsProjectColorScheme *clone() const override SIP_FACTORY;
266285
};
267286

268287
#endif

‎src/core/qgscolorschemeregistry.h

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class CORE_EXPORT QgsColorSchemeRegistry
6767
* \see populateFromInstance
6868
* \see removeColorScheme
6969
*/
70-
void addColorScheme( QgsColorScheme *scheme );
70+
void addColorScheme( QgsColorScheme *scheme SIP_TRANSFER );
7171

7272
/** Removes all matching color schemes from the registry
7373
* \param scheme color scheme to remove
@@ -87,31 +87,34 @@ class CORE_EXPORT QgsColorSchemeRegistry
8787
*/
8888
QList<QgsColorScheme *> schemes( const QgsColorScheme::SchemeFlag flag ) const;
8989

90+
9091
/** Return color schemes of a specific type
9192
* \param schemeList destination list for matching schemes
9293
* \note not available in Python bindings
9394
*/
94-
template<class T> void schemes( QList<T *> &schemeList );
95+
#ifndef SIP_RUN
96+
template<class T> void schemes( QList<T *> &schemeList )
97+
{
98+
schemeList.clear();
99+
QList<QgsColorScheme *> schemeInstanceList = schemes();
100+
QList<QgsColorScheme *>::iterator schemeIt = schemeInstanceList.begin();
101+
for ( ; schemeIt != schemeInstanceList.end(); ++schemeIt )
102+
{
103+
T *scheme = dynamic_cast<T *>( *schemeIt );
104+
if ( scheme )
105+
{
106+
schemeList.push_back( scheme );
107+
}
108+
}
109+
}
110+
#endif
95111

96112
private:
97113

98114
QList< QgsColorScheme * > mColorSchemeList;
99115

100116
};
101117

102-
template<class T> void QgsColorSchemeRegistry::schemes( QList<T *> &schemeList )
103-
{
104-
schemeList.clear();
105-
QList<QgsColorScheme *> schemeInstanceList = schemes();
106-
QList<QgsColorScheme *>::iterator schemeIt = schemeInstanceList.begin();
107-
for ( ; schemeIt != schemeInstanceList.end(); ++schemeIt )
108-
{
109-
T *scheme = dynamic_cast<T *>( *schemeIt );
110-
if ( scheme )
111-
{
112-
schemeList.push_back( scheme );
113-
}
114-
}
115-
}
118+
116119

117120
#endif

‎src/core/qgscontexthelp.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <QProcess>
2525

2626
#include "qgis_core.h"
27+
#include "qgis.h"
2728

2829
/** \ingroup core
2930
* Provides a context based help browser for a dialog.
@@ -46,9 +47,9 @@ class CORE_EXPORT QgsContextHelp : public QObject
4647

4748
private:
4849
//! Constructor
49-
QgsContextHelp();
50+
QgsContextHelp() SIP_FORCE;
5051

51-
~QgsContextHelp();
52+
~QgsContextHelp() SIP_FORCE;
5253

5354
QProcess *start();
5455
void showContext( const QString &context );

‎src/core/qgscoordinatereferencesystem.h

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@
2828
#include <QHash>
2929
#include <QReadWriteLock>
3030

31+
//qgis includes
32+
#include "qgis.h"
33+
#include "qgsunittypes.h"
34+
3135
class QDomNode;
3236
class QDomDocument;
3337
class QgsCoordinateReferenceSystemPrivate;
3438

3539
// forward declaration for sqlite3
36-
typedef struct sqlite3 sqlite3;
37-
38-
//qgis includes
39-
#include "qgis.h"
40-
#include "qgsunittypes.h"
40+
typedef struct sqlite3 sqlite3 SIP_SKIP;
4141

4242
#ifdef DEBUG
43-
typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH;
43+
typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH SIP_SKIP;
4444
#else
45-
typedef void *OGRSpatialReferenceH;
45+
typedef void *OGRSpatialReferenceH SIP_SKIP;
4646
#endif
4747

4848
class QgsCoordinateReferenceSystem;
49-
typedef void ( *CUSTOM_CRS_VALIDATION )( QgsCoordinateReferenceSystem & );
49+
typedef void ( *CUSTOM_CRS_VALIDATION )( QgsCoordinateReferenceSystem & ) SIP_SKIP;
5050

5151
/** \ingroup core
5252
* This class represents a coordinate reference system (CRS).
@@ -217,17 +217,15 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
217217
* If no prefix is specified, WKT definition is assumed.
218218
* \param definition A String containing a coordinate reference system definition.
219219
* \see createFromString()
220-
*/
221-
// TODO QGIS 3: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix
220+
*/ // TODO QGIS 3: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix
222221
explicit QgsCoordinateReferenceSystem( const QString &definition );
223222

224223
/** Constructor a CRS object using a postgis SRID, an EPSG code or an internal QGIS CRS ID.
225224
* \note We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code
226225
* wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.
227226
* \param id The ID valid for the chosen CRS ID type
228227
* \param type One of the types described in CrsType
229-
*/
230-
// TODO QGIS 3: remove type and always use EPSG code
228+
*/ // TODO QGIS 3: remove type and always use EPSG code
231229
explicit QgsCoordinateReferenceSystem( const long id, CrsType type = PostgisCrsId );
232230

233231
//! Copy constructor
@@ -300,8 +298,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
300298
* \note We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code
301299
* wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.
302300
* \returns True on success else false
303-
*/
304-
// TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg
301+
*/ // TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg
305302
bool createFromId( const long id, CrsType type = PostgisCrsId );
306303

307304
/**
@@ -313,15 +310,13 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
313310
* \note this method uses an internal cache. Call invalidateCache() to clear the cache.
314311
* \returns True on success else false
315312
* \see fromOgcWmsCrs()
316-
*/
317-
// TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
313+
*/ // TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
318314
bool createFromOgcWmsCrs( const QString &crs );
319315

320316
/** Sets this CRS by lookup of the given PostGIS SRID in the CRS database.
321317
* \param srid The postgis SRID for the desired spatial reference system.
322318
* \returns True on success else false
323-
*/
324-
// TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
319+
*/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
325320
bool createFromSrid( const long srid );
326321

327322
/** Sets this CRS using a WKT definition.
@@ -401,8 +396,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
401396
* passes it to createFromWkt() function.
402397
* \param definition A String containing a coordinate reference system definition.
403398
* \returns True on success else false
404-
*/
405-
// TODO QGIS3: rename to createFromStringOGR so it is clear it's similar to createFromString, just different backend
399+
*/ // TODO QGIS3: rename to createFromStringOGR so it is clear it's similar to createFromString, just different backend
406400
bool createFromUserInput( const QString &definition );
407401

408402
/** Make sure that ESRI WKT import is done properly.
@@ -435,8 +429,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
435429
* pieces of information about CRS.
436430
* \note The ellipsoid and projection acronyms must be set as well as the proj4string!
437431
* \returns long the SrsId of the matched CRS, zero if no match was found
438-
*/
439-
// TODO QGIS 3: seems completely obsolete now (only compares proj4 - already done in createFromProj4)
432+
*/ // TODO QGIS 3: seems completely obsolete now (only compares proj4 - already done in createFromProj4)
440433
long findMatchingProj();
441434

442435
/** Overloaded == operator used to compare to CRS's.
@@ -469,12 +462,12 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
469462
* QGIS uses implementation in QgisGui::customSrsValidation
470463
* \note not available in Python bindings
471464
*/
472-
static void setCustomCrsValidation( CUSTOM_CRS_VALIDATION f );
465+
static void setCustomCrsValidation( CUSTOM_CRS_VALIDATION f ) SIP_SKIP;
473466

474467
/** Gets custom function
475468
* \note not available in Python bindings
476469
*/
477-
static CUSTOM_CRS_VALIDATION customCrsValidation();
470+
static CUSTOM_CRS_VALIDATION customCrsValidation() SIP_SKIP;
478471

479472
// Accessors -----------------------------------
480473

@@ -485,8 +478,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
485478

486479
/** Returns PostGIS SRID for the CRS.
487480
* \returns the PostGIS spatial_ref_sys identifier for this CRS (defaults to 0)
488-
*/
489-
// TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
481+
*/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
490482
long postgisSrid() const;
491483

492484
/** Returns the authority identifier for the CRS.
@@ -722,6 +714,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
722714
Q_DECLARE_METATYPE( QgsCoordinateReferenceSystem )
723715

724716
//! Output stream operator
717+
#ifndef SIP_RUN
725718
inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateReferenceSystem &r )
726719
{
727720
QString mySummary( QStringLiteral( "\n\tSpatial Reference System:" ) );
@@ -766,5 +759,6 @@ inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateReferenc
766759
// Using streams we need to use local 8 Bit
767760
return os << mySummary.toLocal8Bit().data() << std::endl;
768761
}
762+
#endif
769763

770764
#endif // QGSCOORDINATEREFERENCESYSTEM_H

‎src/core/qgscoordinatetransform.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class CORE_EXPORT QgsCoordinateTransform
167167
* \param direction transform direction (defaults to ForwardTransform)
168168
* \note not available in Python bindings
169169
*/
170-
void transformInPlace( float &x, float &y, double &z, TransformDirection direction = ForwardTransform ) const;
170+
void transformInPlace( float &x, float &y, double &z, TransformDirection direction = ForwardTransform ) const SIP_SKIP;
171171

172172
/** Transforms an array of x, y and z float coordinates in place, from the source CRS to the destination CRS.
173173
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
@@ -180,7 +180,7 @@ class CORE_EXPORT QgsCoordinateTransform
180180
* \param direction transform direction (defaults to ForwardTransform)
181181
* \note not available in Python bindings
182182
*/
183-
void transformInPlace( float &x, float &y, float &z, TransformDirection direction = ForwardTransform ) const;
183+
void transformInPlace( float &x, float &y, float &z, TransformDirection direction = ForwardTransform ) const SIP_SKIP;
184184

185185
/** Transforms a vector of x, y and z float coordinates in place, from the source CRS to the destination CRS.
186186
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
@@ -194,7 +194,7 @@ class CORE_EXPORT QgsCoordinateTransform
194194
* \note not available in Python bindings
195195
*/
196196
void transformInPlace( QVector<float> &x, QVector<float> &y, QVector<float> &z,
197-
TransformDirection direction = ForwardTransform ) const;
197+
TransformDirection direction = ForwardTransform ) const SIP_SKIP;
198198

199199
/** Transforms a vector of x, y and z double coordinates in place, from the source CRS to the destination CRS.
200200
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
@@ -208,7 +208,7 @@ class CORE_EXPORT QgsCoordinateTransform
208208
* \note not available in Python bindings
209209
*/
210210
void transformInPlace( QVector<double> &x, QVector<double> &y, QVector<double> &z,
211-
TransformDirection direction = ForwardTransform ) const;
211+
TransformDirection direction = ForwardTransform ) const SIP_SKIP;
212212

213213
/** Transforms a polygon to the destination coordinate system.
214214
* \param polygon polygon to transform (occurs in place)
@@ -223,7 +223,7 @@ class CORE_EXPORT QgsCoordinateTransform
223223
* \param direction transform direction (defaults to ForwardTransform)
224224
* \returns transformed rectangle
225225
*/
226-
QgsRectangle transform( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform ) const;
226+
QgsRectangle transform( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform ) const SIP_SKIP;
227227

228228
/** Transform an array of coordinates to the destination CRS.
229229
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
@@ -243,7 +243,8 @@ class CORE_EXPORT QgsCoordinateTransform
243243
/** Returns list of datum transformations for the given src and dest CRS
244244
* \note not available in Python bindings
245245
*/
246-
static QList< QList< int > > datumTransformations( const QgsCoordinateReferenceSystem &srcCRS, const QgsCoordinateReferenceSystem &destinationCrs );
246+
static QList< QList< int > > datumTransformations( const QgsCoordinateReferenceSystem &srcCRS, const QgsCoordinateReferenceSystem &destinationCrs ) SIP_SKIP;
247+
247248
static QString datumTransformString( int datumTransform );
248249

249250
/** Gets name of source and dest geographical CRS (to show in a tooltip)
@@ -281,6 +282,7 @@ class CORE_EXPORT QgsCoordinateTransform
281282
};
282283

283284
//! Output stream operator
285+
#ifndef SIP_RUN
284286
inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateTransform &r )
285287
{
286288
QString mySummary( QStringLiteral( "\n%%%%%%%%%%%%%%%%%%%%%%%%\nCoordinate Transform def begins:" ) );
@@ -334,6 +336,7 @@ inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateTransfor
334336
mySummary += QLatin1String( "\nCoordinate Transform def ends \n%%%%%%%%%%%%%%%%%%%%%%%%\n" );
335337
return os << mySummary.toLocal8Bit().data() << std::endl;
336338
}
339+
#endif
337340

338341

339342
#endif // QGSCOORDINATETRANSFORM_H

‎src/core/qgsfeedback.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <QObject>
2020

2121
#include "qgis_core.h"
22+
#include "qgis.h"
2223

2324
/** \ingroup core
2425
* Base class for feedback objects to be used for cancelation of something running in a worker thread.
@@ -44,7 +45,7 @@ class CORE_EXPORT QgsFeedback : public QObject
4445
Q_OBJECT
4546
public:
4647
//! Construct a feedback object
47-
QgsFeedback( QObject *parent = nullptr )
48+
QgsFeedback( QObject *parent SIP_TRANSFERTHIS = nullptr )
4849
: QObject( parent )
4950
, mCanceled( false )
5051
{}

0 commit comments

Comments
 (0)
Please sign in to comment.