Skip to content

Commit c1f50db

Browse files
committed
fix warnings
1 parent 8d8e56d commit c1f50db

21 files changed

+51
-42
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,15 @@ IF (PEDANTIC)
310310
# disable warnings
311311
ADD_DEFINITIONS( /wd4100 ) # unused formal parameters
312312
ADD_DEFINITIONS( /wd4127 ) # constant conditional expressions (used in Qt template classes)
313+
ADD_DEFINITIONS( /wd4231 ) # nonstandard extension used : 'identifier' before template explicit instantiation (used in Qt template classes)
314+
ADD_DEFINITIONS( /wd4251 ) # needs to have dll-interface to be used by clients of class (occurs in Qt template classes)
315+
ADD_DEFINITIONS( /wd4275 ) # non dll-interface class '...' used as base for dll-interface class '...'
313316
ADD_DEFINITIONS( /wd4505 ) # unreferenced local function has been removed (QgsRasterDataProvider::extent)
314317
ADD_DEFINITIONS( /wd4510 ) # default constructor could not be generated (sqlite3_index_info, QMap)
315318
ADD_DEFINITIONS( /wd4512 ) # assignment operator could not be generated (sqlite3_index_info)
316319
ADD_DEFINITIONS( /wd4610 ) # user defined constructor required (sqlite3_index_info)
317320
ADD_DEFINITIONS( /wd4706 ) # assignment within conditional expression (pal)
321+
ADD_DEFINITIONS( /wd4800 ) # 'int' : forcing value to bool 'true' or 'false' (performance warning)
318322
ELSE (MSVC)
319323
# add warnings via flags (not as definitions as on Mac -Wall can not be overridden per language )
320324
SET(_warnings "-Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing")

python/core/qgsexpression.sip

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class QgsExpression
3939
//! @note this method does not expect that prepare() has been called on this instance
4040
QVariant evaluate( const QgsFeature* f, const QgsFields& fields );
4141

42+
//! Evaluate the feature and return the result
43+
//! @note this method does not expect that prepare() has been called on this instance
44+
//! @note not available in python bindings
45+
// inline QVariant evaluate( const QgsFeature& f, const QgsFields& fields ) { return evaluate( &f, fields ); }
46+
4247
//! Returns true if an error occurred when evaluating last input
4348
bool hasEvalError() const;
4449
//! Returns evaluation error
@@ -63,7 +68,7 @@ class QgsExpression
6368

6469
void setScale( double scale );
6570

66-
int scale();
71+
double scale();
6772

6873
//! Return the expression string that was given when created.
6974
const QString expression() const;

python/core/qgspallabeling.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ class QgsPalLabeling : QgsLabelingEngineInterface
693693
virtual void drawLabeling( QgsRenderContext& context );
694694
//! called when we're done with rendering
695695
virtual void exit();
696+
696697
//! return infos about labels at a given (map) position
697698
//! @deprecated since 2.4 - use takeResults() and methods of QgsLabelingResults
698699
virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ) /Deprecated/;

src/app/composer/qgscomposermapwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void QgsComposerMapWidget::on_mAtlasPredefinedScaleRadio_toggled( bool checked )
250250
{
251251
// restore to fixed scale if no predefined scales exist
252252
mAtlasFixedScaleRadio->blockSignals( true );
253-
mAtlasFixedScaleRadio->setChecked( Qt::Checked );
253+
mAtlasFixedScaleRadio->setChecked( true );
254254
mAtlasFixedScaleRadio->blockSignals( false );
255255
mComposerMap->setAtlasScalingMode( QgsComposerMap::Fixed );
256256
}

src/app/legend/qgsapplegendinterface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class QgsMapLayer;
3030
* QgsLegendInterface
3131
* Abstract base class to make QgsLegend available to plugins.
3232
*/
33+
Q_NOWARN_DEPRECATED_PUSH
3334
class QgsAppLegendInterface : public QgsLegendInterface
3435
{
3536
Q_OBJECT
@@ -117,5 +118,6 @@ class QgsAppLegendInterface : public QgsLegendInterface
117118
int groupNodeToIndex( QgsLayerTreeGroup* group );
118119
void setExpanded( QgsLayerTreeNode *node, bool expand );
119120
};
121+
Q_NOWARN_DEPRECATED_POP
120122

