Skip to content

Commit 74fd0e4

Browse files
committed
more sip fixes:
- also move enum StyleEntity in QgsStyleV2 - fix some warnings
1 parent cd97358 commit 74fd0e4

24 files changed

Lines changed: 105 additions & 81 deletions

‎cmake/Flex.cmake‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,12 @@ MACRO(ADD_FLEX_FILES_PREFIX _sources prefix )
7878
)
7979

8080
SET(${_sources} ${${_sources}} ${_out} )
81+
82+
# Disable warnings
83+
IF(MSVC)
84+
SET_SOURCE_FILES_PROPERTIES(${_out} PROPERTIES COMPILE_FLAGS /W0)
85+
ELSE(MSVC)
86+
SET_SOURCE_FILES_PROPERTIES(${_out} PROPERTIES COMPILE_FLAGS -w)
87+
ENDIF(MSVC)
8188
ENDFOREACH (_current_FILE)
8289
ENDMACRO(ADD_FLEX_FILES_PREFIX)

‎python/CMakeLists.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ IF(NOT WITH_TOUCH)
5454
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_TOUCH)
5555
ENDIF(NOT WITH_TOUCH)
5656

57+
IF(NOT QT_MOBILITY_LOCATION_FOUND)
58+
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} MOBILITY_LOCATION)
59+
ENDIF(NOT QT_MOBILITY_LOCATION_FOUND)
60+
5761
IF(PYQT4_VERSION_NUM LESS 263680) # 0x040600
5862
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} PROXY_FACTORY)
5963
ENDIF(PYQT4_VERSION_NUM LESS 263680)

‎python/core/core.sip‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
%Include gps/qgsgpsdconnection.sip
121121
%Include gps/qgsgpsdetector.sip
122122
%Include gps/qgsnmeaconnection.sip
123-
// %Include gps/qgsqtlocationconnection.sip
123+
%Include gps/qgsqtlocationconnection.sip
124124

125125
%Include raster/qgscliptominmaxenhancement.sip
126126
%Include raster/qgsfreakoutshader.sip
@@ -161,7 +161,6 @@
161161
%Include renderer/qgssinglesymbolrenderer.sip
162162
%Include renderer/qgsuniquevaluerenderer.sip
163163

164-
%Include symbology-ng/qgsrendererv2.sip
165164
%Include symbology-ng/qgsstylev2.sip
166165
%Include symbology-ng/qgssvgcache.sip
167166
%Include symbology-ng/qgssymbologyv2conversion.sip
@@ -175,7 +174,8 @@
175174
%Include symbology-ng/qgssinglesymbolrendererv2.sip
176175
%Include symbology-ng/qgspointdisplacementrenderer.sip
177176
%Include symbology-ng/qgsrulebasedrendererv2.sip
178-
// %Include symbology-ng/qgsrendererv2registry.sip
177+
%Include symbology-ng/qgsrendererv2.sip
178+
%Include symbology-ng/qgsrendererv2registry.sip
179179

180180
%Include symbology-ng/qgssymbollayerv2.sip
181181
%Include symbology-ng/qgssymbollayerv2utils.sip

‎python/core/gps/qgsqtlocationconnection.sip‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
%Feature MOBILITY_LOCATION
2+
3+
%If (MOBILITY_LOCATION)
14
class QgsQtLocationConnection: QgsGPSConnection
25
{
36
%TypeHeaderCode
@@ -23,3 +26,4 @@ class QgsQtLocationConnection: QgsGPSConnection
2326
/**Called when the number of satellites in use is updated.*/
2427
void satellitesInUseUpdated( const QList<QGeoSatelliteInfo>& satellites );
2528
};
29+
%End

‎python/core/qgslabelsearchtree.sip‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class QgsLabelSearchTree
1212
void clear();
1313

1414
/**Returns label position(s) at a given point. QgsLabelSearchTree keeps ownership, don't delete the LabelPositions*/
15-
void label( const QgsPoint& p, QList<QgsLabelPosition*>& posList );
15+
// void label( const QgsPoint& p, QList<QgsLabelPosition*>& posList );
1616

1717
/**Returns label position(s) in given rectangle. QgsLabelSearchTree keeps ownership, don't delete the LabelPositions*/
18-
void labelsInRect( const QgsRectangle& r, QList<QgsLabelPosition*>& posList );
18+
// void labelsInRect( const QgsRectangle& r, QList<QgsLabelPosition*>& posList );
1919

2020
/**Inserts label position. Does not take ownership of labelPos
2121
@return true in case of success*/

