From f76d7301a327882bc12a0e022a2dacf62746a62e Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Wed, 11 Feb 2015 13:47:20 +0100 Subject: [PATCH] indentation update/fix (followup 9ab22bd) --- .../processing/algs/qgis/FieldsMapper.py | 3 +- .../algs/qgis/ui/FieldsMapperDialogs.py | 12 +- .../algs/qgis/ui/FieldsMappingPanel.py | 2 +- .../gui/GeometryPredicateSelectionPanel.py | 4 +- src/app/qgsbrowserdockwidget.cpp | 20 +-- src/core/pal/internalexception.h | 10 +- src/core/pal/palexception.h | 12 +- src/core/qgsexpression.h | 6 +- src/core/qgsspatialindex.cpp | 8 +- src/core/raster/qgsrasterdataprovider.h | 2 +- src/core/symbology-ng/qgsrendererv2registry.h | 4 +- .../layertree/qgscustomlayerorderwidget.cpp | 120 +++++++++--------- src/gui/qgsexpressionbuilderwidget.h | 26 ++-- src/gui/qgslonglongvalidator.h | 44 +++---- src/gui/qgsmapoverviewcanvas.cpp | 10 +- .../qgscptcitycolorrampv2dialog.cpp | 2 +- .../symbology-ng/qgssymbollayerv2widget.cpp | 50 ++++---- .../symbology-ng/qgssymbollevelsv2dialog.cpp | 8 +- .../qgssymbolv2selectordialog.cpp | 38 +++--- .../georeferencer/qgsgeorefdelegates.h | 2 +- .../georeferencer/qgsvalidateddoublespinbox.h | 66 +++++----- src/plugins/globe/qgsosgearthtilesource.h | 2 +- src/plugins/grass/qgsgrassedit.cpp | 2 +- src/plugins/grass/qgsgrassmapcalc.h | 2 +- tests/src/core/testqgscolorscheme.cpp | 2 +- tests/src/core/testqgscolorschemeregistry.cpp | 2 +- 26 files changed, 229 insertions(+), 230 deletions(-) diff --git a/python/plugins/processing/algs/qgis/FieldsMapper.py b/python/plugins/processing/algs/qgis/FieldsMapper.py index 7bf3cff6ec8..6f1a32fcfca 100644 --- a/python/plugins/processing/algs/qgis/FieldsMapper.py +++ b/python/plugins/processing/algs/qgis/FieldsMapper.py @@ -28,8 +28,7 @@ __revision__ = '$Format:%H$' from qgis.core import QgsField, QgsExpression, QgsFeature from processing.core.GeoAlgorithm import GeoAlgorithm -from processing.core.GeoAlgorithmExecutionException import \ - GeoAlgorithmExecutionException +from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException from processing.core.parameters import ParameterVector from processing.core.outputs import OutputVector from processing.tools import dataobjects, vector diff --git a/python/plugins/processing/algs/qgis/ui/FieldsMapperDialogs.py b/python/plugins/processing/algs/qgis/ui/FieldsMapperDialogs.py index 27b3ffa6040..85aba32679b 100644 --- a/python/plugins/processing/algs/qgis/ui/FieldsMapperDialogs.py +++ b/python/plugins/processing/algs/qgis/ui/FieldsMapperDialogs.py @@ -66,12 +66,12 @@ class FieldsMapperParametersPanel(ParametersPanel): item.setLayer(layers[0]) return item return ParametersPanel.getWidgetFromParameter(self, param) - + def updateDependentFields(self): sender = self.sender() if not isinstance(sender, QComboBox): return - if not sender.name in self.dependentItems: + if sender.name not in self.dependentItems: return layer = sender.itemData(sender.currentIndex()) children = self.dependentItems[sender.name] @@ -79,7 +79,7 @@ class FieldsMapperParametersPanel(ParametersPanel): widget = self.valueItems[child] if isinstance(widget, FieldsMappingPanel): widget.setLayer(layer) - + def somethingDependsOnThisParameter(self, parent): for param in self.alg.parameters: if isinstance(param, ParameterFieldsMapping): @@ -96,13 +96,13 @@ class FieldsMapperParametersDialog(AlgorithmDialog): self.mainWidget = FieldsMapperParametersPanel(self, alg) self.setMainWidget() - + def setParamValue(self, param, widget, alg=None): if isinstance(param, ParameterFieldsMapping): return param.setValue(widget.value()) return AlgorithmDialog.setParamValue(self, param, widget, alg) - + class FieldsMapperModelerParametersDialog(ModelerParametersDialog): def __init__(self, alg, model, algName=None): @@ -118,7 +118,7 @@ class FieldsMapperModelerParametersDialog(ModelerParametersDialog): if isinstance(param, ParameterFieldsMapping): return FieldsMappingPanel() return ModelerParametersDialog.getWidgetFromParameter(self, param) - + def setPreviousValues(self): ModelerParametersDialog.setPreviousValues(self) if self._algName is not None: diff --git a/python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py b/python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py index 9c055bd6ae6..a3e66f2efc5 100644 --- a/python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py +++ b/python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py @@ -454,7 +454,7 @@ class FieldsMappingPanel(QtGui.QWidget, Ui_Form): def updateLayerCombo(self): layers = dataobjects.getVectorLayers() - layers.sort(key = lambda lay: lay.name()) + layers.sort(key=lambda lay: lay.name()) for layer in layers: self.layerCombo.addItem(layer.name(), layer) diff --git a/python/plugins/processing/gui/GeometryPredicateSelectionPanel.py b/python/plugins/processing/gui/GeometryPredicateSelectionPanel.py index f53635ea633..7beee0adf9c 100644 --- a/python/plugins/processing/gui/GeometryPredicateSelectionPanel.py +++ b/python/plugins/processing/gui/GeometryPredicateSelectionPanel.py @@ -77,7 +77,7 @@ class GeometryPredicateSelectionPanel(QWidget, Ui_Form): def updatePredicates(self): if (isinstance(self.leftLayer, QgsVectorLayer) - and isinstance(self.rightLayer, QgsVectorLayer)): + and isinstance(self.rightLayer, QgsVectorLayer)): leftType = self.leftLayer.geometryType() rightType = self.rightLayer.geometryType() unusablePredicates = self.unusablePredicates[leftType][rightType] @@ -86,7 +86,7 @@ class GeometryPredicateSelectionPanel(QWidget, Ui_Form): for predicate in ParameterGeometryPredicate.predicates: widget = self.getWidget(predicate) widget.setEnabled(predicate in self.enabledPredicated - and not predicate in unusablePredicates) + and predicate not in unusablePredicates) def setRows(self, rows): widgets = [] diff --git a/src/app/qgsbrowserdockwidget.cpp b/src/app/qgsbrowserdockwidget.cpp index b78de48cecf..00898299a55 100644 --- a/src/app/qgsbrowserdockwidget.cpp +++ b/src/app/qgsbrowserdockwidget.cpp @@ -206,18 +206,18 @@ class QgsBrowserTreeFilterProxyModel : public QSortFilterProxyModel // returns true if at least one ancestor is accepted by filter bool filterAcceptsAncestor( const QModelIndex &sourceIndex ) const - { - if ( !mModel ) - return true; + { + if ( !mModel ) + return true; - QModelIndex sourceParentIndex = mModel->parent( sourceIndex ); - if ( !sourceParentIndex.isValid() ) - return false; - if ( filterAcceptsItem( sourceParentIndex ) ) - return true; + QModelIndex sourceParentIndex = mModel->parent( sourceIndex ); + if ( !sourceParentIndex.isValid() ) + return false; + if ( filterAcceptsItem( sourceParentIndex ) ) + return true; - return filterAcceptsAncestor( sourceParentIndex ); - } + return filterAcceptsAncestor( sourceParentIndex ); + } // returns true if at least one descendant s accepted by filter bool filterAcceptsDescendant( const QModelIndex &sourceIndex ) const diff --git a/src/core/pal/internalexception.h b/src/core/pal/internalexception.h index 114985492af..8d150467f10 100644 --- a/src/core/pal/internalexception.h +++ b/src/core/pal/internalexception.h @@ -52,7 +52,7 @@ namespace pal const char* what() const throw() override { return "This set is full..."; - } + } }; /** \brief Thrown when trying to access an empty dada set @@ -62,7 +62,7 @@ namespace pal const char* what() const throw() override { return "This set is empty..."; - } + } }; /** \brief Thrown when a geometry type is not like expected @@ -72,7 +72,7 @@ namespace pal const char* what() const throw() override { return "GeometryTypeId is not expected..."; - } + } }; /** \brief Thrown when a geometry type is not like expected @@ -82,7 +82,7 @@ namespace pal const char* what() const throw() override { return "Geometry Type is unknown"; - } + } }; @@ -93,7 +93,7 @@ namespace pal const char * what() const throw() override { return "No way to compute positions"; - } + } }; }; diff --git a/src/core/pal/palexception.h b/src/core/pal/palexception.h index fe0ad7967d9..dfa91bbcc0d 100644 --- a/src/core/pal/palexception.h +++ b/src/core/pal/palexception.h @@ -53,7 +53,7 @@ namespace pal const char * what() const throw() override { return "Not yet implemented... sorry"; - } + } }; /** \brief Try to access an unknown feature @@ -63,7 +63,7 @@ namespace pal const char * what() const throw() override { return "Feature not found"; - } + } }; /** \brief Try to access an unknown layer @@ -73,7 +73,7 @@ namespace pal const char * what() const throw() override { return "Layer not found"; - } + } }; /** \brief layer already exists @@ -83,7 +83,7 @@ namespace pal const char * what() const throw() override { return "Layers names must be unique"; - } + } }; /** \brief features already exists @@ -93,7 +93,7 @@ namespace pal const char * what() const throw() override { return "Features IDs must be unique within a layer"; - } + } }; /** \brief thrown when a value is not in the valid scale range @@ -109,7 +109,7 @@ namespace pal const char * what() const throw() override { return "value not allowed"; - } + } }; }; diff --git a/src/core/qgsexpression.h b/src/core/qgsexpression.h index 7e73503c485..f60caf41cbc 100644 --- a/src/core/qgsexpression.h +++ b/src/core/qgsexpression.h @@ -522,10 +522,10 @@ class CORE_EXPORT QgsExpression virtual QStringList referencedColumns() const override { QStringList lst( mNode->referencedColumns() ); foreach ( Node* n, mList->list() ) lst.append( n->referencedColumns() ); return lst; } virtual bool needsGeometry() const override { bool needs = false; foreach ( Node* n, mList->list() ) needs |= n->needsGeometry(); return needs; } - virtual void accept( Visitor& v ) const override { v.visit( *this ); } + virtual void accept( Visitor& v ) const override { v.visit( *this ); } - protected: - Node* mNode; + protected: + Node* mNode; NodeList* mList; bool mNotIn; }; diff --git a/src/core/qgsspatialindex.cpp b/src/core/qgsspatialindex.cpp index 49550c294e3..0a0e685b042 100644 --- a/src/core/qgsspatialindex.cpp +++ b/src/core/qgsspatialindex.cpp @@ -35,7 +35,7 @@ class QgisVisitor : public SpatialIndex::IVisitor : mList( list ) {} void visitNode( const INode& n ) override - { Q_UNUSED( n ); } + { Q_UNUSED( n ); } void visitData( const IData& d ) override { @@ -43,7 +43,7 @@ class QgisVisitor : public SpatialIndex::IVisitor } void visitData( std::vector& v ) override - { Q_UNUSED( v ); } + { Q_UNUSED( v ); } private: QList& mList; @@ -56,7 +56,7 @@ class QgsSpatialIndexCopyVisitor : public SpatialIndex::IVisitor : mNewIndex( newIndex ) {} void visitNode( const INode& n ) override - { Q_UNUSED( n ); } + { Q_UNUSED( n ); } void visitData( const IData& d ) override { @@ -67,7 +67,7 @@ class QgsSpatialIndexCopyVisitor : public SpatialIndex::IVisitor } void visitData( std::vector& v ) override - { Q_UNUSED( v ); } + { Q_UNUSED( v ); } private: SpatialIndex::ISpatialIndex* mNewIndex; diff --git a/src/core/raster/qgsrasterdataprovider.h b/src/core/raster/qgsrasterdataprovider.h index a2ef5e5bfae..f62a704478d 100644 --- a/src/core/raster/qgsrasterdataprovider.h +++ b/src/core/raster/qgsrasterdataprovider.h @@ -226,7 +226,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast virtual QStringList subLayers() const override { return QStringList(); - } + } /** \brief Returns the legend rendered as pixmap * diff --git a/src/core/symbology-ng/qgsrendererv2registry.h b/src/core/symbology-ng/qgsrendererv2registry.h index ea375263487..771b0d33e4d 100644 --- a/src/core/symbology-ng/qgsrendererv2registry.h +++ b/src/core/symbology-ng/qgsrendererv2registry.h @@ -107,9 +107,9 @@ class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetadata virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) override { return mCreateFunc ? mCreateFunc( elem ) : NULL; } virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) override - { return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) : NULL; } + { return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) : NULL; } virtual QgsFeatureRendererV2* createRendererFromSld( QDomElement& elem, QGis::GeometryType geomType ) override - { return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) : NULL; } + { return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) : NULL; } //! @note not available in python bindings QgsRendererV2CreateFunc createFunction() const { return mCreateFunc; } diff --git a/src/gui/layertree/qgscustomlayerorderwidget.cpp b/src/gui/layertree/qgscustomlayerorderwidget.cpp index 4ffc14ea71d..faf9ee6eec5 100644 --- a/src/gui/layertree/qgscustomlayerorderwidget.cpp +++ b/src/gui/layertree/qgscustomlayerorderwidget.cpp @@ -38,35 +38,35 @@ class CustomLayerOrderModel : public QAbstractListModel int rowCount( const QModelIndex & ) const override { return mOrder.count(); - } + } QVariant data( const QModelIndex &index, int role ) const override { QString id = mOrder.at( index.row() ); if ( role == Qt::DisplayRole ) - { - QgsMapLayer* layer = QgsMapLayerRegistry::instance()->mapLayer( id ); - if ( layer ) - return layer->name(); - } + { + QgsMapLayer* layer = QgsMapLayerRegistry::instance()->mapLayer( id ); + if ( layer ) + return layer->name(); + } - if ( role == Qt::UserRole + 1 ) - { - QgsMapLayer* layer = QgsMapLayerRegistry::instance()->mapLayer( id ); - if ( layer ) - return layer->id(); - } + if ( role == Qt::UserRole + 1 ) + { + QgsMapLayer* layer = QgsMapLayerRegistry::instance()->mapLayer( id ); + if ( layer ) + return layer->id(); + } - if ( role == Qt::CheckStateRole ) - { - QgsLayerTreeLayer* nodeLayer = mBridge->rootGroup()->findLayer( id ); - if ( nodeLayer ) - return nodeLayer->isVisible(); - } + if ( role == Qt::CheckStateRole ) + { + QgsLayerTreeLayer* nodeLayer = mBridge->rootGroup()->findLayer( id ); + if ( nodeLayer ) + return nodeLayer->isVisible(); + } - return QVariant(); - } + return QVariant(); + } bool setData( const QModelIndex &index, const QVariant &value, int role ) override { @@ -86,57 +86,57 @@ class CustomLayerOrderModel : public QAbstractListModel Qt::ItemFlags flags( const QModelIndex &index ) const override { if ( !index.isValid() ) - return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled; + return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled; return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsUserCheckable; } Qt::DropActions supportedDropActions() const override - { - return Qt::MoveAction; - } + { + return Qt::MoveAction; + } - QStringList mimeTypes() const override - { - QStringList types; - types << "application/qgis.layerorderdata"; - return types; - } + QStringList mimeTypes() const override + { + QStringList types; + types << "application/qgis.layerorderdata"; + return types; + } - QMimeData* mimeData( const QModelIndexList& indexes ) const override - { - QStringList lst; - foreach ( QModelIndex index, indexes ) + QMimeData* mimeData( const QModelIndexList& indexes ) const override + { + QStringList lst; + foreach ( QModelIndex index, indexes ) lst << data( index, Qt::UserRole + 1 ).toString(); - QMimeData* mimeData = new QMimeData(); - mimeData->setData( "application/qgis.layerorderdata", lst.join( "\n" ).toUtf8() ); - return mimeData; - } + QMimeData* mimeData = new QMimeData(); + mimeData->setData( "application/qgis.layerorderdata", lst.join( "\n" ).toUtf8() ); + return mimeData; + } - bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ) override - { - Q_UNUSED( parent ); - Q_UNUSED( column ); - - if ( action == Qt::IgnoreAction ) - return true; - - if ( !data->hasFormat( "application/qgis.layerorderdata" ) ) - return false; - - QByteArray encodedData = data->data( "application/qgis.layerorderdata" ); - QStringList lst = QString::fromUtf8( encodedData ).split( "\n" ); - - if ( row < 0 ) - row = mOrder.count(); - - beginInsertRows( QModelIndex(), row, row + lst.count() - 1 ); - for ( int i = 0; i < lst.count(); ++i ) - mOrder.insert( row + i, lst[i] ); - endInsertRows(); + bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ) override + { + Q_UNUSED( parent ); + Q_UNUSED( column ); + if ( action == Qt::IgnoreAction ) return true; - } + + if ( !data->hasFormat( "application/qgis.layerorderdata" ) ) + return false; + + QByteArray encodedData = data->data( "application/qgis.layerorderdata" ); + QStringList lst = QString::fromUtf8( encodedData ).split( "\n" ); + + if ( row < 0 ) + row = mOrder.count(); + + beginInsertRows( QModelIndex(), row, row + lst.count() - 1 ); + for ( int i = 0; i < lst.count(); ++i ) + mOrder.insert( row + i, lst[i] ); + endInsertRows(); + + return true; + } bool removeRows( int row, int count, const QModelIndex& parent ) override { diff --git a/src/gui/qgsexpressionbuilderwidget.h b/src/gui/qgsexpressionbuilderwidget.h index df0e16af811..442063e935a 100644 --- a/src/gui/qgsexpressionbuilderwidget.h +++ b/src/gui/qgsexpressionbuilderwidget.h @@ -38,28 +38,28 @@ class QgsExpressionItemSearchProxy : public QSortFilterProxyModel bool filterAcceptsRow( int source_row, const QModelIndex &source_parent ) const override { if ( source_parent == qobject_cast( sourceModel() )->invisibleRootItem()->index() ) - return true; + return true; return QSortFilterProxyModel::filterAcceptsRow( source_row, source_parent ); } - }; +}; /** An expression item that can be used in the QgsExpressionBuilderWidget tree. */ class QgsExpressionItem : public QStandardItem { -public: - enum ItemType - { - Header, - Field, - ExpressionNode - }; + public: + enum ItemType + { + Header, + Field, + ExpressionNode + }; - QgsExpressionItem( QString label, - QString expressionText, - QString helpText, - QgsExpressionItem::ItemType itemType = ExpressionNode ) + QgsExpressionItem( QString label, + QString expressionText, + QString helpText, + QgsExpressionItem::ItemType itemType = ExpressionNode ) : QStandardItem( label ) { mExpressionText = expressionText; diff --git a/src/gui/qgslonglongvalidator.h b/src/gui/qgslonglongvalidator.h index 2cbc57b2f7f..39ed3f5516d 100644 --- a/src/gui/qgslonglongvalidator.h +++ b/src/gui/qgslonglongvalidator.h @@ -47,37 +47,37 @@ class GUI_EXPORT QgsLongLongValidator : public QValidator QValidator::State validate( QString &input, int& ) const override { if ( input.isEmpty() ) - return Intermediate; + return Intermediate; if ( b >= 0 && input.startsWith( '-' ) ) return Invalid; - if ( t < 0 && input.startsWith( '+' ) ) - return Invalid; + if ( t < 0 && input.startsWith( '+' ) ) + return Invalid; - if ( input == "-" || input == "+" ) - return Intermediate; + if ( input == "-" || input == "+" ) + return Intermediate; - bool ok; - qlonglong entered = input.toLongLong( &ok ); - if ( !ok ) - return Invalid; + bool ok; + qlonglong entered = input.toLongLong( &ok ); + if ( !ok ) + return Invalid; - if ( entered >= b && entered <= t ) - return Acceptable; + if ( entered >= b && entered <= t ) + return Acceptable; - if ( entered >= 0 ) - { - // the -entered < b condition is necessary to allow people to type - // the minus last (e.g. for right-to-left languages) - return ( entered > t && -entered < b ) ? Invalid : Intermediate; - } - else - { - return ( entered < b ) ? Invalid : Intermediate; - } - } + if ( entered >= 0 ) + { + // the -entered < b condition is necessary to allow people to type + // the minus last (e.g. for right-to-left languages) + return ( entered > t && -entered < b ) ? Invalid : Intermediate; + } + else + { + return ( entered < b ) ? Invalid : Intermediate; + } + } void setBottom( qint64 bottom ) { b = bottom; } void setTop( qint64 top ) { t = top; } diff --git a/src/gui/qgsmapoverviewcanvas.cpp b/src/gui/qgsmapoverviewcanvas.cpp index e920e00827e..6711d003aae 100644 --- a/src/gui/qgsmapoverviewcanvas.cpp +++ b/src/gui/qgsmapoverviewcanvas.cpp @@ -125,11 +125,11 @@ void QgsMapOverviewCanvas::drawExtentRect() const QPolygonF& vPoly = mMapCanvas->mapSettings().visiblePolygon(); const QgsMapToPixel& cXf = mSettings.mapToPixel(); QVector< QPoint > pts; - pts.push_back( cXf.transform( QgsPoint(vPoly[0]) ).toQPointF().toPoint() ); - pts.push_back( cXf.transform( QgsPoint(vPoly[1]) ).toQPointF().toPoint() ); - pts.push_back( cXf.transform( QgsPoint(vPoly[2]) ).toQPointF().toPoint() ); - pts.push_back( cXf.transform( QgsPoint(vPoly[3]) ).toQPointF().toPoint() ); - mPanningWidget->setPolygon( QPolygon(pts) ); + pts.push_back( cXf.transform( QgsPoint( vPoly[0] ) ).toQPointF().toPoint() ); + pts.push_back( cXf.transform( QgsPoint( vPoly[1] ) ).toQPointF().toPoint() ); + pts.push_back( cXf.transform( QgsPoint( vPoly[2] ) ).toQPointF().toPoint() ); + pts.push_back( cXf.transform( QgsPoint( vPoly[3] ) ).toQPointF().toPoint() ); + mPanningWidget->setPolygon( QPolygon( pts ) ); mPanningWidget->show(); // show if hidden } diff --git a/src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp b/src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp index dd4c99f34dc..a9ef034f8bf 100644 --- a/src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp +++ b/src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp @@ -47,7 +47,7 @@ class TreeFilterProxyModel : public QSortFilterProxyModel { QgsCptCityDataItem* item = mModel->dataItem( mModel->index( sourceRow, 0, sourceParent ) ); return ( item && !( item->type() == QgsCptCityDataItem::ColorRamp ) ); - } + } // bool lessThan(const QModelIndex &left, const QModelIndex &right) const; private: diff --git a/src/gui/symbology-ng/qgssymbollayerv2widget.cpp b/src/gui/symbology-ng/qgssymbollayerv2widget.cpp index 6ab31895c9f..3881edbca67 100644 --- a/src/gui/symbology-ng/qgssymbollayerv2widget.cpp +++ b/src/gui/symbology-ng/qgssymbollayerv2widget.cpp @@ -1542,47 +1542,47 @@ class QgsSvgListModel : public QAbstractListModel { Q_UNUSED( parent ); return mSvgFiles.count(); - } + } QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const override { QString entry = mSvgFiles.at( index.row() ); if ( role == Qt::DecorationRole ) // icon - { - QPixmap pixmap; - if ( !QPixmapCache::find( entry, pixmap ) ) { - // render SVG file - QColor fill, outline; - double outlineWidth; - bool fillParam, outlineParam, outlineWidthParam; - QgsSvgCache::instance()->containsParams( entry, fillParam, fill, outlineParam, outline, outlineWidthParam, outlineWidth ); + QPixmap pixmap; + if ( !QPixmapCache::find( entry, pixmap ) ) + { + // render SVG file + QColor fill, outline; + double outlineWidth; + bool fillParam, outlineParam, outlineWidthParam; + QgsSvgCache::instance()->containsParams( entry, fillParam, fill, outlineParam, outline, outlineWidthParam, outlineWidth ); - bool fitsInCache; // should always fit in cache at these sizes (i.e. under 559 px ^ 2, or half cache size) - const QImage& img = QgsSvgCache::instance()->svgAsImage( entry, 30.0, fill, outline, outlineWidth, 3.5 /*appr. 88 dpi*/, 1.0, fitsInCache ); - pixmap = QPixmap::fromImage( img ); - QPixmapCache::insert( entry, pixmap ); + bool fitsInCache; // should always fit in cache at these sizes (i.e. under 559 px ^ 2, or half cache size) + const QImage& img = QgsSvgCache::instance()->svgAsImage( entry, 30.0, fill, outline, outlineWidth, 3.5 /*appr. 88 dpi*/, 1.0, fitsInCache ); + pixmap = QPixmap::fromImage( img ); + QPixmapCache::insert( entry, pixmap ); + } + + return pixmap; + } + else if ( role == Qt::UserRole || role == Qt::ToolTipRole ) + { + return entry; } - return pixmap; + return QVariant(); } - else if ( role == Qt::UserRole || role == Qt::ToolTipRole ) - { - return entry; - } - return QVariant(); -} - -protected: - QStringList mSvgFiles; + protected: + QStringList mSvgFiles; }; class QgsSvgGroupsModel : public QStandardItemModel { -public: - QgsSvgGroupsModel( QObject* parent ) : QStandardItemModel( parent ) + public: + QgsSvgGroupsModel( QObject* parent ) : QStandardItemModel( parent ) { QStringList svgPaths = QgsApplication::svgPaths(); QStandardItem *parentItem = invisibleRootItem(); diff --git a/src/gui/symbology-ng/qgssymbollevelsv2dialog.cpp b/src/gui/symbology-ng/qgssymbollevelsv2dialog.cpp index 406476dddd0..43c3e98b0ad 100644 --- a/src/gui/symbology-ng/qgssymbollevelsv2dialog.cpp +++ b/src/gui/symbology-ng/qgssymbollevelsv2dialog.cpp @@ -35,14 +35,14 @@ class SpinBoxDelegate : public QItemDelegate editor->setMinimum( 0 ); editor->setMaximum( 999 ); return editor; - } + } void setEditorData( QWidget *editor, const QModelIndex &index ) const override { int value = index.model()->data( index, Qt::EditRole ).toInt(); QSpinBox *spinBox = static_cast( editor ); spinBox->setValue( value ); - } + } void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override { @@ -51,12 +51,12 @@ class SpinBoxDelegate : public QItemDelegate int value = spinBox->value(); model->setData( index, value, Qt::EditRole ); - } + } void updateEditorGeometry( QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex & /*index*/ ) const override { editor->setGeometry( option.rect ); - } + } }; diff --git a/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp b/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp index 54f64b8cd2e..3cb19fcc4fd 100644 --- a/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp +++ b/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp @@ -110,31 +110,31 @@ class SymbolLayerItem : public QStandardItem QVariant data( int role ) const override { if ( role == Qt::DisplayRole || role == Qt::EditRole ) - { - if ( mIsLayer ) - return QgsSymbolLayerV2Registry::instance()->symbolLayerMetadata( mLayer->layerType() )->visibleName(); - else { - switch ( mSymbol->type() ) + if ( mIsLayer ) + return QgsSymbolLayerV2Registry::instance()->symbolLayerMetadata( mLayer->layerType() )->visibleName(); + else { - case QgsSymbolV2::Marker : return "Marker"; - case QgsSymbolV2::Fill : return "Fill"; - case QgsSymbolV2::Line : return "Line"; - default: return "Symbol"; + switch ( mSymbol->type() ) + { + case QgsSymbolV2::Marker : return "Marker"; + case QgsSymbolV2::Fill : return "Fill"; + case QgsSymbolV2::Line : return "Line"; + default: return "Symbol"; + } } } - } - if ( role == Qt::SizeHintRole ) - return QVariant( QSize( 32, 32 ) ); - if ( role == Qt::CheckStateRole ) - return QVariant(); // could be true/false + if ( role == Qt::SizeHintRole ) + return QVariant( QSize( 32, 32 ) ); + if ( role == Qt::CheckStateRole ) + return QVariant(); // could be true/false return QStandardItem::data( role ); - } + } - protected: - QgsSymbolLayerV2* mLayer; - QgsSymbolV2* mSymbol; - bool mIsLayer; + protected: + QgsSymbolLayerV2* mLayer; + QgsSymbolV2* mSymbol; + bool mIsLayer; }; ////////// diff --git a/src/plugins/georeferencer/qgsgeorefdelegates.h b/src/plugins/georeferencer/qgsgeorefdelegates.h index b2ccc861c15..58a5203274b 100644 --- a/src/plugins/georeferencer/qgsgeorefdelegates.h +++ b/src/plugins/georeferencer/qgsgeorefdelegates.h @@ -31,7 +31,7 @@ class QgsNonEditableDelegate : public QStyledItemDelegate Q_UNUSED( option ); Q_UNUSED( index ); return 0; - } + } }; class QgsDmsAndDdDelegate : public QStyledItemDelegate diff --git a/src/plugins/georeferencer/qgsvalidateddoublespinbox.h b/src/plugins/georeferencer/qgsvalidateddoublespinbox.h index 41b0a8b1451..07d0d0e5a65 100644 --- a/src/plugins/georeferencer/qgsvalidateddoublespinbox.h +++ b/src/plugins/georeferencer/qgsvalidateddoublespinbox.h @@ -28,57 +28,57 @@ class QgsValidatedDoubleSpinBox : public QDoubleSpinBox { QValidator::State state = QDoubleSpinBox::validate( input, pos ); if ( state != QValidator::Acceptable ) - { - return state; - } + { + return state; + } - // A value of zero is acceptable as intermediate result, - // but not as final entry - double val = valueFromText( input ); - if ( val == 0.0 ) - { - return QValidator::Intermediate; - } - return QValidator::Acceptable; -} + // A value of zero is acceptable as intermediate result, + // but not as final entry + double val = valueFromText( input ); + if ( val == 0.0 ) + { + return QValidator::Intermediate; + } + return QValidator::Acceptable; + } - StepEnabled stepEnabled() const override + StepEnabled stepEnabled() const override { StepEnabled mayStep = StepNone; // Zero is off limits, so handle the logic differently // (always exclude zero from the permitted interval) if ( minimum() == 0.0 ) - { - if ( value() - singleStep() > minimum() ) { - mayStep |= StepDownEnabled; + if ( value() - singleStep() > minimum() ) + { + mayStep |= StepDownEnabled; + } } - } - else // closed interval - { - if ( value() - singleStep() >= minimum() ) + else // closed interval { - mayStep |= StepDownEnabled; + if ( value() - singleStep() >= minimum() ) + { + mayStep |= StepDownEnabled; + } } - } - if ( maximum() == 0.0 ) - { - if ( value() + singleStep() < maximum() ) + if ( maximum() == 0.0 ) { - mayStep |= StepUpEnabled; + if ( value() + singleStep() < maximum() ) + { + mayStep |= StepUpEnabled; + } } - } - else - { - if ( value() + singleStep() <= maximum() ) + else { - mayStep |= StepUpEnabled; + if ( value() + singleStep() <= maximum() ) + { + mayStep |= StepUpEnabled; + } } + return mayStep; } - return mayStep; - } }; #endif diff --git a/src/plugins/globe/qgsosgearthtilesource.h b/src/plugins/globe/qgsosgearthtilesource.h index 24d07bfdae3..191152bf5f5 100644 --- a/src/plugins/globe/qgsosgearthtilesource.h +++ b/src/plugins/globe/qgsosgearthtilesource.h @@ -60,7 +60,7 @@ namespace osgEarth { //All QGIS tiles are in JPEG format return "jpg"; - } + } virtual bool supportsPersistentCaching() const { diff --git a/src/plugins/grass/qgsgrassedit.cpp b/src/plugins/grass/qgsgrassedit.cpp index eedb43c0c05..dca93427337 100644 --- a/src/plugins/grass/qgsgrassedit.cpp +++ b/src/plugins/grass/qgsgrassedit.cpp @@ -66,7 +66,7 @@ class QgsGrassEditLayer : public QgsMapCanvasItem virtual QRectF boundingRect() const override { return QRectF( 0, 0, mMapCanvas->width(), mMapCanvas->height() ); - } + } virtual void updatePosition() override { diff --git a/src/plugins/grass/qgsgrassmapcalc.h b/src/plugins/grass/qgsgrassmapcalc.h index 329da9e7a01..97dd22184c4 100644 --- a/src/plugins/grass/qgsgrassmapcalc.h +++ b/src/plugins/grass/qgsgrassmapcalc.h @@ -67,7 +67,7 @@ class QgsGrassMapcalc: public QMainWindow, private Ui::QgsGrassMapcalcBase, bool inputRegion( struct Cell_head *window, QgsCoordinateReferenceSystem & crs, bool all ) override; QStringList output( int type ) override; bool hasOutput( int type ) override - { Q_UNUSED( type ); return true; } + { Q_UNUSED( type ); return true; } /** \brief receives contentsMousePressEvent from view */ void mousePressEvent( QMouseEvent* ) override; diff --git a/tests/src/core/testqgscolorscheme.cpp b/tests/src/core/testqgscolorscheme.cpp index 03fbfe38f22..444d2cd1801 100644 --- a/tests/src/core/testqgscolorscheme.cpp +++ b/tests/src/core/testqgscolorscheme.cpp @@ -53,7 +53,7 @@ class DummyColorScheme : public QgsColorScheme virtual QgsColorScheme* clone() const override { return new DummyColorScheme(); - } + } }; diff --git a/tests/src/core/testqgscolorschemeregistry.cpp b/tests/src/core/testqgscolorschemeregistry.cpp index dafb64f2b14..c8676597241 100644 --- a/tests/src/core/testqgscolorschemeregistry.cpp +++ b/tests/src/core/testqgscolorschemeregistry.cpp @@ -54,7 +54,7 @@ class DummyColorScheme : public QgsColorScheme virtual QgsColorScheme* clone() const override { return new DummyColorScheme(); - } + } };