121123
#endif //QGSLEGENDAPPIFACE_H

src/app/qgisappinterface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class QgisApp;
3232
* Only those functions "exposed" by QgisInterface can be called from within a
3333
* plugin.
3434
*/
35+
Q_NOWARN_DEPRECATED_PUSH
3536
class APP_EXPORT QgisAppInterface : public QgisInterface
3637
{
3738
Q_OBJECT
@@ -508,5 +509,6 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
508509
//! Pointer to the PluginManagerInterface object
509510
QgsAppPluginManagerInterface pluginManagerIface;
510511
};
512+
Q_NOWARN_DEPRECATED_POP
511513

512514
#endif //#define QGISAPPINTERFACE_H

src/app/qgsmaptooldeletepart.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void QgsMapToolDeletePart::canvasReleaseEvent( QMouseEvent *e )
111111
return;
112112
}
113113

114-
QgsGeometry* QgsMapToolDeletePart::partUnderPoint( QPoint point, int& fid, int& partNum )
114+
QgsGeometry* QgsMapToolDeletePart::partUnderPoint( QPoint point, QgsFeatureId& fid, int& partNum )
115115
{
116116
QgsFeature f;
117117
QgsGeometry* geomPart = new QgsGeometry();

src/app/qgsmaptooldeletepart.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ class APP_EXPORT QgsMapToolDeletePart: public QgsMapToolEdit
4343
QgsVectorLayer* vlayer;
4444
QList<QgsSnappingResult> mRecentSnappingResults;
4545

46-
QgsGeometry* partUnderPoint( QPoint p, int &fid, int &partNum );
46+
QgsGeometry* partUnderPoint( QPoint p, QgsFeatureId &fid, int &partNum );
4747

4848
/* Rubberband that shows the part being deleted*/
4949
QgsRubberBand* mRubberBand;
5050

5151
//The feature and part where the mouse cursor was pressed
5252
//This is used to check whether we are still in the same part at cursor release
53-
int mPressedFid;
53+
QgsFeatureId mPressedFid;
5454
int mPressedPartNum;
5555
};
5656

src/app/qgsmaptooldeletering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void QgsMapToolDeleteRing::canvasReleaseEvent( QMouseEvent *e )
111111
}
112112
}
113113

114-
QgsGeometry* QgsMapToolDeleteRing::ringUnderPoint( QgsPoint p, int& fid, int& partNum, int& ringNum )
114+
QgsGeometry* QgsMapToolDeleteRing::ringUnderPoint( QgsPoint p, QgsFeatureId& fid, int& partNum, int& ringNum )
115115
{
116116
//There is no clean way to find if we are inside the ring of a feature,
117117
//so we iterate over all the features visible in the canvas
@@ -120,7 +120,7 @@ QgsGeometry* QgsMapToolDeleteRing::ringUnderPoint( QgsPoint p, int& fid, int& pa
120120
QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest().setFilterRect( mCanvas->extent() ) );
121121
QgsFeature f;
122122
QgsGeometry* g;
123-
QgsGeometry* ringGeom;
123+
QgsGeometry* ringGeom = 0;
124124
QgsMultiPolygon pol;
125125
QgsPolygon tempPol;
126126
QgsGeometry* tempGeom;

src/app/qgsmaptooldeletering.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ class APP_EXPORT QgsMapToolDeleteRing : public QgsMapToolVertexEdit
5454
/*! return the geometry of the ring under the point p and sets fid to the feature id,
5555
* partNum to the part number in the feature and ringNum to the ring number in the part
5656
*/
57-
QgsGeometry* ringUnderPoint( QgsPoint p, int& fid, int& partNum, int& ringNum );
57+
QgsGeometry* ringUnderPoint( QgsPoint p, QgsFeatureId& fid, int& partNum, int& ringNum );
5858

5959
/* Rubberband that shows the ring being deleted*/
6060
QgsRubberBand* mRubberBand;
6161

6262
//The feature, part and ring the mouse was pressed in, to check we are still in the same ring at release
63-
int mPressedFid;
63+
QgsFeatureId mPressedFid;
6464
int mPressedPartNum;
6565
int mPressedRingNum;
6666
};

0 commit comments

Comments
 (0)