‎python/core/qgsmaprenderer.sip‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class QgsLabelPosition
66
#include <qgsmaprenderer.h>
77
%End
88
public:
9-
QgsLabelPosition( int id, double r, const QVector< QgsPoint >& corners, const QgsRectangle& rect, double w, double h, const QString& layer, bool upside_down );
9+
QgsLabelPosition( int id, double r, const QVector< QgsPoint >& corners, const QgsRectangle& rect, double w, double h, const QString& layer, bool upside_down, bool diagram = false, bool pinned = false );
1010
QgsLabelPosition();
1111
int featureId;
1212
double rotation;
@@ -58,13 +58,13 @@ class QgsLabelingEngineInterface
5858
virtual QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ) = 0;
5959

6060
//! called when passing engine among map renderers
61-
virtual QgsLabelingEngineInterface* clone() = 0;
61+
virtual QgsLabelingEngineInterface* clone() = 0 /Factory/;
6262
};
6363

6464

65-
/**
66-
* \class QgsMapRenderer
67-
* \brief Class for rendering map layer set
65+
66+
/** \ingroup core
67+
* A non GUI class for rendering a map layer set onto a QPainter.
6868
*/
6969

7070
class QgsMapRenderer : QObject
@@ -245,5 +245,5 @@ class QgsMapRenderer : QObject
245245

246246
/**Creates an overlay object position manager subclass according to the current settings
247247
@note this method was added in version 1.1*/
248-
QgsOverlayObjectPositionManager* overlayManagerFromSettings();
248+
QgsOverlayObjectPositionManager* overlayManagerFromSettings() /Factory/;
249249
};

‎python/core/qgsrasterdataprovider.sip‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
403403
/** Creates a new dataset with mDataSourceURI
404404
@return true in case of success*/
405405
virtual bool create( const QString& format, int nBands,
406-
int type,
406+
QgsRasterInterface::DataType type,
407407
int width, int height, double* geoTransform,
408408
const QgsCoordinateReferenceSystem& crs,
409409
QStringList createOptions = QStringList() /*e.v. color table*/ );

‎python/core/symbology-ng/qgsrendererv2registry.sip‎

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
class QgsRendererV2Widget /External/;
2+
13
class QgsRendererV2AbstractMetadata
24
{
35
%TypeHeaderCode
46
#include <qgsrendererv2registry.h>
57
%End
8+
69
public:
710
QgsRendererV2AbstractMetadata( QString name, QString visibleName, QIcon icon = QIcon() );
811
virtual ~QgsRendererV2AbstractMetadata();
@@ -31,31 +34,17 @@ class QgsRendererV2Metadata : QgsRendererV2AbstractMetadata
3134
#include <qgsrendererv2registry.h>
3235
%End
3336
public:
34-
35-
/** construct metadata */
36-
QgsRendererV2Metadata( QString name,
37-
QString visibleName,
38-
QgsRendererV2CreateFunc pfCreate,
39-
QIcon icon = QIcon(),
40-
QgsRendererV2WidgetFunc pfWidget = NULL );
41-
42-
QgsRendererV2Metadata( QString name,
43-
QString visibleName,
44-
QgsRendererV2CreateFunc pfCreate,
45-
QgsRendererV2CreateFromSldFunc pfCreateFromSld,
46-
QIcon icon = QIcon(),
47-
QgsRendererV2WidgetFunc pfWidget = NULL );
48-
{}
49-
5037
virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) /Factory/;
5138
virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) /Factory/;
5239
virtual QgsFeatureRendererV2* createRendererFromSld( QDomElement& elem, QGis::GeometryType geomType ) /Factory/;
5340

54-
QgsRendererV2CreateFunc createFunction() const;
55-
QgsRendererV2WidgetFunc widgetFunction() const;
56-
QgsFeatureRendererV2* (*)( QDomElement&, QGis::GeometryType geomType ) createFromSldFunction() const;
41+
// QgsRendererV2CreateFunc createFunction() const;
42+
// QgsRendererV2WidgetFunc widgetFunction() const;
43+
// QgsFeatureRendererV2* (*)( QDomElement&, QGis::GeometryType geomType ) createFromSldFunction() const;
44+
// void setWidgetFunction( QgsRendererV2WidgetFunc f );
5745

58-
void setWidgetFunction( QgsRendererV2WidgetFunc f );
46+
private:
47+
QgsRendererV2Metadata(); // pretend this is private
5948
};
6049

