diff --git a/python/core/composer/qgscomposermap.sip b/python/core/composer/qgscomposermap.sip index 25884aa94e4..acc4e1e4639 100644 --- a/python/core/composer/qgscomposermap.sip +++ b/python/core/composer/qgscomposermap.sip @@ -182,7 +182,7 @@ class QgsComposerMap : QgsComposerItem /**Called when atlas preview is toggled, to force map item to update its extent and redraw * @deprecated no longer required */ - void toggleAtlasPreview(); + void toggleAtlasPreview() /Deprecated/; /**Returns a pointer to the current map extent, which is either the original user specified * extent or the temporary atlas-driven feature extent depending on the current atlas state @@ -620,7 +620,7 @@ class QgsComposerMap : QgsComposerItem /** Returns true if the extent is forced to center on the overview * @deprecated use overview()->centered() or overviews() instead */ - bool overviewCentered() const; + bool overviewCentered() const /Deprecated/; /** Set the overview's centering mode * @deprecated use overview()->setCentered() or overviews() instead diff --git a/python/core/qgsexpression.sip b/python/core/qgsexpression.sip index cc2abeeddd3..081fa32e114 100644 --- a/python/core/qgsexpression.sip +++ b/python/core/qgsexpression.sip @@ -83,7 +83,7 @@ class QgsExpression double scale(); - //! Return the expression string that was given when created. + //! Alias for dump() const QString expression() const; //! Return the expression string that represents this QgsExpression. diff --git a/python/core/qgsfield.sip b/python/core/qgsfield.sip index e7adc489f46..7720d98eac6 100644 --- a/python/core/qgsfield.sip +++ b/python/core/qgsfield.sip @@ -44,7 +44,7 @@ public: bool operator!=( const QgsField& other ) const; //! Gets the name of the field - const QString & name() const; + const QString& name() const; //! Gets variant type of the field as it will be retrieved from data source QVariant::Type type() const; @@ -55,8 +55,7 @@ public: the data store reports it, with no attempt to standardize the value. @return QString containing the field type */ - const QString & typeName() const; - + const QString& typeName() const; /** Gets the length of the field. @@ -64,7 +63,6 @@ public: */ int length() const; - /** Gets the precision of the field. Not all field types have a related precision. @return int containing the precision or zero if not applicable to the field type. @@ -74,7 +72,7 @@ public: /** Returns the field comment */ - const QString & comment() const; + const QString& comment() const; /** Set the field name. @@ -105,7 +103,6 @@ public: */ void setPrecision( int precision ); - /** Set the field comment */ @@ -239,7 +236,7 @@ class QgsFields bool exists( int i ) const; //! Get field at particular index (must be in range 0..N-1) - // inline const QgsField& operator[]( int i ) const; + // const QgsField& operator[]( int i ) const; QgsField& operator[](int i) /Factory/; %MethodCode SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->count()); diff --git a/python/core/qgsstatisticalsummary.sip b/python/core/qgsstatisticalsummary.sip index e3286b1857f..74d62a15052 100644 --- a/python/core/qgsstatisticalsummary.sip +++ b/python/core/qgsstatisticalsummary.sip @@ -21,24 +21,23 @@ class QgsStatisticalSummary //! Enumeration of flags that specify statistics to be calculated enum Statistic { - Count , //!< Count - Sum, //!< Sum of values - Mean, //!< Mean of values - Median, //!< Median of values - StDev, //!< Standard deviation of values - StDevSample, //!< Sample standard deviation of values - Min, //!< Min of values - Max, //!< Max of values - Range, //!< Range of values (max - min) - Minority, //!< Minority of values - Majority, //!< Majority of values - Variety, //!< Variety (count of distinct) values - FirstQuartile, //!< First quartile - ThirdQuartile, //!< Third quartile - InterQuartileRange, //!< Inter quartile range (IQR) - All + Count, //!< Count + Sum, //!< Sum of values + Mean, //!< Mean of values + Median, //!< Median of values + StDev, //!< Standard deviation of values + StDevSample, //!< Sample standard deviation of values + Min, //!< Min of values + Max, //!< Max of values + Range, //!< Range of values (max - min) + Minority, //!< Minority of values + Majority, //!< Majority of values + Variety, //!< Variety (count of distinct) values + FirstQuartile, //!< First quartile + ThirdQuartile, //!< Third quartile + InterQuartileRange, //!< Inter quartile range (IQR) + All }; - typedef QFlags Statistics; /** Constructor for QgsStatisticalSummary @@ -130,8 +129,8 @@ class QgsStatisticalSummary * @see minority */ double majority() const; - - /** Returns the first quartile of the values. The quartile is calculated using the + + /** Returns the first quartile of the values. The quartile is calculated using the * "Tukey's hinges" method. * @see thirdQuartile * @see interQuartileRange @@ -156,4 +155,3 @@ class QgsStatisticalSummary QFlags operator|(QgsStatisticalSummary::Statistic f1, QFlags f2); - diff --git a/python/core/qgsvectorlayer.sip b/python/core/qgsvectorlayer.sip index 96b13ee631c..c43672bd523 100644 --- a/python/core/qgsvectorlayer.sip +++ b/python/core/qgsvectorlayer.sip @@ -88,15 +88,15 @@ struct QgsVectorJoinInfo #include "qgsvectorlayer.h" %End - /**Join field in the target layer*/ + /** Join field in the target layer*/ QString targetFieldName; - /**Source layer*/ + /** Source layer*/ QString joinLayerId; - /**Join field in the source layer*/ + /** Join field in the source layer*/ QString joinFieldName; - /**True if the join is cached in virtual memory*/ + /** True if the join is cached in virtual memory*/ bool memoryCache; - /**Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) + /** Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) @note not available in python bindings */ // QHash< QString, QgsAttributeMap> cachedAttributes; @@ -1130,7 +1130,7 @@ class QgsVectorLayer : QgsMapLayer /**Returns maximum value for an attribute column or invalid variant in case of error */ QVariant maximumValue( int index ); - + /** Fetches all values from a specified field name or expression. * @param fieldOrExpression field name or an expression string * @param ok will be set to false if field or expression is invalid, otherwise true @@ -1139,7 +1139,7 @@ class QgsVectorLayer : QgsMapLayer * @see getDoubleValues */ QList< QVariant > getValues( const QString &fieldOrExpression, bool &ok ); - + /** Fetches all double values from a specified field name or expression. Null values or * invalid expression results are skipped. * @param fieldOrExpression field name or an expression string evaluating to a double value diff --git a/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip b/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip index 9857c6a1b2e..ca83ec7f05c 100644 --- a/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip +++ b/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip @@ -81,8 +81,8 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2 %TypeHeaderCode #include %End - public: + QgsGraduatedSymbolRendererV2( QString attrName = QString(), QgsRangeList ranges = QgsRangeList() ); virtual ~QgsGraduatedSymbolRendererV2(); @@ -152,6 +152,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2 //! @param nclasses The number of classes to calculate (approximate for some modes) //! @note Added in 2.6 void updateClasses( QgsVectorLayer *vlayer, Mode mode, int nclasses ); + //! Evaluates the data expression and returns the list of values from the layer //! @param vlayer The layer for which to evaluate the expression //! @note Added in 2.6 @@ -180,7 +181,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2 QgsSymbolV2* symbol /Transfer/, QgsVectorColorRampV2* ramp /Transfer/, bool inverted = false, - QgsRendererRangeV2LabelFormat labelFormat=QgsRendererRangeV2LabelFormat() + QgsRendererRangeV2LabelFormat legendFormat = QgsRendererRangeV2LabelFormat() ); //! create renderer from XML element diff --git a/python/plugins/processing/algs/grass7/Grass7Algorithm.py b/python/plugins/processing/algs/grass7/Grass7Algorithm.py index 10f0e9a8de7..10563c4598c 100644 --- a/python/plugins/processing/algs/grass7/Grass7Algorithm.py +++ b/python/plugins/processing/algs/grass7/Grass7Algorithm.py @@ -369,7 +369,7 @@ class Grass7Algorithm(GeoAlgorithm): if self.grassName == 'r.horizon': command += out.name + uniqueSufix + '_0' - elif self.grassName == 'r.composite': + elif self.grassName == 'r.composite': commands.append(command) outputCommands.append(command) else: diff --git a/python/plugins/processing/algs/qgis/Eliminate.py b/python/plugins/processing/algs/qgis/Eliminate.py index 30e79f46652..23a61ec83d2 100644 --- a/python/plugins/processing/algs/qgis/Eliminate.py +++ b/python/plugins/processing/algs/qgis/Eliminate.py @@ -243,7 +243,7 @@ class Eliminate(GeoAlgorithm): # We have a candidate iGeom = geom2Eliminate.intersection(selGeom) - if iGeom == None: + if iGeom is None: continue if boundary: diff --git a/src/core/qgspointlocator.cpp b/src/core/qgspointlocator.cpp index 18bb8f8d093..79ccc6d224d 100644 --- a/src/core/qgspointlocator.cpp +++ b/src/core/qgspointlocator.cpp @@ -634,11 +634,14 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex ) QgsRectangle rect = *mExtent; if ( mTransform ) { - try { + try + { rect = mTransform->transformBoundingBox( rect, QgsCoordinateTransform::ReverseTransform ); - } catch (const QgsException& e) { + } + catch ( const QgsException& e ) + { // See http://hub.qgis.org/issues/12634 - QgsDebugMsg( QString("could not transform bounding box to map, skipping the snap filter (%1)").arg(e.what()) ); + QgsDebugMsg( QString( "could not transform bounding box to map, skipping the snap filter (%1)" ).arg( e.what() ) ); } } request.setFilterRect( rect ); @@ -652,11 +655,14 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex ) if ( mTransform ) { - try { + try + { f.geometry()->transform( *mTransform ); - } catch (const QgsException& e) { + } + catch ( const QgsException& e ) + { // See http://hub.qgis.org/issues/12634 - QgsDebugMsg( QString("could not transform geometry to map, skipping the snap for it (%1)").arg(e.what()) ); + QgsDebugMsg( QString( "could not transform geometry to map, skipping the snap for it (%1)" ).arg( e.what() ) ); continue; } } @@ -724,11 +730,14 @@ void QgsPointLocator::onFeatureAdded( QgsFeatureId fid ) if ( mTransform ) { - try { + try + { f.geometry()->transform( *mTransform ); - } catch (const QgsException& e) { + } + catch ( const QgsException& e ) + { // See http://hub.qgis.org/issues/12634 - QgsDebugMsg( QString("could not transform geometry to map, skipping the snap for it (%1)").arg(e.what()) ); + QgsDebugMsg( QString( "could not transform geometry to map, skipping the snap for it (%1)" ).arg( e.what() ) ); return; } } diff --git a/src/core/qgsproviderregistry.cpp b/src/core/qgsproviderregistry.cpp index 63b0461316b..ceba786a03f 100644 --- a/src/core/qgsproviderregistry.cpp +++ b/src/core/qgsproviderregistry.cpp @@ -408,7 +408,7 @@ QWidget* QgsProviderRegistry::selectWidget( const QString & providerKey, #if QT_VERSION >= 0x050000 QFunctionPointer QgsProviderRegistry::function( QString const & providerKey, - QString const & functionName ) + QString const & functionName ) { QLibrary myLib( library( providerKey ) ); diff --git a/src/core/qgsstatisticalsummary.h b/src/core/qgsstatisticalsummary.h index c57c383e047..a7477eea597 100644 --- a/src/core/qgsstatisticalsummary.h +++ b/src/core/qgsstatisticalsummary.h @@ -37,8 +37,8 @@ class CORE_EXPORT QgsStatisticalSummary //! Enumeration of flags that specify statistics to be calculated enum Statistic { - Count = 1, //!< Count - Sum = 2, //!< Sum of values + Count = 1, //!< Count + Sum = 2, //!< Sum of values Mean = 4, //!< Mean of values Median = 8, //!< Median of values StDev = 16, //!< Standard deviation of values diff --git a/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h b/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h index bbc0a5e7c79..caa005d1c4e 100644 --- a/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h +++ b/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h @@ -269,7 +269,6 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2 //! @note added in 2.10 void setGraduatedMethod( GraduatedMethod method ) { mGraduatedMethod = method; } - void setRotationField( QString fieldOrExpression ) override; QString rotationField() const override; diff --git a/src/gui/editorwidgets/qgsrelationreferencewidget.cpp b/src/gui/editorwidgets/qgsrelationreferencewidget.cpp index 8460b367505..9e607bf330f 100644 --- a/src/gui/editorwidgets/qgsrelationreferencewidget.cpp +++ b/src/gui/editorwidgets/qgsrelationreferencewidget.cpp @@ -535,7 +535,7 @@ void QgsRelationReferenceWidget::init() mComboBox->setCurrentIndex( mComboBox->findData( mFeature.id(), QgsAttributeTableModel::FeatureIdRole ) ); // Only connect after iterating, to have only one iterator on the referenced table at once - connect( mComboBox, SIGNAL( currentIndexChanged(int) ), this, SLOT( comboReferenceChanged( int ) ) ); + connect( mComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( comboReferenceChanged( int ) ) ); QApplication::restoreOverrideCursor(); } } diff --git a/src/gui/qgsuserinputtoolbar.cpp b/src/gui/qgsuserinputtoolbar.cpp index 9e9f2c63040..2e61a589848 100644 --- a/src/gui/qgsuserinputtoolbar.cpp +++ b/src/gui/qgsuserinputtoolbar.cpp @@ -72,9 +72,9 @@ void QgsUserInputToolBar::widgetDestroyed( QObject *obj ) } } -void QgsUserInputToolBar::paintEvent(QPaintEvent * event) +void QgsUserInputToolBar::paintEvent( QPaintEvent * event ) { - QToolBar::paintEvent(event); + QToolBar::paintEvent( event ); if ( mWidgetList.count() == 0 ) { hide(); diff --git a/src/gui/qgsuserinputtoolbar.h b/src/gui/qgsuserinputtoolbar.h index dca111d415f..d146ab0d6b8 100644 --- a/src/gui/qgsuserinputtoolbar.h +++ b/src/gui/qgsuserinputtoolbar.h @@ -31,7 +31,7 @@ class GUI_EXPORT QgsUserInputToolBar : public QToolBar void addUserInputWidget( QWidget* widget ); protected: - void paintEvent(QPaintEvent *event); + void paintEvent( QPaintEvent *event ); private slots: void widgetDestroyed( QObject* obj ); diff --git a/tests/src/core/testqgsscaleexpression.cpp b/tests/src/core/testqgsscaleexpression.cpp index 350ced7a8f2..382cc49cb5a 100644 --- a/tests/src/core/testqgsscaleexpression.cpp +++ b/tests/src/core/testqgsscaleexpression.cpp @@ -37,9 +37,9 @@ class TestQgsScaleExpression: public QObject { { QgsScaleExpression exp( "scale_linear(column, 1, 7, 2, 10)" ); - QCOMPARE( bool(exp), true ); + QCOMPARE( bool( exp ), true ); QCOMPARE( exp.type(), QgsScaleExpression::Linear ); - QCOMPARE( exp.baseExpression(), QString("column") ); + QCOMPARE( exp.baseExpression(), QString( "column" ) ); QCOMPARE( exp.minValue(), 1. ); QCOMPARE( exp.maxValue(), 7. ); QCOMPARE( exp.minSize(), 2. ); @@ -47,34 +47,34 @@ class TestQgsScaleExpression: public QObject } { QgsScaleExpression exp( "scale_exp(column, 1, 7, 2, 10, 0.5)" ); - QCOMPARE( bool(exp), true ); + QCOMPARE( bool( exp ), true ); QCOMPARE( exp.type(), QgsScaleExpression::Area ); } { QgsScaleExpression exp( "scale_exp(column, 1, 7, 2, 10, 0.57)" ); - QCOMPARE( bool(exp), true ); + QCOMPARE( bool( exp ), true ); QCOMPARE( exp.type(), QgsScaleExpression::Flannery ); } { QgsScaleExpression exp( "scale_exp(column, 1, 7, 2, 10, 0.51)" ); - QCOMPARE( bool(exp), false ); + QCOMPARE( bool( exp ), false ); QCOMPARE( exp.type(), QgsScaleExpression::Unknown ); } { QgsScaleExpression exp( "scale_exp(column, 1, 7, a, 10, 0.5)" ); - QCOMPARE( bool(exp), false ); + QCOMPARE( bool( exp ), false ); + QCOMPARE( exp.type(), QgsScaleExpression::Unknown ); + } + { + QgsScaleExpression exp( "scale_exp(column, 1, 7)" ); + QCOMPARE( bool( exp ), false ); QCOMPARE( exp.type(), QgsScaleExpression::Unknown ); } - { - QgsScaleExpression exp( "scale_exp(column, 1, 7)" ); - QCOMPARE( bool(exp), false ); - QCOMPARE( exp.type(), QgsScaleExpression::Unknown ); - } { QgsScaleExpression exp( QgsScaleExpression::Linear, "column", 1, 7, 2, 10 ); - QCOMPARE( bool(exp), true ); + QCOMPARE( bool( exp ), true ); QCOMPARE( exp.type(), QgsScaleExpression::Linear ); - QCOMPARE( exp.baseExpression(), QString("column") ); + QCOMPARE( exp.baseExpression(), QString( "column" ) ); QCOMPARE( exp.minValue(), 1. ); QCOMPARE( exp.maxValue(), 7. ); QCOMPARE( exp.minSize(), 2. );