6150
/**

‎python/core/symbology-ng/qgsstylev2.sip‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ class QgsStyleV2
99
QgsStyleV2();
1010
~QgsStyleV2();
1111

12+
//! Enum for Entities involved in a style
13+
/*!
14+
The enumerator is used for identifying the entity being operated on when generic
15+
database functions are being run.
16+
\sa group(), rename(), remove(), symbolsOfGroup(), symbolsWithTag(), symbolsOfSmartgroup()
17+
*/
18+
enum StyleEntity { SymbolEntity, GroupEntity, TagEntity, ColorrampEntity, SmartgroupEntity };
19+
1220
//! add color ramp to style. takes ramp's ownership
1321
/*!
1422
* \note Adding a color ramp with the name of existing one replaces it.
@@ -85,7 +93,7 @@ class QgsStyleV2
8593
* \param tags is the list of the tags that are to be applied as QStringList
8694
* \return returns the success state of the operation
8795
*/
88-
bool tagSymbol( int type, QString symbol, QStringList tags );
96+
bool tagSymbol( StyleEntity type, QString symbol, QStringList tags );
8997

9098
//! detags the symbol with the given list
9199
/*!
@@ -95,7 +103,7 @@ class QgsStyleV2
95103
* \param tags is the list of tags that are to be removed as QStringList
96104
* \return returns the success state of the operation
97105
*/
98-
bool detagSymbol( int type, QString symbol, QStringList tags );
106+
bool detagSymbol( StyleEntity type, QString symbol, QStringList tags );
99107

100108
//! remove symbol from style (and delete it)
101109
bool removeSymbol( QString name );
@@ -135,15 +143,15 @@ class QgsStyleV2
135143
* \param groupid is id of the group to which the symbols belong to, as int
136144
* \return A QStringList of the symbol or colorramp names for the given group id
137145
*/
138-
QStringList symbolsOfGroup( int type, int groupid );
146+
QStringList symbolsOfGroup( StyleEntity type, int groupid );
139147

140148
//! returns the symbol names with which have the given tag
141149
/*!
142150
* \param type is either SymbolEntity or ColorampEntity
143151
* \param tagid is id of the tag which has been applied over the symbol as int
144152
* \return A QStringList of the symbol or colorramp names for the given tag id
145153
*/
146-
QStringList symbolsWithTag( int type, int tagid );
154+
QStringList symbolsWithTag( StyleEntity type, int tagid );
147155

148156
//! applies the specifed group to the symbol or colorramp specified by StyleEntity
149157
/*!
@@ -152,22 +160,22 @@ class QgsStyleV2
152160
* \param groupid is the id of the group to which the entity is assigned
153161
* \return returns the success state as bool
154162
*/
155-
bool group( int type, QString name, int groupid );
163+
bool group( StyleEntity type, QString name, int groupid );
156164

157165
//! rename the given entity with the specified id
158166
/*!
159167
* \param type is any of the style entites. Refer enum StyleEntity.
160168
* \param id is the DB id of the entity which is to be renamed
161169
* \param newName is the new name of the entity
162170
*/
163-
void rename( int type, int id, QString newName );
171+
void rename( StyleEntity type, int id, QString newName );
164172

165173
//! remove the specified entity from the db
166174
/*!
167175
* \param type is any of the style entites. Refer enum StyleEntity.
168176
* \param id is the DB id of the entity to be removed
169177
*/
170-
void remove( int type, int id );
178+
void remove( StyleEntity type, int id );
171179

172180
//! add the symbol to the DB with the tags
173181
/*!
@@ -218,7 +226,7 @@ class QgsStyleV2
218226
* \param symbol is the name of the symbol or color ramp
219227
* \return A QStringList of the tags that have been applied to that symbol/colorramp
220228
*/
221-
QStringList tagsOfSymbol( int type, QString symbol );
229+
QStringList tagsOfSymbol( StyleEntity type, QString symbol );
222230

223231
//! returns the smart groups map with id as key and name as value
224232
QMap<int, QString> smartgroupsListMap();
@@ -234,7 +242,7 @@ class QgsStyleV2
234242
QString smartgroupOperator( int id );
235243

236244
//! returns the symbols for the smartgroup
237-
QStringList symbolsOfSmartgroup( int type, int id );
245+
QStringList symbolsOfSmartgroup( StyleEntity type, int id );
238246

239247
//! Exports the style as a XML file
240248
bool exportXML( QString filename );
@@ -265,5 +273,5 @@ class QgsStyleV2
265273
* \param name is the name of an existing symbol or a color ramp
266274
* \return Success state of the update operation
267275
*/
268-
bool updateSymbol( int type, QString name );
276+
bool updateSymbol( StyleEntity type, QString name );
269277
};

‎python/core/symbology-ng/qgssymbollayerv2registry.sip‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
class QgsSymbolLayerV2Widget /External/;
22

3-
typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFunc )( const QgsStringMap& );
4-
typedef QgsSymbolLayerV2Widget*( *QgsSymbolLayerV2WidgetFunc )( const QgsVectorLayer* );
5-
typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFromSldFunc )( QDomElement& );
6-
73
class QgsSymbolLayerV2AbstractMetadata
84
{
95
%TypeHeaderCode

0 commit comments

Comments
 (0)