* fix cppcheck warnings

* some sip updates
* [API] fix spelling QgsMultiRenderChecker::drawBackround
* [API] fix spelling QgsSymbolLayerV2Utils::drawStippledBackround
* [API] fix spelling QgsMapSettings::layerTransfrom
This commit is contained in:
Juergen E. Fischer 2014-11-20 14:17:51 +01:00
parent d897aa5bde
commit a57066a48d
91 changed files with 412 additions and 300 deletions

View File

@ -355,7 +355,7 @@ class QgsComposerTableV2: QgsComposerMultiFrame
* @param frameIndex index number for frame * @param frameIndex index number for frame
* @returns row range * @returns row range
*/ */
QPair<int, int> rowRange( const QRectF extent, const int frameIndex ) const; QPair<int, int> rowRange( const QRectF &extent, const int frameIndex ) const;
/**Draws the horizontal grid lines for the table. /**Draws the horizontal grid lines for the table.
* @param painter destination painter for grid lines * @param painter destination painter for grid lines

View File

@ -52,8 +52,8 @@ class QgsColorScheme
* to colors related to the base color. * to colors related to the base color.
* @returns a list of QPairs of color and color name * @returns a list of QPairs of color and color name
*/ */
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ) = 0; const QColor &baseColor = QColor() ) = 0;
/**Returns whether the color scheme is editable /**Returns whether the color scheme is editable
* @returns true if scheme is editable * @returns true if scheme is editable
@ -68,7 +68,7 @@ class QgsColorScheme
* @returns true if colors were set successfully * @returns true if colors were set successfully
* @see isEditable * @see isEditable
*/ */
virtual bool setColors( const QgsNamedColorList colors, const QString context = QString(), const QColor baseColor = QColor() ); virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
/**Clones a color scheme /**Clones a color scheme
* @returns copy of color scheme * @returns copy of color scheme
@ -97,10 +97,10 @@ class QgsGplColorScheme : QgsColorScheme
virtual ~QgsGplColorScheme(); virtual ~QgsGplColorScheme();
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ); const QColor &baseColor = QColor() );
virtual bool setColors( const QgsNamedColorList colors, const QString context = QString(), const QColor baseColor = QColor() ); virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
protected: protected:
@ -128,7 +128,7 @@ class QgsUserColorScheme : QgsGplColorScheme
/**Constructs a new user color scheme, using a specified gpl palette file /**Constructs a new user color scheme, using a specified gpl palette file
* @param filename filename of gpl palette file stored in the users "palettes" folder * @param filename filename of gpl palette file stored in the users "palettes" folder
*/ */
QgsUserColorScheme( const QString filename ); QgsUserColorScheme( const QString &filename );
virtual ~QgsUserColorScheme(); virtual ~QgsUserColorScheme();
@ -141,7 +141,7 @@ class QgsUserColorScheme : QgsGplColorScheme
/**Sets the name for the scheme /**Sets the name for the scheme
* @param name new name * @param name new name
*/ */
void setName( const QString name ); void setName( const QString &name );
/**Erases the associated gpl palette file from the users "palettes" folder /**Erases the associated gpl palette file from the users "palettes" folder
* @returns true if erase was successful * @returns true if erase was successful
@ -175,8 +175,8 @@ class QgsRecentColorScheme : QgsColorScheme
virtual SchemeFlags flags() const; virtual SchemeFlags flags() const;
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ); const QColor &baseColor = QColor() );
QgsColorScheme* clone() const /Factory/; QgsColorScheme* clone() const /Factory/;
}; // class QgsRecentColorScheme }; // class QgsRecentColorScheme
@ -202,12 +202,12 @@ class QgsCustomColorScheme : QgsColorScheme
virtual SchemeFlags flags() const; virtual SchemeFlags flags() const;
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ); const QColor &baseColor = QColor() );
virtual bool isEditable() const; virtual bool isEditable() const;
virtual bool setColors( const QgsNamedColorList colors, const QString context = QString(), const QColor baseColor = QColor() ); virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
QgsColorScheme* clone() const /Factory/; QgsColorScheme* clone() const /Factory/;
}; // class QgsCustomColorScheme }; // class QgsCustomColorScheme
@ -232,12 +232,12 @@ class QgsProjectColorScheme : QgsColorScheme
virtual SchemeFlags flags() const; virtual SchemeFlags flags() const;
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ); const QColor &baseColor = QColor() );
virtual bool isEditable() const; virtual bool isEditable() const;
virtual bool setColors( const QgsNamedColorList colors, const QString context = QString(), const QColor baseColor = QColor() ); virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
QgsColorScheme* clone() const /Factory/; QgsColorScheme* clone() const /Factory/;
}; // class QgsProjectColorScheme }; // class QgsProjectColorScheme

View File

@ -94,7 +94,7 @@ class QgsCoordinateTransform : QObject
* @param direction TransformDirection (defaults to ForwardTransform) * @param direction TransformDirection (defaults to ForwardTransform)
* @return QgsPoint in Destination Coordinate System * @return QgsPoint in Destination Coordinate System
*/ */
QgsPoint transform( const QgsPoint p, TransformDirection direction = ForwardTransform ) const throw (QgsCsException); QgsPoint transform( const QgsPoint &p, TransformDirection direction = ForwardTransform ) const throw (QgsCsException);
/*! Transform the point specified by x,y from Source Coordinate System to Destination Coordinate System /*! Transform the point specified by x,y from Source Coordinate System to Destination Coordinate System
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS, * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
@ -118,7 +118,7 @@ class QgsCoordinateTransform : QObject
* longitude line is required * longitude line is required
* @return QgsRectangle in Destination Coordinate System * @return QgsRectangle in Destination Coordinate System
*/ */
QgsRectangle transformBoundingBox( const QgsRectangle theRect, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const throw (QgsCsException); QgsRectangle transformBoundingBox( const QgsRectangle &theRect, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const throw (QgsCsException);
// Same as for the other transform() functions, but alters the x // Same as for the other transform() functions, but alters the x
// and y variables in place. The second one works with good old-fashioned // and y variables in place. The second one works with good old-fashioned
@ -142,7 +142,7 @@ class QgsCoordinateTransform : QObject
* @param direction TransformDirection (defaults to ForwardTransform) * @param direction TransformDirection (defaults to ForwardTransform)
* @return QgsRectangle in Destination Coordinate System * @return QgsRectangle in Destination Coordinate System
*/ */
QgsRectangle transform( const QgsRectangle theRect, TransformDirection direction = ForwardTransform ) const throw (QgsCsException); QgsRectangle transform( const QgsRectangle &theRect, TransformDirection direction = ForwardTransform ) const throw (QgsCsException);
/*! Transform an array of coordinates to a different Coordinate System /*! Transform an array of coordinates to a different Coordinate System
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS, * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,

View File

@ -20,8 +20,6 @@ class QgsDataItem : QObject
int rowCount(); int rowCount();
//
virtual void refresh(); virtual void refresh();
// Create vector of children // Create vector of children
@ -56,6 +54,8 @@ class QgsDataItem : QObject
// try to process the data dropped on this item // try to process the data dropped on this item
virtual bool handleDrop( const QMimeData * /*data*/, Qt::DropAction /*action*/ ); virtual bool handleDrop( const QMimeData * /*data*/, Qt::DropAction /*action*/ );
//
enum Capability enum Capability
{ {
NoCapabilities, NoCapabilities,
@ -83,6 +83,9 @@ class QgsDataItem : QObject
QString path() const; QString path() const;
void setPath( const QString ); void setPath( const QString );
// Because QIcon (QPixmap) must not be used in outside the GUI thread, it is
// not possible to set mIcon in constructor. Either use mIconName/setIconName()
// or implement icon().
void setIcon( QIcon icon ); void setIcon( QIcon icon );
void setIconName( const QString & icon ); void setIconName( const QString & icon );

View File

@ -40,7 +40,7 @@ class QgsMapLayer : QObject
{ {
VectorLayer, VectorLayer,
RasterLayer, RasterLayer,
PluginLayer // added in 1.5 PluginLayer
}; };
/** Constructor /** Constructor
@ -58,9 +58,7 @@ class QgsMapLayer : QObject
*/ */
QgsMapLayer::LayerType type() const; QgsMapLayer::LayerType type() const;
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry /** Get this layer's unique ID, this ID is used to access this layer from map layer registry */
* @note added in 1.7
*/
QString id() const; QString id() const;
/** Set the display name of the layer /** Set the display name of the layer
@ -73,9 +71,7 @@ class QgsMapLayer : QObject
*/ */
const QString & name() const; const QString & name() const;
/** Get the original name of the layer /** Get the original name of the layer */
* @note added in 1.9
*/
const QString & originalName() const; const QString & originalName() const;
void setTitle( const QString& title ); void setTitle( const QString& title );
@ -113,7 +109,7 @@ class QgsMapLayer : QObject
QPainter::CompositionMode blendMode() const; QPainter::CompositionMode blendMode() const;
/**Synchronises with changes in the datasource /**Synchronises with changes in the datasource
@note added in version 1.6*/ */
virtual void reload(); virtual void reload();
/** Return new instance of QgsMapLayerRenderer that will be used for rendering of given context /** Return new instance of QgsMapLayerRenderer that will be used for rendering of given context
@ -190,6 +186,7 @@ class QgsMapLayer : QObject
/** stores state in Dom node /** stores state in Dom node
@param layerElement is a Dom element corresponding to ``maplayer'' tag @param layerElement is a Dom element corresponding to ``maplayer'' tag
@param document is a the dom document being written @param document is a the dom document being written
@param relativeBasePath base path for relative paths
@note @note
The Dom node corresponds to a Dom document project file XML element to be The Dom node corresponds to a Dom document project file XML element to be
@ -202,28 +199,25 @@ class QgsMapLayer : QObject
@returns true if successful @returns true if successful
*/ */
bool writeLayerXML( QDomElement& layerElement, QDomDocument& document ); bool writeLayerXML( QDomElement& layerElement, QDomDocument& document, QString relativeBasePath = QString::null );
/** Returns the given layer as a layer definition document /** Returns the given layer as a layer definition document
Layer definitions store the data source as well as styling and custom properties. Layer definitions store the data source as well as styling and custom properties.
Layer definitions can be used to load a layer and styling all from a single file. Layer definitions can be used to load a layer and styling all from a single file.
*/ */
static QDomDocument asLayerDefinition( QList<QgsMapLayer*> layers ); static QDomDocument asLayerDefinition( QList<QgsMapLayer*> layers, QString relativeBasePath = QString::null );
/** Creates a new layer from a layer defininition document /** Creates a new layer from a layer defininition document
*/ */
static QList<QgsMapLayer*> fromLayerDefinition( QDomDocument& document ); static QList<QgsMapLayer*> fromLayerDefinition( QDomDocument& document );
static QList<QgsMapLayer*> fromLayerDefinitionFile( const QString qlrfile ); static QList<QgsMapLayer*> fromLayerDefinitionFile( const QString &qlrfile );
/** Set a custom property for layer. Properties are stored in a map and saved in project file. /** Set a custom property for layer. Properties are stored in a map and saved in project file. */
* @note Added in v1.4 */
void setCustomProperty( const QString& key, const QVariant& value ); void setCustomProperty( const QString& key, const QVariant& value );
/** Read a custom property from layer. Properties are stored in a map and saved in project file. /** Read a custom property from layer. Properties are stored in a map and saved in project file. */
* @note Added in v1.4 */
QVariant customProperty( const QString& value, const QVariant& defaultValue = QVariant() ) const; QVariant customProperty( const QString& value, const QVariant& defaultValue = QVariant() ) const;
/** Remove a custom property from layer. Properties are stored in a map and saved in project file. /** Remove a custom property from layer. Properties are stored in a map and saved in project file. */
* @note Added in v1.4 */
void removeCustomProperty( const QString& key ); void removeCustomProperty( const QString& key );
@ -244,8 +238,7 @@ class QgsMapLayer : QObject
*/ */
const QgsCoordinateReferenceSystem& crs() const; const QgsCoordinateReferenceSystem& crs() const;
/** Sets layer's spatial reference system /** Sets layer's spatial reference system */
@note emitSignal added in 1.4 */
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true ); void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );
/** A convenience function to (un)capitalise the layer name */ /** A convenience function to (un)capitalise the layer name */
@ -256,7 +249,6 @@ class QgsMapLayer : QObject
* record in the users style table in their personal qgis.db) * record in the users style table in their personal qgis.db)
* @return a QString with the style file name * @return a QString with the style file name
* @see also loadNamedStyle () and saveNamedStyle (); * @see also loadNamedStyle () and saveNamedStyle ();
* @note This method was added in QGIS 1.8
*/ */
virtual QString styleURI(); virtual QString styleURI();
@ -373,6 +365,7 @@ class QgsMapLayer : QObject
*/ */
void setLegend( QgsMapLayerLegend* legend /Transfer/ ); void setLegend( QgsMapLayerLegend* legend /Transfer/ );
/** /**
* Can be null.
* @note added in 2.6 * @note added in 2.6
*/ */
QgsMapLayerLegend* legend() const; QgsMapLayerLegend* legend() const;
@ -423,9 +416,7 @@ class QgsMapLayer : QObject
/** Emit a signal that the layer name has been changed */ /** Emit a signal that the layer name has been changed */
void layerNameChanged(); void layerNameChanged();
/** Emit a signal that layer's CRS has been reset /** Emit a signal that layer's CRS has been reset */
added in 1.4
*/
void layerCrsChanged(); void layerCrsChanged();
/** By emitting this signal the layer tells that either appearance or content have been changed /** By emitting this signal the layer tells that either appearance or content have been changed
@ -439,8 +430,7 @@ class QgsMapLayer : QObject
/** This is used to send a request that any mapcanvas using this layer update its extents */ /** This is used to send a request that any mapcanvas using this layer update its extents */
void recalculateExtents(); void recalculateExtents();
/** data of layer changed /** data of layer changed */
* added in 1.5 */
void dataChanged(); void dataChanged();
/** Signal emitted when the blend mode is changed, through QgsMapLayer::setBlendMode() */ /** Signal emitted when the blend mode is changed, through QgsMapLayer::setBlendMode() */
@ -459,8 +449,7 @@ class QgsMapLayer : QObject
/** Set the extent */ /** Set the extent */
virtual void setExtent( const QgsRectangle &rect ); virtual void setExtent( const QgsRectangle &rect );
/** set whether layer is valid or not - should be used in constructor. /** set whether layer is valid or not - should be used in constructor. */
\note added in v1.5 */
void setValid( bool valid ); void setValid( bool valid );
/** called by readLayerXML(), used by children to read state specific to them from /** called by readLayerXML(), used by children to read state specific to them from
@ -474,12 +463,12 @@ class QgsMapLayer : QObject
virtual bool writeXml( QDomNode & layer_node, QDomDocument & document ); virtual bool writeXml( QDomNode & layer_node, QDomDocument & document );
/** Read custom properties from project file. Added in v1.4 /** Read custom properties from project file.
@param layerNode note to read from @param layerNode note to read from
@param keyStartsWith reads only properties starting with the specified string (or all if the string is empty)*/ @param keyStartsWith reads only properties starting with the specified string (or all if the string is empty)*/
void readCustomProperties( const QDomNode& layerNode, const QString& keyStartsWith = "" ); void readCustomProperties( const QDomNode& layerNode, const QString& keyStartsWith = "" );
/** Write custom properties to project file. Added in v1.4 */ /** Write custom properties to project file. */
void writeCustomProperties( QDomNode & layerNode, QDomDocument & doc ) const; void writeCustomProperties( QDomNode & layerNode, QDomDocument & doc ) const;
/** debugging member - invoked when a connect() is made to this object */ /** debugging member - invoked when a connect() is made to this object */

View File

@ -152,7 +152,7 @@ class QgsMapSettings
* @param layer * @param layer
* @return transform - may be null if the transform is not needed * @return transform - may be null if the transform is not needed
*/ */
const QgsCoordinateTransform* layerTransfrom( QgsMapLayer *layer ) const; const QgsCoordinateTransform* layerTransform( QgsMapLayer *layer ) const;
//! returns current extent of layer set //! returns current extent of layer set
QgsRectangle fullExtent() const; QgsRectangle fullExtent() const;

View File

@ -90,6 +90,6 @@ class QgsMultiRenderChecker
/**Draws a checkboard pattern for image backgrounds, so that transparency is visible /**Draws a checkboard pattern for image backgrounds, so that transparency is visible
* without requiring a transparent background for the image * without requiring a transparent background for the image
*/ */
static void drawBackround( QImage* image ); static void drawBackground( QImage* image );
}; };

View File

@ -22,19 +22,33 @@ class QgsRenderChecker
//only records time for actual render part //only records time for actual render part
int elapsedTime(); int elapsedTime();
void setElapsedTimeTarget( int theTarget ); void setElapsedTimeTarget( int theTarget );
/** Base directory name for the control image (with control image path /** Base directory name for the control image (with control image path
* suffixed) the path to the image will be constructed like this: * suffixed) the path to the image will be constructed like this:
* controlImagePath + '/' + mControlName + '/' + mControlName + '.png' * controlImagePath + '/' + mControlName + '/' + mControlName + '.png'
*/ */
void setControlName( const QString theName ); void setControlName( const QString &theName );
/** Prefix where the control images are kept. /** Prefix where the control images are kept.
* This will be appended to controlImagePath * This will be appended to controlImagePath
*/ */
void setControlPathPrefix( const QString theName ); void setControlPathPrefix( const QString &theName );
void setControlPathSuffix( const QString& theName );
/** Get an md5 hash that uniquely identifies an image */ /** Get an md5 hash that uniquely identifies an image */
QString imageToHash( QString theImageFile ); QString imageToHash( QString theImageFile );
void setRenderedImage( QString theImageFileName ); void setRenderedImage( QString theImageFileName );
/**
* The path of the rendered image can be retrieved through that method.
* Will return the path set with setRenderedImage() or generated in runTest()
*
* @return The path to the rendered image
*/
const QString& renderedImage();
//! @deprecated since 2.4 - use setMapSettings() //! @deprecated since 2.4 - use setMapSettings()
void setMapRenderer( QgsMapRenderer * thepMapRenderer ) /Deprecated/; void setMapRenderer( QgsMapRenderer * thepMapRenderer ) /Deprecated/;
@ -81,12 +95,33 @@ class QgsRenderChecker
*/ */
bool isKnownAnomaly( QString theDiffImageFile ); bool isKnownAnomaly( QString theDiffImageFile );
QString expectedImageFile();
protected:
/**Draws a checkboard pattern for image backgrounds, so that transparency is visible /**Draws a checkboard pattern for image backgrounds, so that transparency is visible
* without requiring a transparent background for the image * without requiring a transparent background for the image
*/ */
static void drawBackround( QImage* image ); static void drawBackground( QImage* image );
/**
* Returns the path to the expected image file
*
* @return Path to the expected image file
*/
const QString& expectedImageFile() const;
/**
* Call this to enable internal buffering of dash messages. You may later call
* dashMessages() to get access to the buffered messages. If disabled (default)
* dash messages will be sent immediately.
*
* @param enable Enable or disable buffering
*/
void enableDashBuffering( bool enable );
/**
* Get access to buffered dash messages.
* Only will return something if you call enableDashBuffering( true ); before.
*
* @return buffered dash messages
* @note not available in python bindings
*/
// const QVector<QgsDartMeasurement>& dartMeasurements() const;
}; };

View File

@ -66,7 +66,7 @@ class QgsSymbolLayerV2Utils
static QIcon symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbolV2::OutputUnit u, QSize size, const QgsMapUnitScale& scale = QgsMapUnitScale() ); static QIcon symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbolV2::OutputUnit u, QSize size, const QgsMapUnitScale& scale = QgsMapUnitScale() );
static QIcon colorRampPreviewIcon( QgsVectorColorRampV2* ramp, QSize size ); static QIcon colorRampPreviewIcon( QgsVectorColorRampV2* ramp, QSize size );
static void drawStippledBackround( QPainter* painter, QRect rect ); static void drawStippledBackground( QPainter* painter, QRect rect );
//! @note customContext parameter added in 2.6 //! @note customContext parameter added in 2.6
static QPixmap symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size, QgsRenderContext* customContext = 0 ); static QPixmap symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size, QgsRenderContext* customContext = 0 );
@ -216,7 +216,7 @@ class QgsSymbolLayerV2Utils
* @see colorFromMimeData * @see colorFromMimeData
* @note added in 2.5 * @note added in 2.5
*/ */
static QMimeData * colorToMimeData( const QColor color ); static QMimeData *colorToMimeData( const QColor &color );
/** /**
* Attempts to parse mime data as a color * Attempts to parse mime data as a color
@ -227,7 +227,7 @@ class QgsSymbolLayerV2Utils
* invalid color * invalid color
* @note added in 2.5 * @note added in 2.5
*/ */
static QColor colorFromMimeData( const QMimeData * mimeData, bool& hasAlpha ); static QColor colorFromMimeData( const QMimeData *data, bool& hasAlpha );
/** /**
* Attempts to parse mime data as a list of named colors * Attempts to parse mime data as a list of named colors
@ -297,9 +297,7 @@ class QgsSymbolLayerV2Utils
/**Multiplies opacity of image pixel values with a (global) transparency value*/ /**Multiplies opacity of image pixel values with a (global) transparency value*/
static void multiplyImageOpacity( QImage* image, qreal alpha ); static void multiplyImageOpacity( QImage* image, qreal alpha );
/** Blurs an image in place, e.g. creating Qt-independent drop shadows /** Blurs an image in place, e.g. creating Qt-independent drop shadows */
* @note added in 1.9
*/
static void blurImageInPlace( QImage& image, const QRect& rect, int radius, bool alphaOnly ); static void blurImageInPlace( QImage& image, const QRect& rect, int radius, bool alphaOnly );
/** Converts a QColor into a premultiplied ARGB QColor value using a specified alpha value /** Converts a QColor into a premultiplied ARGB QColor value using a specified alpha value
@ -330,6 +328,12 @@ class QgsSymbolLayerV2Utils
//! Calculate the centroid point of a QPolygonF //! Calculate the centroid point of a QPolygonF
static QPointF polygonCentroid( const QPolygonF& points ); static QPointF polygonCentroid( const QPolygonF& points );
//! Calculate a point within of a QPolygonF
static QPointF polygonPointOnSurface( const QPolygonF& points );
//! Calculate whether a point is within of a QPolygonF
static bool pointInPolygon( const QPolygonF &points, const QPointF &point );
/** Return a new valid expression instance for given field or expression string. /** Return a new valid expression instance for given field or expression string.
* If the input is not a valid expression, it is assumed that it is a field name and gets properly quoted. * If the input is not a valid expression, it is assumed that it is a field name and gets properly quoted.
* If the string is empty, returns null pointer. * If the string is empty, returns null pointer.
@ -345,4 +349,5 @@ class QgsSymbolLayerV2Utils
* @note added in 2.2 * @note added in 2.2
*/ */
static QString fieldOrExpressionFromExpression( QgsExpression* expression ); static QString fieldOrExpressionFromExpression( QgsExpression* expression );
}; };

View File

@ -25,18 +25,40 @@ class QgsAttributeForm : QWidget
const QgsFeature& feature(); const QgsFeature& feature();
/**
* Hides the button box (Ok/Cancel) and enables auto-commit
*/
void hideButtonBox(); void hideButtonBox();
/**
* Shows the button box (Ok/Cancel) and disables auto-commit
*/
void showButtonBox(); void showButtonBox();
/**
* Disconnects the button box (Ok/Cancel) from the accept/resetValues slots
* If this method is called, you have to create these connections from outside
*/
void disconnectButtonBox();
/** /**
* Takes ownership * Takes ownership
* @param iface * @param iface
*/ */
void addInterface( QgsAttributeFormInterface* iface /Transfer/ ); void addInterface( QgsAttributeFormInterface* iface /Transfer/ );
/**
* Returns the layer for which this form is shown
*
* @return Layer
*/
QgsVectorLayer* layer(); QgsVectorLayer* layer();
/**
* Returns if the form is currently in editable mode.
*
* @return Editable mode of this form
*/
bool editable(); bool editable();
/** /**
@ -55,6 +77,16 @@ class QgsAttributeForm : QWidget
*/ */
void setEditCommandMessage( const QString& message ); void setEditCommandMessage( const QString& message );
/**
* Intercepts keypress on custom form (escape should not close it)
*
* @param object The object for which the event has been sent
* @param event The event which is being filtered
*
* @return true if the event has been handled (key was ESC)
*/
bool eventFilter( QObject* object, QEvent* event );
signals: signals:
/** /**
* Notifies about changes of attributes * Notifies about changes of attributes
@ -80,9 +112,28 @@ class QgsAttributeForm : QWidget
void featureSaved( const QgsFeature& feature ); void featureSaved( const QgsFeature& feature );
public slots: public slots:
/**
* Call this to change the content of a given attribute. Will update the editor(s) related to this field.
*
* @param field The field to change
* @param value The new value
*/
void changeAttribute( const QString& field, const QVariant& value ); void changeAttribute( const QString& field, const QVariant& value );
/**
* Update all editors to correspond to a different feature.
*
* @param feature The feature which will be represented by the form
*/
void setFeature( const QgsFeature& feature ); void setFeature( const QgsFeature& feature );
/**
* Save all the values from the editors to the layer.
*
* @return True if successful
*/
bool save(); bool save();
/** /**
* Alias for save() * Alias for save()
* *
@ -97,5 +148,8 @@ class QgsAttributeForm : QWidget
*/ */
void reject() /Deprecated/; void reject() /Deprecated/;
/**
* Sets all values to the values of the current feature
*/
void resetValues(); void resetValues();
}; };

View File

@ -33,6 +33,8 @@ class QgsColorButtonV2: QToolButton
virtual ~QgsColorButtonV2(); virtual ~QgsColorButtonV2();
virtual QSize sizeHint() const;
/**Return the currently selected color. /**Return the currently selected color.
* @returns currently selected color * @returns currently selected color
* @see setColor * @see setColor
@ -206,7 +208,7 @@ class QgsColorButtonV2: QToolButton
* @param color Color for button background. If no color is specified, the button's current * @param color Color for button background. If no color is specified, the button's current
* color will be used * color will be used
*/ */
void setButtonBackground( const QColor color = QColor() ); void setButtonBackground( const QColor &color = QColor() );
/**Copies the current color to the clipboard /**Copies the current color to the clipboard
* @see pasteColor * @see pasteColor
@ -248,7 +250,7 @@ class QgsColorButtonV2: QToolButton
* @see setBehaviour * @see setBehaviour
* @see behaviour * @see behaviour
*/ */
void colorClicked( const QColor color ); void colorClicked( const QColor &color );
protected: protected:

View File

@ -108,7 +108,7 @@ class QgsColorDialogV2 : QDialog
/**Sets the current color for the dialog /**Sets the current color for the dialog
* @param color desired color * @param color desired color
*/ */
void setColor( const QColor color ); void setColor( const QColor &color );
protected: protected:

View File

@ -37,7 +37,7 @@ class QgsColorSchemeModel: QAbstractItemModel
* @param baseColor base color for color scheme * @param baseColor base color for color scheme
* @param parent parent object * @param parent parent object
*/ */
explicit QgsColorSchemeModel( QgsColorScheme* scheme, const QString context = QString(), const QColor baseColor = QColor(), QObject* parent /TransferThis/ = 0 ); explicit QgsColorSchemeModel( QgsColorScheme* scheme, const QString context = QString(), const QColor &baseColor = QColor(), QObject* parent /TransferThis/ = 0 );
~QgsColorSchemeModel(); ~QgsColorSchemeModel();
@ -67,7 +67,7 @@ class QgsColorSchemeModel: QAbstractItemModel
* @param context context for color scheme * @param context context for color scheme
* @param baseColor base color for color scheme * @param baseColor base color for color scheme
*/ */
void setScheme( QgsColorScheme* scheme, const QString context = QString(), const QColor baseColor = QColor() ); void setScheme( QgsColorScheme* scheme, const QString &context = QString(), const QColor &baseColor = QColor() );
/**Get the current color scheme context for the model /**Get the current color scheme context for the model
* @returns context string which is passed to scheme for color generation * @returns context string which is passed to scheme for color generation
@ -114,7 +114,7 @@ class QgsColorSchemeList: QTreeView
* @param context context string provided to color scheme * @param context context string provided to color scheme
* @param baseColor base color for color scheme * @param baseColor base color for color scheme
*/ */
QgsColorSchemeList( QWidget *parent /TransferThis/ = 0, QgsColorScheme* scheme = 0, const QString context = QString(), const QColor baseColor = QColor() ); QgsColorSchemeList( QWidget *parent /TransferThis/ = 0, QgsColorScheme* scheme = 0, const QString &context = QString(), const QColor &baseColor = QColor() );
virtual ~QgsColorSchemeList(); virtual ~QgsColorSchemeList();
@ -148,7 +148,7 @@ class QgsColorSchemeList: QTreeView
* @param context context string provided to color scheme * @param context context string provided to color scheme
* @param baseColor base color for color scheme * @param baseColor base color for color scheme
*/ */
void setScheme( QgsColorScheme* scheme, const QString context = QString(), const QColor baseColor = QColor() ); void setScheme( QgsColorScheme* scheme, const QString &context = QString(), const QColor &baseColor = QColor() );
/**Removes any selected colors from the list /**Removes any selected colors from the list
*/ */
@ -158,7 +158,7 @@ class QgsColorSchemeList: QTreeView
* @param color color to add * @param color color to add
* @param label optional label for color * @param label optional label for color
*/ */
void addColor( const QColor color, const QString label = QString() ); void addColor( const QColor &color, const QString &label = QString() );
/**Pastes colors from clipboard to the list /**Pastes colors from clipboard to the list
* @see copyColors * @see copyColors
@ -175,7 +175,7 @@ class QgsColorSchemeList: QTreeView
/**Emitted when a color is selected from the list /**Emitted when a color is selected from the list
* @param color color selected * @param color color selected
*/ */
void colorSelected( const QColor color ); void colorSelected( const QColor &color );
protected: protected:

View File

@ -6,7 +6,6 @@
* @see QgsColorGridAction * @see QgsColorGridAction
* @note introduced in QGIS 2.5 * @note introduced in QGIS 2.5
*/ */
class QgsColorSwatchGrid : QWidget class QgsColorSwatchGrid : QWidget
{ {
%TypeHeaderCode %TypeHeaderCode
@ -52,7 +51,7 @@ class QgsColorSwatchGrid: QWidget
* @param baseColor base color to pass to scheme for color generation * @param baseColor base color to pass to scheme for color generation
* @see baseColor * @see baseColor
*/ */
void setBaseColor( const QColor baseColor ); void setBaseColor( const QColor &baseColor );
/**Gets the list of colors shown in the grid /**Gets the list of colors shown in the grid
* @returns list of colors currently shown in the grid * @returns list of colors currently shown in the grid
@ -70,13 +69,15 @@ class QgsColorSwatchGrid: QWidget
/**Emitted when a color has been selected from the widget /**Emitted when a color has been selected from the widget
* @param color selected color * @param color selected color
*/ */
void colorChanged( const QColor color ); void colorChanged( const QColor &color );
/**Emitted when mouse hovers over widget /**Emitted when mouse hovers over widget
*/ */
void hovered(); void hovered();
protected: protected:
//reimplemented QWidget events
void paintEvent( QPaintEvent * event ); void paintEvent( QPaintEvent * event );
void mouseMoveEvent( QMouseEvent * event ); void mouseMoveEvent( QMouseEvent * event );
void mousePressEvent( QMouseEvent * event ); void mousePressEvent( QMouseEvent * event );
@ -87,6 +88,7 @@ class QgsColorSwatchGrid: QWidget
}; };
/** \ingroup gui /** \ingroup gui
* \class QgsColorGridAction * \class QgsColorGridAction
* A color swatch grid which can be embedded into a menu. * A color swatch grid which can be embedded into a menu.
@ -117,7 +119,7 @@ class QgsColorSwatchGridAction: QWidgetAction
* @param baseColor base color to pass to scheme for color generation * @param baseColor base color to pass to scheme for color generation
* @see baseColor * @see baseColor
*/ */
void setBaseColor( const QColor baseColor ); void setBaseColor( const QColor &baseColor );
/**Get the base color for the color grid /**Get the base color for the color grid
* @returns base color which is passed to scheme for color generation * @returns base color which is passed to scheme for color generation
@ -148,6 +150,6 @@ class QgsColorSwatchGridAction: QWidgetAction
/**Emitted when a color has been selected from the widget /**Emitted when a color has been selected from the widget
* @param color selected color * @param color selected color
*/ */
void colorChanged( const QColor color ); void colorChanged( const QColor &color );
}; };

View File

@ -60,7 +60,7 @@ class QgsColorWidget : QWidget
/**Create an icon for dragging colors /**Create an icon for dragging colors
* @param color for icon * @param color for icon
*/ */
static QPixmap createDragIcon( const QColor color ); static QPixmap createDragIcon( const QColor &color );
public slots: public slots:
@ -69,7 +69,7 @@ class QgsColorWidget : QWidget
* @param emitSignals set to true to emit the colorChanged signal after setting color * @param emitSignals set to true to emit the colorChanged signal after setting color
* @see color * @see color
*/ */
virtual void setColor( const QColor color, const bool emitSignals = false ); virtual void setColor( const QColor &color, const bool emitSignals = false );
/**Sets the color component which the widget controls /**Sets the color component which the widget controls
* @param component color component for widget * @param component color component for widget
@ -92,7 +92,7 @@ class QgsColorWidget : QWidget
/**Emitted when the widget's color changes /**Emitted when the widget's color changes
* @param color new widget color * @param color new widget color
*/ */
void colorChanged( const QColor color ); void colorChanged( const QColor &color );
protected: protected:
@ -167,7 +167,7 @@ class QgsColorWheel : QgsColorWidget
public slots: public slots:
virtual void setColor( const QColor color, const bool emitSignals = false ); virtual void setColor( const QColor &color, const bool emitSignals = false );
protected: protected:
@ -211,8 +211,7 @@ class QgsColorBox : QgsColorWidget
virtual void setComponent( const ColorComponent component ); virtual void setComponent( const ColorComponent component );
public slots: public slots:
virtual void setColor( const QColor &color, const bool emitSignals = false );
virtual void setColor( const QColor color, const bool emitSignals = false );
protected: protected:
@ -339,7 +338,7 @@ class QgsColorSliderWidget : QgsColorWidget
virtual void setComponent( const ColorComponent component ); virtual void setComponent( const ColorComponent component );
virtual void setComponentValue( const int value ); virtual void setComponentValue( const int value );
virtual void setColor( const QColor color, const bool emitSignals = false ); virtual void setColor( const QColor &color, const bool emitSignals = false );
}; };
@ -366,7 +365,7 @@ class QgsColorTextWidget : QgsColorWidget
virtual ~QgsColorTextWidget(); virtual ~QgsColorTextWidget();
virtual void setColor( const QColor color, const bool emitSignals = false ); virtual void setColor( const QColor &color, const bool emitSignals = false );
protected: protected:
void resizeEvent( QResizeEvent * event ); void resizeEvent( QResizeEvent * event );

View File

@ -20,7 +20,7 @@ class QgsRasterHistogramWidget : QWidget
bool computeHistogram( bool forceComputeFlag ); bool computeHistogram( bool forceComputeFlag );
/** Apply a histoActionTriggered() event. */ /** Apply a histoActionTriggered() event. */
void histoAction( const QString actionName, bool actionFlag = true ); void histoAction( const QString &actionName, bool actionFlag = true );
/** Apply a histoActionTriggered() event. */ /** Apply a histoActionTriggered() event. */
void setSelectedBand( int index ); void setSelectedBand( int index );

View File

@ -105,7 +105,7 @@ void Bezier3D::calcSecDer( float t, Vector3D* v )
} }
void Bezier3D::changeDirection()//does this work correctli? more testing is needed. void Bezier3D::changeDirection()//does this work correctly? more testing is needed.
{ {
if ( mControlPoly ) if ( mControlPoly )
{ {
@ -119,6 +119,7 @@ void Bezier3D::changeDirection()//does this work correctli? more testing is need
{ {
mControlPoly->insert( i, pointer[( mControlPoly->count()-1 )-i] ); mControlPoly->insert( i, pointer[( mControlPoly->count()-1 )-i] );
} }
delete [] pointer;
} }
else else

View File

@ -56,6 +56,8 @@ class QwtPolarCurve::PrivateData
QwtSymbol *symbol; QwtSymbol *symbol;
QPen pen; QPen pen;
QwtCurveFitter *curveFitter; QwtCurveFitter *curveFitter;
private:
Q_DISABLE_COPY(PrivateData)
}; };
//! Constructor //! Constructor

View File

@ -58,6 +58,7 @@ class QWT_POLAR_EXPORT QwtPolarItemDict
class PrivateData; class PrivateData;
PrivateData *d_data; PrivateData *d_data;
Q_DISABLE_COPY( QwtPolarItemDict )
}; };
#endif #endif

View File

@ -76,6 +76,7 @@ class QWT_POLAR_EXPORT QwtPolarLayout
private: private:
class PrivateData; class PrivateData;
PrivateData *d_data; PrivateData *d_data;
Q_DISABLE_COPY(QwtPolarLayout)
}; };
#endif #endif

View File

@ -40,6 +40,9 @@ class QwtPolarMarker::PrivateData
QwtSymbol *symbol; QwtSymbol *symbol;
QwtPolarPoint pos; QwtPolarPoint pos;
private:
Q_DISABLE_COPY(PrivateData)
}; };
//! Sets alignment to Qt::AlignCenter, and style to NoLine //! Sets alignment to Qt::AlignCenter, and style to NoLine

View File

@ -68,10 +68,15 @@ class QwtPolarSpectrogram::PrivateData
~PrivateData() ~PrivateData()
{ {
delete data;
delete colorMap;
} }
QwtRasterData *data; QwtRasterData *data;
QwtColorMap *colorMap; QwtColorMap *colorMap;
private:
Q_DISABLE_COPY(PrivateData)
}; };
//! Constructor //! Constructor

View File

@ -61,6 +61,8 @@ public:
QwtCurveFitter *curveFitter; QwtCurveFitter *curveFitter;
QwtPolarCurve::LegendAttributes legendAttributes; QwtPolarCurve::LegendAttributes legendAttributes;
private:
Q_DISABLE_COPY(PrivateData)
}; };
//! Constructor //! Constructor

View File

@ -50,6 +50,7 @@ private:
class PrivateData; class PrivateData;
PrivateData *d_data; PrivateData *d_data;
Q_DISABLE_COPY(QwtPolarItemDict);
}; };
#endif #endif

View File

@ -71,6 +71,8 @@ protected:
private: private:
class PrivateData; class PrivateData;
PrivateData *d_data; PrivateData *d_data;
Q_DISABLE_COPY(QwtPolarLayout)
}; };
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarLayout::Options ) Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarLayout::Options )

View File

@ -35,6 +35,8 @@ public:
const QwtSymbol *symbol; const QwtSymbol *symbol;
QwtPointPolar pos; QwtPointPolar pos;
private:
Q_DISABLE_COPY(PrivateData)
}; };
//! Sets alignment to Qt::AlignCenter, and style to NoLine //! Sets alignment to Qt::AlignCenter, and style to NoLine

View File

@ -102,6 +102,7 @@ public:
~PrivateData() ~PrivateData()
{ {
delete colorMap;
} }
QwtRasterData *data; QwtRasterData *data;
@ -110,6 +111,8 @@ public:
uint renderThreadCount; uint renderThreadCount;
QwtPolarSpectrogram::PaintAttributes paintAttributes; QwtPolarSpectrogram::PaintAttributes paintAttributes;
private:
Q_DISABLE_COPY(PrivateData)
}; };
//! Constructor //! Constructor

View File

@ -165,6 +165,7 @@ void myPrint( const char *fmt, ... )
#else #else
vfprintf( stderr, fmt, ap ); vfprintf( stderr, fmt, ap );
#endif #endif
va_end( ap );
} }
static void dumpBacktrace( unsigned int depth ) static void dumpBacktrace( unsigned int depth )

View File

@ -1665,7 +1665,7 @@ int QgsComposerMapGrid::xGridLinesCRSTransform( const QgsRectangle& bbox, const
QList<QPolygonF> lineSegments = trimLinesToMap( gridLine, QgsRectangle( mComposerMap->rect() ) ); QList<QPolygonF> lineSegments = trimLinesToMap( gridLine, QgsRectangle( mComposerMap->rect() ) );
QList<QPolygonF>::const_iterator lineIt = lineSegments.constBegin(); QList<QPolygonF>::const_iterator lineIt = lineSegments.constBegin();
for ( ; lineIt != lineSegments.constEnd(); lineIt ++ ) for ( ; lineIt != lineSegments.constEnd(); ++lineIt )
{ {
if (( *lineIt ).size() > 0 ) if (( *lineIt ).size() > 0 )
{ {
@ -1731,7 +1731,7 @@ int QgsComposerMapGrid::yGridLinesCRSTransform( const QgsRectangle& bbox, const
//clip grid line to map polygon //clip grid line to map polygon
QList<QPolygonF> lineSegments = trimLinesToMap( gridLine, QgsRectangle( mComposerMap->rect() ) ); QList<QPolygonF> lineSegments = trimLinesToMap( gridLine, QgsRectangle( mComposerMap->rect() ) );
QList<QPolygonF>::const_iterator lineIt = lineSegments.constBegin(); QList<QPolygonF>::const_iterator lineIt = lineSegments.constBegin();
for ( ; lineIt != lineSegments.constEnd(); lineIt ++ ) for ( ; lineIt != lineSegments.constEnd(); ++lineIt )
{ {
if (( *lineIt ).size() > 0 ) if (( *lineIt ).size() > 0 )
{ {
@ -2331,7 +2331,7 @@ QList<QPolygonF> QgsComposerMapGrid::trimLinesToMap( const QPolygonF& line, cons
QList<QPolygonF> trimmedLines; QList<QPolygonF> trimmedLines;
QList<QgsGeometry*>::const_iterator geomIt = intersectedParts.constBegin(); QList<QgsGeometry*>::const_iterator geomIt = intersectedParts.constBegin();
for ( ; geomIt != intersectedParts.constEnd(); geomIt++ ) for ( ; geomIt != intersectedParts.constEnd(); ++geomIt )
{ {
trimmedLines << ( *geomIt )->asQPolygonF(); trimmedLines << ( *geomIt )->asQPolygonF();
} }

View File

@ -191,7 +191,7 @@ int QgsComposerTableV2::rowsVisible( const double frameHeight, const bool includ
return qMax( floor( contentHeight / rowHeight ), 0.0 ); return qMax( floor( contentHeight / rowHeight ), 0.0 );
} }
QPair< int, int > QgsComposerTableV2::rowRange( const QRectF extent, const int frameIndex ) const QPair< int, int > QgsComposerTableV2::rowRange( const QRectF &extent, const int frameIndex ) const
{ {
//calculate row height //calculate row height
if ( frameIndex >= frameCount() ) if ( frameIndex >= frameCount() )

View File

@ -432,7 +432,7 @@ class CORE_EXPORT QgsComposerTableV2: public QgsComposerMultiFrame
* @param frameIndex index number for frame * @param frameIndex index number for frame
* @returns row range * @returns row range
*/ */
QPair<int, int> rowRange( const QRectF extent, const int frameIndex ) const; QPair<int, int> rowRange( const QRectF &extent, const int frameIndex ) const;
/**Draws the horizontal grid lines for the table. /**Draws the horizontal grid lines for the table.
* @param painter destination painter for grid lines * @param painter destination painter for grid lines

View File

@ -73,6 +73,7 @@ namespace pal
va_list list; va_list list;
va_start( list, fmt ); va_start( list, fmt );
vfprintf( stderr, fmt, list ); vfprintf( stderr, fmt, list );
va_end( list );
} }
void geosNotice( const char *fmt, ... ) void geosNotice( const char *fmt, ... )
@ -80,6 +81,7 @@ namespace pal
va_list list; va_list list;
va_start( list, fmt ); va_start( list, fmt );
vfprintf( stdout, fmt, list ); vfprintf( stdout, fmt, list );
va_end( list );
} }
GEOSContextHandle_t geosContext() GEOSContextHandle_t geosContext()

View File

@ -364,7 +364,7 @@ namespace pal
// iterate on all shape points except points which are in the hole // iterate on all shape points except points which are in the hole
double isValid; bool isValid;
int k, l; int k, l;
for ( i = ( cHull[holeE] + 1 ) % nbp; i != ( cHull[holeS] - 1 + nbp ) % nbp; i = j ) for ( i = ( cHull[holeE] + 1 ) % nbp; i != ( cHull[holeS] - 1 + nbp ) % nbp; i = j )
{ {

View File

@ -87,6 +87,9 @@ namespace pal
int getId( int key ); int getId( int key );
private:
PriorityQueue( const PriorityQueue & );
PriorityQueue &operator=( const PriorityQueue & );
}; };
} // namespace } // namespace

View File

@ -155,10 +155,10 @@ namespace pal
~Iterator() { } ~Iterator() { }
/// Is iterator invalid /// Is iterator invalid
bool IsNull() { return ( m_tos <= 0 ); } bool IsNull() const { return ( m_tos <= 0 ); }
/// Is iterator pointing to valid data /// Is iterator pointing to valid data
bool IsNotNull() { return ( m_tos > 0 ); } bool IsNotNull() const { return ( m_tos > 0 ); }
/// Access the current data element. Caller must be sure iterator is not NULL first. /// Access the current data element. Caller must be sure iterator is not NULL first.
DATATYPE& operator*() DATATYPE& operator*()

View File

@ -34,7 +34,7 @@ QgsColorScheme::~QgsColorScheme()
} }
bool QgsColorScheme::setColors( const QgsNamedColorList colors, const QString context, const QColor baseColor ) bool QgsColorScheme::setColors( const QgsNamedColorList &colors, const QString &context, const QColor &baseColor )
{ {
//base implementation does nothing //base implementation does nothing
Q_UNUSED( colors ); Q_UNUSED( colors );
@ -58,8 +58,7 @@ QgsRecentColorScheme::~QgsRecentColorScheme()
} }
QgsNamedColorList QgsRecentColorScheme::fetchColors( const QString context, QgsNamedColorList QgsRecentColorScheme::fetchColors( const QString &context, const QColor &baseColor )
const QColor baseColor )
{ {
Q_UNUSED( context ); Q_UNUSED( context );
Q_UNUSED( baseColor ); Q_UNUSED( baseColor );
@ -93,7 +92,7 @@ QgsCustomColorScheme::~QgsCustomColorScheme()
} }
QgsNamedColorList QgsCustomColorScheme::fetchColors( const QString context, const QColor baseColor ) QgsNamedColorList QgsCustomColorScheme::fetchColors( const QString &context, const QColor &baseColor )
{ {
Q_UNUSED( context ); Q_UNUSED( context );
Q_UNUSED( baseColor ); Q_UNUSED( baseColor );
@ -142,7 +141,7 @@ QgsNamedColorList QgsCustomColorScheme::fetchColors( const QString context, cons
return colorList; return colorList;
} }
bool QgsCustomColorScheme::setColors( const QgsNamedColorList colors, const QString context, const QColor baseColor ) bool QgsCustomColorScheme::setColors( const QgsNamedColorList &colors, const QString &context, const QColor &baseColor )
{ {
Q_UNUSED( context ); Q_UNUSED( context );
Q_UNUSED( baseColor ); Q_UNUSED( baseColor );
@ -181,7 +180,7 @@ QgsProjectColorScheme::~QgsProjectColorScheme()
} }
QgsNamedColorList QgsProjectColorScheme::fetchColors( const QString context, const QColor baseColor ) QgsNamedColorList QgsProjectColorScheme::fetchColors( const QString &context, const QColor &baseColor )
{ {
Q_UNUSED( context ); Q_UNUSED( context );
Q_UNUSED( baseColor ); Q_UNUSED( baseColor );
@ -210,7 +209,7 @@ QgsNamedColorList QgsProjectColorScheme::fetchColors( const QString context, con
return colorList; return colorList;
} }
bool QgsProjectColorScheme::setColors( const QgsNamedColorList colors, const QString context, const QColor baseColor ) bool QgsProjectColorScheme::setColors( const QgsNamedColorList &colors, const QString &context, const QColor &baseColor )
{ {
Q_UNUSED( context ); Q_UNUSED( context );
Q_UNUSED( baseColor ); Q_UNUSED( baseColor );
@ -253,7 +252,7 @@ QgsGplColorScheme::~QgsGplColorScheme()
} }
QgsNamedColorList QgsGplColorScheme::fetchColors( const QString context, const QColor baseColor ) QgsNamedColorList QgsGplColorScheme::fetchColors( const QString &context, const QColor &baseColor )
{ {
Q_UNUSED( context ); Q_UNUSED( context );
Q_UNUSED( baseColor ); Q_UNUSED( baseColor );
@ -271,7 +270,7 @@ QgsNamedColorList QgsGplColorScheme::fetchColors( const QString context, const Q
return QgsSymbolLayerV2Utils::importColorsFromGpl( sourceFile, ok, name ); return QgsSymbolLayerV2Utils::importColorsFromGpl( sourceFile, ok, name );
} }
bool QgsGplColorScheme::setColors( const QgsNamedColorList colors, const QString context, const QColor baseColor ) bool QgsGplColorScheme::setColors( const QgsNamedColorList &colors, const QString &context, const QColor &baseColor )
{ {
Q_UNUSED( context ); Q_UNUSED( context );
Q_UNUSED( baseColor ); Q_UNUSED( baseColor );
@ -291,7 +290,7 @@ bool QgsGplColorScheme::setColors( const QgsNamedColorList colors, const QString
// QgsUserColorScheme // QgsUserColorScheme
// //
QgsUserColorScheme::QgsUserColorScheme( const QString filename ) QgsUserColorScheme::QgsUserColorScheme( const QString &filename )
: QgsGplColorScheme() : QgsGplColorScheme()
, mFilename( filename ) , mFilename( filename )
{ {

View File

@ -74,8 +74,8 @@ class CORE_EXPORT QgsColorScheme
* to colors related to the base color. * to colors related to the base color.
* @returns a list of QPairs of color and color name * @returns a list of QPairs of color and color name
*/ */
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ) = 0; const QColor &baseColor = QColor() ) = 0;
/**Returns whether the color scheme is editable /**Returns whether the color scheme is editable
* @returns true if scheme is editable * @returns true if scheme is editable
@ -90,7 +90,7 @@ class CORE_EXPORT QgsColorScheme
* @returns true if colors were set successfully * @returns true if colors were set successfully
* @see isEditable * @see isEditable
*/ */
virtual bool setColors( const QgsNamedColorList colors, const QString context = QString(), const QColor baseColor = QColor() ); virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
/**Clones a color scheme /**Clones a color scheme
* @returns copy of color scheme * @returns copy of color scheme
@ -113,10 +113,10 @@ class CORE_EXPORT QgsGplColorScheme : public QgsColorScheme
virtual ~QgsGplColorScheme(); virtual ~QgsGplColorScheme();
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ); const QColor &baseColor = QColor() );
virtual bool setColors( const QgsNamedColorList colors, const QString context = QString(), const QColor baseColor = QColor() ); virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
protected: protected:
@ -140,7 +140,7 @@ class CORE_EXPORT QgsUserColorScheme : public QgsGplColorScheme
/**Constructs a new user color scheme, using a specified gpl palette file /**Constructs a new user color scheme, using a specified gpl palette file
* @param filename filename of gpl palette file stored in the users "palettes" folder * @param filename filename of gpl palette file stored in the users "palettes" folder
*/ */
QgsUserColorScheme( const QString filename ); QgsUserColorScheme( const QString &filename );
virtual ~QgsUserColorScheme(); virtual ~QgsUserColorScheme();
@ -153,7 +153,7 @@ class CORE_EXPORT QgsUserColorScheme : public QgsGplColorScheme
/**Sets the name for the scheme /**Sets the name for the scheme
* @param name new name * @param name new name
*/ */
void setName( const QString name ) { mName = name; } void setName( const QString &name ) { mName = name; }
/**Erases the associated gpl palette file from the users "palettes" folder /**Erases the associated gpl palette file from the users "palettes" folder
* @returns true if erase was successful * @returns true if erase was successful
@ -187,8 +187,8 @@ class CORE_EXPORT QgsRecentColorScheme : public QgsColorScheme
virtual SchemeFlags flags() const { return ShowInAllContexts; } virtual SchemeFlags flags() const { return ShowInAllContexts; }
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ); const QColor &baseColor = QColor() );
QgsColorScheme* clone() const; QgsColorScheme* clone() const;
}; };
@ -210,12 +210,12 @@ class CORE_EXPORT QgsCustomColorScheme : public QgsColorScheme
virtual SchemeFlags flags() const { return ShowInAllContexts; } virtual SchemeFlags flags() const { return ShowInAllContexts; }
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ); const QColor &baseColor = QColor() );
virtual bool isEditable() const { return true; } virtual bool isEditable() const { return true; }
virtual bool setColors( const QgsNamedColorList colors, const QString context = QString(), const QColor baseColor = QColor() ); virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
QgsColorScheme* clone() const; QgsColorScheme* clone() const;
}; };
@ -237,12 +237,12 @@ class CORE_EXPORT QgsProjectColorScheme : public QgsColorScheme
virtual SchemeFlags flags() const { return ShowInAllContexts; } virtual SchemeFlags flags() const { return ShowInAllContexts; }
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ); const QColor &baseColor = QColor() );
virtual bool isEditable() const { return true; } virtual bool isEditable() const { return true; }
virtual bool setColors( const QgsNamedColorList colors, const QString context = QString(), const QColor baseColor = QColor() ); virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
QgsColorScheme* clone() const; QgsColorScheme* clone() const;
}; };

View File

@ -273,7 +273,7 @@ void QgsCoordinateTransform::initialise()
// //
QgsPoint QgsCoordinateTransform::transform( const QgsPoint thePoint, TransformDirection direction ) const QgsPoint QgsCoordinateTransform::transform( const QgsPoint &thePoint, TransformDirection direction ) const
{ {
if ( mShortCircuit || !mInitialisedFlag ) if ( mShortCircuit || !mInitialisedFlag )
return thePoint; return thePoint;
@ -296,7 +296,7 @@ QgsPoint QgsCoordinateTransform::transform( const QgsPoint thePoint, TransformDi
} }
QgsPoint QgsCoordinateTransform::transform( const double theX, const double theY = 0, TransformDirection direction ) const QgsPoint QgsCoordinateTransform::transform( const double theX, const double theY = 0.0, TransformDirection direction ) const
{ {
try try
{ {
@ -310,7 +310,7 @@ QgsPoint QgsCoordinateTransform::transform( const double theX, const double theY
} }
} }
QgsRectangle QgsCoordinateTransform::transform( const QgsRectangle theRect, TransformDirection direction ) const QgsRectangle QgsCoordinateTransform::transform( const QgsRectangle &theRect, TransformDirection direction ) const
{ {
if ( mShortCircuit || !mInitialisedFlag ) if ( mShortCircuit || !mInitialisedFlag )
return theRect; return theRect;
@ -520,7 +520,7 @@ void QgsCoordinateTransform::transformInPlace(
#endif //ANDROID #endif //ANDROID
QgsRectangle QgsCoordinateTransform::transformBoundingBox( const QgsRectangle rect, TransformDirection direction, const bool handle180Crossover ) const QgsRectangle QgsCoordinateTransform::transformBoundingBox( const QgsRectangle &rect, TransformDirection direction, const bool handle180Crossover ) const
{ {
// Calculate the bounding box of a QgsRectangle in the source CRS // Calculate the bounding box of a QgsRectangle in the source CRS
// when projected to the destination CRS (or the inverse). // when projected to the destination CRS (or the inverse).

View File

@ -128,7 +128,7 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject
* @param direction TransformDirection (defaults to ForwardTransform) * @param direction TransformDirection (defaults to ForwardTransform)
* @return QgsPoint in Destination Coordinate System * @return QgsPoint in Destination Coordinate System
*/ */
QgsPoint transform( const QgsPoint p, TransformDirection direction = ForwardTransform ) const; QgsPoint transform( const QgsPoint &p, TransformDirection direction = ForwardTransform ) const;
/*! Transform the point specified by x,y from Source Coordinate System to Destination Coordinate System /*! Transform the point specified by x,y from Source Coordinate System to Destination Coordinate System
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS, * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
@ -152,7 +152,7 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject
* longitude line is required * longitude line is required
* @return QgsRectangle in Destination Coordinate System * @return QgsRectangle in Destination Coordinate System
*/ */
QgsRectangle transformBoundingBox( const QgsRectangle theRect, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const; QgsRectangle transformBoundingBox( const QgsRectangle &theRect, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const;
// Same as for the other transform() functions, but alters the x // Same as for the other transform() functions, but alters the x
// and y variables in place. The second one works with good old-fashioned // and y variables in place. The second one works with good old-fashioned
@ -182,7 +182,7 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject
* @param direction TransformDirection (defaults to ForwardTransform) * @param direction TransformDirection (defaults to ForwardTransform)
* @return QgsRectangle in Destination Coordinate System * @return QgsRectangle in Destination Coordinate System
*/ */
QgsRectangle transform( const QgsRectangle theRect, TransformDirection direction = ForwardTransform ) const; QgsRectangle transform( const QgsRectangle &theRect, TransformDirection direction = ForwardTransform ) const;
/*! Transform an array of coordinates to a different Coordinate System /*! Transform an array of coordinates to a different Coordinate System
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS, * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,

View File

@ -132,7 +132,7 @@ class CORE_EXPORT QgsDataItem : public QObject
virtual QIcon icon(); virtual QIcon icon();
QString name() const { return mName; } QString name() const { return mName; }
QString path() const { return mPath; } QString path() const { return mPath; }
void setPath( const QString path ) { mPath = path; } void setPath( const QString &path ) { mPath = path; }
// Because QIcon (QPixmap) must not be used in outside the GUI thread, it is // Because QIcon (QPixmap) must not be used in outside the GUI thread, it is
// not possible to set mIcon in constructor. Either use mIconName/setIconName() // not possible to set mIcon in constructor. Either use mIconName/setIconName()

View File

@ -6307,7 +6307,7 @@ QgsGeometry* QgsGeometry::convertToPoint( bool destMultipart )
case QGis::Polygon: case QGis::Polygon:
{ {
// can only transfrom if destination is multipoint // can only transform if destination is multipoint
if ( !destMultipart ) if ( !destMultipart )
return 0; return 0;

View File

@ -334,7 +334,7 @@ void QgsGml::endElement( const XML_Char* el )
if (( theParseMode == coordinate && elementName == GML_NAMESPACE + NS_SEPARATOR + "coordinates" ) if (( theParseMode == coordinate && elementName == GML_NAMESPACE + NS_SEPARATOR + "coordinates" )
|| ( theParseMode == posList && ( || ( theParseMode == posList && (
elementName == GML_NAMESPACE + NS_SEPARATOR + "posList" elementName == GML_NAMESPACE + NS_SEPARATOR + "pos"
|| elementName == GML_NAMESPACE + NS_SEPARATOR + "posList" ) ) ) || elementName == GML_NAMESPACE + NS_SEPARATOR + "posList" ) ) )
{ {
mParseModeStack.pop(); mParseModeStack.pop();

View File

@ -17,7 +17,7 @@
#include "qgsvectorlayer.h" #include "qgsvectorlayer.h"
const QString QgsLegacyHelpers::convertEditType( QgsVectorLayer::EditType editType, QgsEditorWidgetConfig& cfg, QgsVectorLayer* vl, const QString& name, const QDomElement editTypeElement ) const QString QgsLegacyHelpers::convertEditType( QgsVectorLayer::EditType editType, QgsEditorWidgetConfig& cfg, QgsVectorLayer* vl, const QString& name, const QDomElement &editTypeElement )
{ {
QString widgetType = "TextEdit"; // Fallback QString widgetType = "TextEdit"; // Fallback

View File

@ -23,7 +23,7 @@
class CORE_EXPORT QgsLegacyHelpers class CORE_EXPORT QgsLegacyHelpers
{ {
public: public:
Q_DECL_DEPRECATED static const QString convertEditType( QgsVectorLayer::EditType editType, QgsEditorWidgetConfig& cfg, QgsVectorLayer* vl, const QString& name, const QDomElement editTypeElement = QDomElement() ); Q_DECL_DEPRECATED static const QString convertEditType( QgsVectorLayer::EditType editType, QgsEditorWidgetConfig& cfg, QgsVectorLayer* vl, const QString& name, const QDomElement &editTypeElement = QDomElement() );
Q_DECL_DEPRECATED static QgsVectorLayer::EditType convertEditType( const QString& editType, const QgsEditorWidgetConfig& cfg, QgsVectorLayer* vl, const QString& name ); Q_DECL_DEPRECATED static QgsVectorLayer::EditType convertEditType( const QString& editType, const QgsEditorWidgetConfig& cfg, QgsVectorLayer* vl, const QString& name );
private: private:

View File

@ -38,7 +38,7 @@ void QgsMapHitTest::run()
if ( mSettings.hasCrsTransformEnabled() ) if ( mSettings.hasCrsTransformEnabled() )
{ {
context.setCoordinateTransform( mSettings.layerTransfrom( vl ) ); context.setCoordinateTransform( mSettings.layerTransform( vl ) );
context.setExtent( mSettings.outputExtentToLayerExtent( vl, mSettings.visibleExtent() ) ); context.setExtent( mSettings.outputExtentToLayerExtent( vl, mSettings.visibleExtent() ) );
} }

View File

@ -660,7 +660,7 @@ QList<QgsMapLayer*> QgsMapLayer::fromLayerDefinition( QDomDocument& document )
return layers; return layers;
} }
QList<QgsMapLayer *> QgsMapLayer::fromLayerDefinitionFile( const QString qlrfile ) QList<QgsMapLayer *> QgsMapLayer::fromLayerDefinitionFile( const QString &qlrfile )
{ {
QFile file( qlrfile ); QFile file( qlrfile );
if ( !file.open( QIODevice::ReadOnly ) ) if ( !file.open( QIODevice::ReadOnly ) )
@ -860,8 +860,6 @@ QString QgsMapLayer::styleURI()
myURI.chop( 7 ); myURI.chop( 7 );
else if ( myURI.endsWith( ".tgz", Qt::CaseInsensitive ) ) else if ( myURI.endsWith( ".tgz", Qt::CaseInsensitive ) )
myURI.chop( 4 ); myURI.chop( 4 );
else if ( myURI.endsWith( ".gz", Qt::CaseInsensitive ) )
myURI.chop( 3 );
myFileInfo.setFile( myURI ); myFileInfo.setFile( myURI );
// get the file name for our .qml style file // get the file name for our .qml style file
key = myFileInfo.path() + QDir::separator() + myFileInfo.completeBaseName() + ".qml"; key = myFileInfo.path() + QDir::separator() + myFileInfo.completeBaseName() + ".qml";

View File

@ -226,7 +226,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
/** Creates a new layer from a layer defininition document /** Creates a new layer from a layer defininition document
*/ */
static QList<QgsMapLayer*> fromLayerDefinition( QDomDocument& document ); static QList<QgsMapLayer*> fromLayerDefinition( QDomDocument& document );
static QList<QgsMapLayer*> fromLayerDefinitionFile( const QString qlrfile ); static QList<QgsMapLayer*> fromLayerDefinitionFile( const QString &qlrfile );
/** Set a custom property for layer. Properties are stored in a map and saved in project file. */ /** Set a custom property for layer. Properties are stored in a map and saved in project file. */
void setCustomProperty( const QString& key, const QVariant& value ); void setCustomProperty( const QString& key, const QVariant& value );

View File

@ -298,7 +298,7 @@ void QgsMapRendererJob::drawOldLabeling( const QgsMapSettings& settings, QgsRend
if ( settings.hasCrsTransformEnabled() ) if ( settings.hasCrsTransformEnabled() )
{ {
ct = settings.layerTransfrom( ml ); ct = settings.layerTransform( ml );
if ( ct ) if ( ct )
reprojectToLayerExtent( ct, ml->crs().geographicFlag(), r1, r2 ); reprojectToLayerExtent( ct, ml->crs().geographicFlag(), r1, r2 );
} }

View File

@ -180,7 +180,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin
if ( mSettings.hasCrsTransformEnabled() ) if ( mSettings.hasCrsTransformEnabled() )
{ {
ct = mSettings.layerTransfrom( ml ); ct = mSettings.layerTransform( ml );
if ( ct ) if ( ct )
{ {
reprojectToLayerExtent( ct, ml->crs().geographicFlag(), r1, r2 ); reprojectToLayerExtent( ct, ml->crs().geographicFlag(), r1, r2 );

View File

@ -274,7 +274,7 @@ double QgsMapSettings::scale() const
const QgsCoordinateTransform* QgsMapSettings::layerTransfrom( QgsMapLayer *layer ) const const QgsCoordinateTransform* QgsMapSettings::layerTransform( QgsMapLayer *layer ) const
{ {
return mDatumTransformStore.transformation( layer ); return mDatumTransformStore.transformation( layer );
} }
@ -287,7 +287,7 @@ QgsRectangle QgsMapSettings::layerExtentToOutputExtent( QgsMapLayer* theLayer, Q
{ {
try try
{ {
if ( const QgsCoordinateTransform* ct = layerTransfrom( theLayer ) ) if ( const QgsCoordinateTransform* ct = layerTransform( theLayer ) )
{ {
QgsDebugMsg( QString( "sourceCrs = " + ct->sourceCrs().authid() ) ); QgsDebugMsg( QString( "sourceCrs = " + ct->sourceCrs().authid() ) );
QgsDebugMsg( QString( "destCRS = " + ct->destCRS().authid() ) ); QgsDebugMsg( QString( "destCRS = " + ct->destCRS().authid() ) );
@ -313,7 +313,7 @@ QgsRectangle QgsMapSettings::outputExtentToLayerExtent( QgsMapLayer* theLayer, Q
{ {
try try
{ {
if ( const QgsCoordinateTransform* ct = layerTransfrom( theLayer ) ) if ( const QgsCoordinateTransform* ct = layerTransform( theLayer ) )
{ {
QgsDebugMsg( QString( "sourceCrs = " + ct->sourceCrs().authid() ) ); QgsDebugMsg( QString( "sourceCrs = " + ct->sourceCrs().authid() ) );
QgsDebugMsg( QString( "destCRS = " + ct->destCRS().authid() ) ); QgsDebugMsg( QString( "destCRS = " + ct->destCRS().authid() ) );
@ -339,7 +339,7 @@ QgsPoint QgsMapSettings::layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint
{ {
try try
{ {
if ( const QgsCoordinateTransform* ct = layerTransfrom( theLayer ) ) if ( const QgsCoordinateTransform* ct = layerTransform( theLayer ) )
point = ct->transform( point, QgsCoordinateTransform::ForwardTransform ); point = ct->transform( point, QgsCoordinateTransform::ForwardTransform );
} }
catch ( QgsCsException &cse ) catch ( QgsCsException &cse )
@ -361,7 +361,7 @@ QgsRectangle QgsMapSettings::layerToMapCoordinates( QgsMapLayer* theLayer, QgsRe
{ {
try try
{ {
if ( const QgsCoordinateTransform* ct = layerTransfrom( theLayer ) ) if ( const QgsCoordinateTransform* ct = layerTransform( theLayer ) )
rect = ct->transform( rect, QgsCoordinateTransform::ForwardTransform ); rect = ct->transform( rect, QgsCoordinateTransform::ForwardTransform );
} }
catch ( QgsCsException &cse ) catch ( QgsCsException &cse )
@ -383,7 +383,7 @@ QgsPoint QgsMapSettings::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint
{ {
try try
{ {
if ( const QgsCoordinateTransform* ct = layerTransfrom( theLayer ) ) if ( const QgsCoordinateTransform* ct = layerTransform( theLayer ) )
point = ct->transform( point, QgsCoordinateTransform::ReverseTransform ); point = ct->transform( point, QgsCoordinateTransform::ReverseTransform );
} }
catch ( QgsCsException &cse ) catch ( QgsCsException &cse )
@ -405,7 +405,7 @@ QgsRectangle QgsMapSettings::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsRe
{ {
try try
{ {
if ( const QgsCoordinateTransform* ct = layerTransfrom( theLayer ) ) if ( const QgsCoordinateTransform* ct = layerTransform( theLayer ) )
rect = ct->transform( rect, QgsCoordinateTransform::ReverseTransform ); rect = ct->transform( rect, QgsCoordinateTransform::ReverseTransform );
} }
catch ( QgsCsException &cse ) catch ( QgsCsException &cse )
@ -446,7 +446,7 @@ QgsRectangle QgsMapSettings::fullExtent() const
if ( lyr->extent().isNull() ) if ( lyr->extent().isNull() )
{ {
it++; ++it;
continue; continue;
} }
@ -458,7 +458,7 @@ QgsRectangle QgsMapSettings::fullExtent() const
fullExtent.unionRect( extent ); fullExtent.unionRect( extent );
} }
it++; ++it;
} }
if ( fullExtent.width() == 0.0 || fullExtent.height() == 0.0 ) if ( fullExtent.width() == 0.0 || fullExtent.height() == 0.0 )

View File

@ -198,7 +198,7 @@ class CORE_EXPORT QgsMapSettings
* @param layer * @param layer
* @return transform - may be null if the transform is not needed * @return transform - may be null if the transform is not needed
*/ */
const QgsCoordinateTransform* layerTransfrom( QgsMapLayer *layer ) const; const QgsCoordinateTransform* layerTransform( QgsMapLayer *layer ) const;
//! returns current extent of layer set //! returns current extent of layer set
QgsRectangle fullExtent() const; QgsRectangle fullExtent() const;

View File

@ -117,7 +117,7 @@ class CORE_EXPORT QgsMultiRenderChecker
/**Draws a checkboard pattern for image backgrounds, so that transparency is visible /**Draws a checkboard pattern for image backgrounds, so that transparency is visible
* without requiring a transparent background for the image * without requiring a transparent background for the image
*/ */
static void drawBackround( QImage* image ) { QgsRenderChecker::drawBackround( image ); } static void drawBackground( QImage* image ) { QgsRenderChecker::drawBackground( image ); }
private: private:
QString mReport; QString mReport;

View File

@ -47,7 +47,7 @@ QString QgsRenderChecker::controlImagePath() const
return myControlImageDir; return myControlImageDir;
} }
void QgsRenderChecker::setControlName( const QString theName ) void QgsRenderChecker::setControlName( const QString &theName )
{ {
mControlName = theName; mControlName = theName;
mExpectedImageFile = controlImagePath() + theName + QDir::separator() + mControlPathSuffix mExpectedImageFile = controlImagePath() + theName + QDir::separator() + mControlPathSuffix
@ -77,7 +77,7 @@ void QgsRenderChecker::setMapSettings( const QgsMapSettings& mapSettings )
mMapSettings = mapSettings; mMapSettings = mapSettings;
} }
void QgsRenderChecker::drawBackround( QImage* image ) void QgsRenderChecker::drawBackground( QImage* image )
{ {
// create a 2x2 checker-board image // create a 2x2 checker-board image
uchar pixDataRGB[] = { 255, 255, 255, 255, uchar pixDataRGB[] = { 255, 255, 255, 255,

View File

@ -61,12 +61,12 @@ class CORE_EXPORT QgsRenderChecker
* suffixed) the path to the image will be constructed like this: * suffixed) the path to the image will be constructed like this:
* controlImagePath + '/' + mControlName + '/' + mControlName + '.png' * controlImagePath + '/' + mControlName + '/' + mControlName + '.png'
*/ */
void setControlName( const QString theName ); void setControlName( const QString &theName );
/** Prefix where the control images are kept. /** Prefix where the control images are kept.
* This will be appended to controlImagePath * This will be appended to controlImagePath
*/ */
void setControlPathPrefix( const QString theName ) { mControlPathPrefix = theName + QDir::separator(); } void setControlPathPrefix( const QString &theName ) { mControlPathPrefix = theName + QDir::separator(); }
void setControlPathSuffix( const QString& theName ) { mControlPathSuffix = theName + QDir::separator(); } void setControlPathSuffix( const QString& theName ) { mControlPathSuffix = theName + QDir::separator(); }
@ -82,6 +82,7 @@ class CORE_EXPORT QgsRenderChecker
* @return The path to the rendered image * @return The path to the rendered image
*/ */
const QString& renderedImage() { return mRenderedImageFile; } const QString& renderedImage() { return mRenderedImageFile; }
//! @deprecated since 2.4 - use setMapSettings() //! @deprecated since 2.4 - use setMapSettings()
Q_DECL_DEPRECATED void setMapRenderer( QgsMapRenderer * thepMapRenderer ); Q_DECL_DEPRECATED void setMapRenderer( QgsMapRenderer * thepMapRenderer );
@ -131,7 +132,7 @@ class CORE_EXPORT QgsRenderChecker
/**Draws a checkboard pattern for image backgrounds, so that transparency is visible /**Draws a checkboard pattern for image backgrounds, so that transparency is visible
* without requiring a transparent background for the image * without requiring a transparent background for the image
*/ */
static void drawBackround( QImage* image ); static void drawBackground( QImage* image );
/** /**
* Returns the path to the expected image file * Returns the path to the expected image file
@ -154,6 +155,7 @@ class CORE_EXPORT QgsRenderChecker
* Only will return something if you call enableDashBuffering( true ); before. * Only will return something if you call enableDashBuffering( true ); before.
* *
* @return buffered dash messages * @return buffered dash messages
* @note not available in python bindings
*/ */
const QVector<QgsDartMeasurement>& dartMeasurements() const { return mDashMessages; } const QVector<QgsDartMeasurement>& dartMeasurements() const { return mDashMessages; }

View File

@ -75,6 +75,7 @@ class CORE_EXPORT QgsVectorLayerCache : public QObject
QgsVectorLayerCache* mCache; QgsVectorLayerCache* mCache;
friend class QgsVectorLayerCache; friend class QgsVectorLayerCache;
Q_DISABLE_COPY( QgsCachedFeature )
}; };
public: public:

View File

@ -338,7 +338,7 @@ void QgsVectorLayerRenderer::drawRendererV2Levels( QgsFeatureIterator& fit )
mCache->cacheGeometry( fet.id(), *fet.geometry() ); mCache->cacheGeometry( fet.id(), *fet.geometry() );
} }
if ( sym && mContext.labelingEngine() ) if ( mContext.labelingEngine() )
{ {
if ( mLabeling ) if ( mLabeling )
{ {

View File

@ -585,7 +585,7 @@ QPixmap QgsSymbolLayerV2Utils::colorRampPreviewPixmap( QgsVectorColorRampV2* ram
painter.begin( &pixmap ); painter.begin( &pixmap );
//draw stippled background, for transparent images //draw stippled background, for transparent images
drawStippledBackround( &painter, QRect( 0, 0, size.width(), size.height() ) ); drawStippledBackground( &painter, QRect( 0, 0, size.width(), size.height() ) );
// antialising makes the colors duller, and no point in antialiasing a color ramp // antialising makes the colors duller, and no point in antialiasing a color ramp
// painter.setRenderHint( QPainter::Antialiasing ); // painter.setRenderHint( QPainter::Antialiasing );
@ -599,7 +599,7 @@ QPixmap QgsSymbolLayerV2Utils::colorRampPreviewPixmap( QgsVectorColorRampV2* ram
return pixmap; return pixmap;
} }
void QgsSymbolLayerV2Utils::drawStippledBackround( QPainter* painter, QRect rect ) void QgsSymbolLayerV2Utils::drawStippledBackground( QPainter* painter, QRect rect )
{ {
// create a 2x2 checker-board image // create a 2x2 checker-board image
uchar pixDataRGB[] = { 255, 255, 255, 255, uchar pixDataRGB[] = { 255, 255, 255, 255,
@ -2817,7 +2817,7 @@ QList<QColor> QgsSymbolLayerV2Utils::parseColorList( const QString colorStr )
return colors; return colors;
} }
QMimeData * QgsSymbolLayerV2Utils::colorToMimeData( const QColor color ) QMimeData * QgsSymbolLayerV2Utils::colorToMimeData( const QColor &color )
{ {
//set both the mime color data (which includes alpha channel), and the text (which is the color's hex //set both the mime color data (which includes alpha channel), and the text (which is the color's hex
//value, and can be used when pasting colors outside of QGIS). //value, and can be used when pasting colors outside of QGIS).

View File

@ -106,7 +106,7 @@ class CORE_EXPORT QgsSymbolLayerV2Utils
static QIcon symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbolV2::OutputUnit u, QSize size, const QgsMapUnitScale& scale = QgsMapUnitScale() ); static QIcon symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbolV2::OutputUnit u, QSize size, const QgsMapUnitScale& scale = QgsMapUnitScale() );
static QIcon colorRampPreviewIcon( QgsVectorColorRampV2* ramp, QSize size ); static QIcon colorRampPreviewIcon( QgsVectorColorRampV2* ramp, QSize size );
static void drawStippledBackround( QPainter* painter, QRect rect ); static void drawStippledBackground( QPainter* painter, QRect rect );
//! @note customContext parameter added in 2.6 //! @note customContext parameter added in 2.6
static QPixmap symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size, QgsRenderContext* customContext = 0 ); static QPixmap symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size, QgsRenderContext* customContext = 0 );
@ -254,7 +254,7 @@ class CORE_EXPORT QgsSymbolLayerV2Utils
* @see colorFromMimeData * @see colorFromMimeData
* @note added in 2.5 * @note added in 2.5
*/ */
static QMimeData * colorToMimeData( const QColor color ); static QMimeData *colorToMimeData( const QColor &color );
/** /**
* Attempts to parse mime data as a color * Attempts to parse mime data as a color

View File

@ -172,19 +172,15 @@ bool QgsAttributeTableFilterModel::filterAcceptsRow( int sourceRow, const QModel
{ {
case ShowAll: case ShowAll:
return true; return true;
break;
case ShowFilteredList: case ShowFilteredList:
return mFilteredFeatures.contains( masterModel()->rowToId( sourceRow ) ); return mFilteredFeatures.contains( masterModel()->rowToId( sourceRow ) );
break;
case ShowSelected: case ShowSelected:
return layer()->selectedFeaturesIds().contains( masterModel()->rowToId( sourceRow ) ); return layer()->selectedFeaturesIds().contains( masterModel()->rowToId( sourceRow ) );
break;
case ShowVisible: case ShowVisible:
return mFilteredFeatures.contains( masterModel()->rowToId( sourceRow ) ); return mFilteredFeatures.contains( masterModel()->rowToId( sourceRow ) );
break;
case ShowEdited: case ShowEdited:
{ {
@ -197,13 +193,11 @@ bool QgsAttributeTableFilterModel::filterAcceptsRow( int sourceRow, const QModel
return addedFeatures.contains( fid ) || changedFeatures.contains( fid ); return addedFeatures.contains( fid ) || changedFeatures.contains( fid );
} }
return false; return false;
break;
} }
default: default:
Q_ASSERT( false ); // In debug mode complain Q_ASSERT( false ); // In debug mode complain
return true; // In release mode accept row return true; // In release mode accept row
break;
} }
// returns are handled in their respective case statement above // returns are handled in their respective case statement above
} }

View File

@ -135,7 +135,7 @@ void QgsValueMapConfigDlg::updateMap( const QMap<QString, QVariant> &map, bool i
++row; ++row;
} }
for ( QMap<QString, QVariant>::const_iterator mit = map.begin(); mit != map.end(); mit++, row++ ) for ( QMap<QString, QVariant>::const_iterator mit = map.begin(); mit != map.end(); ++mit, ++row )
{ {
tableWidget->insertRow( row ); tableWidget->insertRow( row );
if ( mit.value().isNull() ) if ( mit.value().isNull() )

View File

@ -37,7 +37,7 @@
int QgsAttributeForm::sFormCounter = 0; int QgsAttributeForm::sFormCounter = 0;
QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature feature, QgsAttributeEditorContext context, QWidget* parent ) QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &feature, QgsAttributeEditorContext context, QWidget* parent )
: QWidget( parent ) : QWidget( parent )
, mLayer( vl ) , mLayer( vl )
, mContext( context ) , mContext( context )

View File

@ -31,7 +31,7 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature feature = QgsFeature(), QgsAttributeEditorContext context = QgsAttributeEditorContext(), QWidget *parent = 0 ); explicit QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &feature = QgsFeature(), QgsAttributeEditorContext context = QgsAttributeEditorContext(), QWidget *parent = 0 );
~QgsAttributeForm(); ~QgsAttributeForm();
const QgsFeature& feature() { return mFeature; } const QgsFeature& feature() { return mFeature; }

View File

@ -105,7 +105,7 @@ void QgsAttributeTypeLoadDialog::fillComboBoxes( int layerIndex )
valueComboBox->setEnabled( vLayer != 0 ); valueComboBox->setEnabled( vLayer != 0 );
keyComboBox->setCurrentIndex( -1 ); keyComboBox->setCurrentIndex( -1 );
valueComboBox->setEnabled( -1 ); valueComboBox->setCurrentIndex( -1 );
keyComboBox->blockSignals( false ); keyComboBox->blockSignals( false );
valueComboBox->blockSignals( false ); valueComboBox->blockSignals( false );

View File

@ -337,7 +337,7 @@ void QgsColorButtonV2::setValidColor( const QColor& newColor )
} }
} }
QPixmap QgsColorButtonV2::createMenuIcon( const QColor color, const bool showChecks ) QPixmap QgsColorButtonV2::createMenuIcon( const QColor &color, const bool showChecks )
{ {
//create an icon pixmap //create an icon pixmap
QPixmap pixmap( 16, 16 ); QPixmap pixmap( 16, 16 );
@ -542,7 +542,7 @@ void QgsColorButtonV2::addRecentColor( const QColor& color )
settings.setValue( QString( "/colors/recent" ), recentColorVariants ); settings.setValue( QString( "/colors/recent" ), recentColorVariants );
} }
void QgsColorButtonV2::setButtonBackground( const QColor color ) void QgsColorButtonV2::setButtonBackground( const QColor &color )
{ {
QColor backgroundColor = color; QColor backgroundColor = color;

View File

@ -240,7 +240,7 @@ class GUI_EXPORT QgsColorButtonV2: public QToolButton
* @param color Color for button background. If no color is specified, the button's current * @param color Color for button background. If no color is specified, the button's current
* color will be used * color will be used
*/ */
void setButtonBackground( const QColor color = QColor() ); void setButtonBackground( const QColor &color = QColor() );
/**Copies the current color to the clipboard /**Copies the current color to the clipboard
* @see pasteColor * @see pasteColor
@ -282,7 +282,7 @@ class GUI_EXPORT QgsColorButtonV2: public QToolButton
* @see setBehaviour * @see setBehaviour
* @see behaviour * @see behaviour
*/ */
void colorClicked( const QColor color ); void colorClicked( const QColor &color );
protected: protected:
@ -374,7 +374,7 @@ class GUI_EXPORT QgsColorButtonV2: public QToolButton
* @param showChecks set to true to display a checkboard pattern behind * @param showChecks set to true to display a checkboard pattern behind
* transparent colors * transparent colors
*/ */
QPixmap createMenuIcon( const QColor color, const bool showChecks = true ); QPixmap createMenuIcon( const QColor &color, const bool showChecks = true );
private slots: private slots:

View File

@ -782,7 +782,7 @@ void QgsColorDialogV2::stopPicking( const QPoint &eventPos, const bool takeSampl
mColorPreview->setColor( snappedColor, true ); mColorPreview->setColor( snappedColor, true );
} }
void QgsColorDialogV2::setColor( const QColor color ) void QgsColorDialogV2::setColor( const QColor &color )
{ {
if ( !color.isValid() ) if ( !color.isValid() )
{ {

View File

@ -130,7 +130,7 @@ class GUI_EXPORT QgsColorDialogV2 : public QDialog, private Ui::QgsColorDialogBa
/**Sets the current color for the dialog /**Sets the current color for the dialog
* @param color desired color * @param color desired color
*/ */
void setColor( const QColor color ); void setColor( const QColor &color );
protected: protected:

View File

@ -27,7 +27,7 @@
//For model testing //For model testing
//#include "modeltest.h" //#include "modeltest.h"
QgsColorSchemeList::QgsColorSchemeList( QWidget *parent, QgsColorScheme *scheme, const QString context, const QColor baseColor ) QgsColorSchemeList::QgsColorSchemeList( QWidget *parent, QgsColorScheme *scheme, const QString &context, const QColor &baseColor )
: QTreeView( parent ) : QTreeView( parent )
, mScheme( scheme ) , mScheme( scheme )
{ {
@ -54,7 +54,7 @@ QgsColorSchemeList::~QgsColorSchemeList()
} }
void QgsColorSchemeList::setScheme( QgsColorScheme *scheme, const QString context, const QColor baseColor ) void QgsColorSchemeList::setScheme( QgsColorScheme *scheme, const QString &context, const QColor &baseColor )
{ {
mScheme = scheme; mScheme = scheme;
mModel->setScheme( scheme, context, baseColor ); mModel->setScheme( scheme, context, baseColor );
@ -89,7 +89,7 @@ void QgsColorSchemeList::removeSelection()
} }
} }
void QgsColorSchemeList::addColor( const QColor color, const QString label ) void QgsColorSchemeList::addColor( const QColor &color, const QString &label )
{ {
mModel->addColor( color, label ); mModel->addColor( color, label );
} }
@ -233,7 +233,7 @@ bool QgsColorSchemeList::isDirty() const
// QgsColorSchemeModel // QgsColorSchemeModel
// //
QgsColorSchemeModel::QgsColorSchemeModel( QgsColorScheme *scheme, const QString context, const QColor baseColor, QObject *parent ) QgsColorSchemeModel::QgsColorSchemeModel( QgsColorScheme *scheme, const QString &context, const QColor &baseColor, QObject *parent )
: QAbstractItemModel( parent ) : QAbstractItemModel( parent )
, mScheme( scheme ) , mScheme( scheme )
, mContext( context ) , mContext( context )
@ -522,7 +522,7 @@ bool QgsColorSchemeModel::dropMimeData( const QMimeData *data, Qt::DropAction ac
return true; return true;
} }
void QgsColorSchemeModel::setScheme( QgsColorScheme *scheme, const QString context, const QColor baseColor ) void QgsColorSchemeModel::setScheme( QgsColorScheme *scheme, const QString &context, const QColor &baseColor )
{ {
mScheme = scheme; mScheme = scheme;
mContext = context; mContext = context;
@ -581,7 +581,7 @@ bool QgsColorSchemeModel::insertRows( int row, int count, const QModelIndex& par
return true; return true;
} }
void QgsColorSchemeModel::addColor( const QColor color, const QString label ) void QgsColorSchemeModel::addColor( const QColor &color, const QString &label )
{ {
if ( !mScheme->isEditable() ) if ( !mScheme->isEditable() )
{ {

View File

@ -67,7 +67,7 @@ class GUI_EXPORT QgsColorSchemeModel: public QAbstractItemModel
* @param baseColor base color for color scheme * @param baseColor base color for color scheme
* @param parent parent object * @param parent parent object
*/ */
explicit QgsColorSchemeModel( QgsColorScheme* scheme, const QString context = QString(), const QColor baseColor = QColor(), QObject* parent = 0 ); explicit QgsColorSchemeModel( QgsColorScheme* scheme, const QString &context = QString(), const QColor &baseColor = QColor(), QObject* parent = 0 );
~QgsColorSchemeModel(); ~QgsColorSchemeModel();
@ -97,7 +97,7 @@ class GUI_EXPORT QgsColorSchemeModel: public QAbstractItemModel
* @param context context for color scheme * @param context context for color scheme
* @param baseColor base color for color scheme * @param baseColor base color for color scheme
*/ */
void setScheme( QgsColorScheme* scheme, const QString context = QString(), const QColor baseColor = QColor() ); void setScheme( QgsColorScheme* scheme, const QString &context = QString(), const QColor &baseColor = QColor() );
/**Get the current color scheme context for the model /**Get the current color scheme context for the model
* @returns context string which is passed to scheme for color generation * @returns context string which is passed to scheme for color generation
@ -115,7 +115,7 @@ class GUI_EXPORT QgsColorSchemeModel: public QAbstractItemModel
* @param color color to add * @param color color to add
* @param label label for color * @param label label for color
*/ */
void addColor( const QColor color, const QString label = QString() ); void addColor( const QColor &color, const QString &label = QString() );
/**Returns whether the color scheme model has been modified /**Returns whether the color scheme model has been modified
* @returns true if colors have been modified * @returns true if colors have been modified
@ -155,7 +155,7 @@ class GUI_EXPORT QgsColorSchemeList: public QTreeView
* @param context context string provided to color scheme * @param context context string provided to color scheme
* @param baseColor base color for color scheme * @param baseColor base color for color scheme
*/ */
QgsColorSchemeList( QWidget *parent = 0, QgsColorScheme* scheme = 0, const QString context = QString(), const QColor baseColor = QColor() ); QgsColorSchemeList( QWidget *parent = 0, QgsColorScheme* scheme = 0, const QString &context = QString(), const QColor &baseColor = QColor() );
virtual ~QgsColorSchemeList(); virtual ~QgsColorSchemeList();
@ -189,7 +189,7 @@ class GUI_EXPORT QgsColorSchemeList: public QTreeView
* @param context context string provided to color scheme * @param context context string provided to color scheme
* @param baseColor base color for color scheme * @param baseColor base color for color scheme
*/ */
void setScheme( QgsColorScheme* scheme, const QString context = QString(), const QColor baseColor = QColor() ); void setScheme( QgsColorScheme* scheme, const QString &context = QString(), const QColor &baseColor = QColor() );
/**Removes any selected colors from the list /**Removes any selected colors from the list
*/ */
@ -199,7 +199,7 @@ class GUI_EXPORT QgsColorSchemeList: public QTreeView
* @param color color to add * @param color color to add
* @param label optional label for color * @param label optional label for color
*/ */
void addColor( const QColor color, const QString label = QString() ); void addColor( const QColor &color, const QString &label = QString() );
/**Pastes colors from clipboard to the list /**Pastes colors from clipboard to the list
* @see copyColors * @see copyColors
@ -216,7 +216,7 @@ class GUI_EXPORT QgsColorSchemeList: public QTreeView
/**Emitted when a color is selected from the list /**Emitted when a color is selected from the list
* @param color color selected * @param color color selected
*/ */
void colorSelected( const QColor color ); void colorSelected( const QColor &color );
protected: protected:

View File

@ -67,13 +67,13 @@ QSize QgsColorSwatchGrid::sizeHint() const
return QSize( mWidth, calculateHeight() ); return QSize( mWidth, calculateHeight() );
} }
void QgsColorSwatchGrid::setContext( const QString context ) void QgsColorSwatchGrid::setContext( const QString &context )
{ {
mContext = context; mContext = context;
refreshColors(); refreshColors();
} }
void QgsColorSwatchGrid::setBaseColor( const QColor baseColor ) void QgsColorSwatchGrid::setBaseColor( const QColor &baseColor )
{ {
mBaseColor = baseColor; mBaseColor = baseColor;
refreshColors(); refreshColors();
@ -380,7 +380,7 @@ QgsColorSwatchGridAction::~QgsColorSwatchGridAction()
} }
void QgsColorSwatchGridAction::setBaseColor( const QColor baseColor ) void QgsColorSwatchGridAction::setBaseColor( const QColor &baseColor )
{ {
mColorSwatchGrid->setBaseColor( baseColor ); mColorSwatchGrid->setBaseColor( baseColor );
} }
@ -395,7 +395,7 @@ QString QgsColorSwatchGridAction::context() const
return mColorSwatchGrid->context(); return mColorSwatchGrid->context();
} }
void QgsColorSwatchGridAction::setContext( const QString context ) void QgsColorSwatchGridAction::setContext( const QString &context )
{ {
mColorSwatchGrid->setContext( context ); mColorSwatchGrid->setContext( context );
} }

View File

@ -57,7 +57,7 @@ class GUI_EXPORT QgsColorSwatchGrid: public QWidget
* @param context string which is passed to scheme for color generation * @param context string which is passed to scheme for color generation
* @see context * @see context
*/ */
void setContext( const QString context ); void setContext( const QString &context );
/**Get the base color for the widget /**Get the base color for the widget
* @returns base color which is passed to scheme for color generation * @returns base color which is passed to scheme for color generation
@ -69,7 +69,7 @@ class GUI_EXPORT QgsColorSwatchGrid: public QWidget
* @param baseColor base color to pass to scheme for color generation * @param baseColor base color to pass to scheme for color generation
* @see baseColor * @see baseColor
*/ */
void setBaseColor( const QColor baseColor ); void setBaseColor( const QColor &baseColor );
/**Gets the list of colors shown in the grid /**Gets the list of colors shown in the grid
* @returns list of colors currently shown in the grid * @returns list of colors currently shown in the grid
@ -87,7 +87,7 @@ class GUI_EXPORT QgsColorSwatchGrid: public QWidget
/**Emitted when a color has been selected from the widget /**Emitted when a color has been selected from the widget
* @param color selected color * @param color selected color
*/ */
void colorChanged( const QColor color ); void colorChanged( const QColor &color );
/**Emitted when mouse hovers over widget /**Emitted when mouse hovers over widget
*/ */
@ -175,7 +175,7 @@ class GUI_EXPORT QgsColorSwatchGridAction: public QWidgetAction
* @param baseColor base color to pass to scheme for color generation * @param baseColor base color to pass to scheme for color generation
* @see baseColor * @see baseColor
*/ */
void setBaseColor( const QColor baseColor ); void setBaseColor( const QColor &baseColor );
/**Get the base color for the color grid /**Get the base color for the color grid
* @returns base color which is passed to scheme for color generation * @returns base color which is passed to scheme for color generation
@ -193,7 +193,7 @@ class GUI_EXPORT QgsColorSwatchGridAction: public QWidgetAction
* @param context string which is passed to scheme for color generation * @param context string which is passed to scheme for color generation
* @see context * @see context
*/ */
void setContext( const QString context ); void setContext( const QString &context );
public slots: public slots:
@ -206,7 +206,7 @@ class GUI_EXPORT QgsColorSwatchGridAction: public QWidgetAction
/**Emitted when a color has been selected from the widget /**Emitted when a color has been selected from the widget
* @param color selected color * @param color selected color
*/ */
void colorChanged( const QColor color ); void colorChanged( const QColor &color );
private: private:
QMenu* mMenu; QMenu* mMenu;

View File

@ -52,7 +52,7 @@ int QgsColorWidget::componentValue() const
return componentValue( mComponent ); return componentValue( mComponent );
} }
QPixmap QgsColorWidget::createDragIcon( const QColor color ) QPixmap QgsColorWidget::createDragIcon( const QColor &color )
{ {
//craft a pixmap for the drag icon //craft a pixmap for the drag icon
QPixmap pixmap( 50, 50 ); QPixmap pixmap( 50, 50 );
@ -318,7 +318,7 @@ void QgsColorWidget::setComponentValue( const int value )
update(); update();
} }
void QgsColorWidget::setColor( const QColor color, const bool emitSignals ) void QgsColorWidget::setColor( const QColor &color, const bool emitSignals )
{ {
if ( color == mCurrentColor ) if ( color == mCurrentColor )
{ {
@ -462,7 +462,7 @@ void QgsColorWheel::paintEvent( QPaintEvent *event )
painter.end(); painter.end();
} }
void QgsColorWheel::setColor( const QColor color, const bool emitSignals ) void QgsColorWheel::setColor( const QColor &color, const bool emitSignals )
{ {
if ( color.hue() >= 0 && color.hue() != hue() ) if ( color.hue() >= 0 && color.hue() != hue() )
{ {
@ -543,8 +543,6 @@ void QgsColorWheel::setColorFromPos( const QPointF pos )
b = tan( rad1 ) * a; b = tan( rad1 ) * a;
r = sqrt( a * a + b * b ); r = sqrt( a * a + b * b );
} }
x = ( cos( eventAngleRadians ) * r );
y = ( -sin( eventAngleRadians ) * r );
double triangleSideLength = sqrt( 3.0 ) * triangleLength; double triangleSideLength = sqrt( 3.0 ) * triangleLength;
double newL = (( -sin( rad0 ) * r ) / triangleSideLength ) + 0.5; double newL = (( -sin( rad0 ) * r ) / triangleSideLength ) + 0.5;
@ -788,7 +786,7 @@ void QgsColorBox::setComponent( const QgsColorWidget::ColorComponent component )
QgsColorWidget::setComponent( component ); QgsColorWidget::setComponent( component );
} }
void QgsColorBox::setColor( const QColor color, const bool emitSignals ) void QgsColorBox::setColor( const QColor &color, const bool emitSignals )
{ {
//check if we need to redraw the box image //check if we need to redraw the box image
if ( mComponent == QgsColorWidget::Red && mCurrentColor.red() != color.red() ) if ( mComponent == QgsColorWidget::Red && mCurrentColor.red() != color.red() )
@ -1305,7 +1303,7 @@ void QgsColorSliderWidget::setComponentValue( const int value )
mSpinBox->blockSignals( false ); mSpinBox->blockSignals( false );
} }
void QgsColorSliderWidget::setColor( const QColor color, const bool emitSignals ) void QgsColorSliderWidget::setColor( const QColor &color, bool emitSignals )
{ {
QgsColorWidget::setColor( color, emitSignals ); QgsColorWidget::setColor( color, emitSignals );
mRampWidget->setColor( color ); mRampWidget->setColor( color );
@ -1314,7 +1312,7 @@ void QgsColorSliderWidget::setColor( const QColor color, const bool emitSignals
mSpinBox->blockSignals( false ); mSpinBox->blockSignals( false );
} }
void QgsColorSliderWidget::rampColorChanged( const QColor color ) void QgsColorSliderWidget::rampColorChanged( const QColor &color )
{ {
emit colorChanged( color ); emit colorChanged( color );
} }
@ -1404,7 +1402,7 @@ QgsColorTextWidget::~QgsColorTextWidget()
} }
void QgsColorTextWidget::setColor( const QColor color, const bool emitSignals ) void QgsColorTextWidget::setColor( const QColor &color, const bool emitSignals )
{ {
QgsColorWidget::setColor( color, emitSignals ); QgsColorWidget::setColor( color, emitSignals );
updateText(); updateText();

View File

@ -83,7 +83,7 @@ class GUI_EXPORT QgsColorWidget : public QWidget
/**Create an icon for dragging colors /**Create an icon for dragging colors
* @param color for icon * @param color for icon
*/ */
static QPixmap createDragIcon( const QColor color ); static QPixmap createDragIcon( const QColor &color );
public slots: public slots:
@ -92,7 +92,7 @@ class GUI_EXPORT QgsColorWidget : public QWidget
* @param emitSignals set to true to emit the colorChanged signal after setting color * @param emitSignals set to true to emit the colorChanged signal after setting color
* @see color * @see color
*/ */
virtual void setColor( const QColor color, const bool emitSignals = false ); virtual void setColor( const QColor &color, const bool emitSignals = false );
/**Sets the color component which the widget controls /**Sets the color component which the widget controls
* @param component color component for widget * @param component color component for widget
@ -115,7 +115,7 @@ class GUI_EXPORT QgsColorWidget : public QWidget
/**Emitted when the widget's color changes /**Emitted when the widget's color changes
* @param color new widget color * @param color new widget color
*/ */
void colorChanged( const QColor color ); void colorChanged( const QColor &color );
protected: protected:
@ -197,7 +197,7 @@ class GUI_EXPORT QgsColorWheel : public QgsColorWidget
public slots: public slots:
virtual void setColor( const QColor color, const bool emitSignals = false ); virtual void setColor( const QColor &color, const bool emitSignals = false );
protected: protected:
@ -291,8 +291,7 @@ class GUI_EXPORT QgsColorBox : public QgsColorWidget
virtual void setComponent( const ColorComponent component ); virtual void setComponent( const ColorComponent component );
public slots: public slots:
virtual void setColor( const QColor &color, const bool emitSignals = false );
virtual void setColor( const QColor color, const bool emitSignals = false );
protected: protected:
@ -485,7 +484,7 @@ class GUI_EXPORT QgsColorSliderWidget : public QgsColorWidget
virtual void setComponent( const ColorComponent component ); virtual void setComponent( const ColorComponent component );
virtual void setComponentValue( const int value ); virtual void setComponentValue( const int value );
virtual void setColor( const QColor color, const bool emitSignals = false ); virtual void setColor( const QColor &color, const bool emitSignals = false );
private: private:
@ -514,7 +513,7 @@ class GUI_EXPORT QgsColorSliderWidget : public QgsColorWidget
/**Called when the color for the ramp changes /**Called when the color for the ramp changes
*/ */
void rampColorChanged( const QColor color ); void rampColorChanged( const QColor &color );
/**Called when the value of the spin box changes /**Called when the value of the spin box changes
*/ */
@ -547,7 +546,7 @@ class GUI_EXPORT QgsColorTextWidget : public QgsColorWidget
virtual ~QgsColorTextWidget(); virtual ~QgsColorTextWidget();
virtual void setColor( const QColor color, const bool emitSignals = false ); virtual void setColor( const QColor &color, const bool emitSignals = false );
protected: protected:
void resizeEvent( QResizeEvent * event ); void resizeEvent( QResizeEvent * event );

View File

@ -94,7 +94,7 @@ QSize QgsDetailedItemDelegate::sizeHint(
void QgsDetailedItemDelegate::paintManually( QPainter *thepPainter, void QgsDetailedItemDelegate::paintManually( QPainter *thepPainter,
const QStyleOptionViewItem &theOption, const QStyleOptionViewItem &theOption,
const QgsDetailedItemData theData ) const const QgsDetailedItemData &theData ) const
{ {
// //
// Get the strings and check box properties // Get the strings and check box properties
@ -240,7 +240,7 @@ void QgsDetailedItemDelegate::paintManually( QPainter * thepPainter,
void QgsDetailedItemDelegate::paintAsWidget( QPainter *thepPainter, void QgsDetailedItemDelegate::paintAsWidget( QPainter *thepPainter,
const QStyleOptionViewItem &theOption, const QStyleOptionViewItem &theOption,
const QgsDetailedItemData theData ) const const QgsDetailedItemData &theData ) const
{ {
mpWidget->setChecked( theData.isChecked() ); mpWidget->setChecked( theData.isChecked() );
@ -277,7 +277,7 @@ void QgsDetailedItemDelegate::drawHighlight( const QStyleOptionViewItem &theOpti
} }
int QgsDetailedItemDelegate::height( const QStyleOptionViewItem &theOption, int QgsDetailedItemDelegate::height( const QStyleOptionViewItem &theOption,
const QgsDetailedItemData theData ) const const QgsDetailedItemData &theData ) const
{ {
QFontMetrics myTitleMetrics( titleFont( theOption ) ); QFontMetrics myTitleMetrics( titleFont( theOption ) );
QFontMetrics myDetailMetrics( detailFont( theOption ) ); QFontMetrics myDetailMetrics( detailFont( theOption ) );

View File

@ -67,12 +67,12 @@ class GUI_EXPORT QgsDetailedItemDelegate :
int theWidth ) const; int theWidth ) const;
void paintManually( QPainter *thePainter, void paintManually( QPainter *thePainter,
const QStyleOptionViewItem &theOption, const QStyleOptionViewItem &theOption,
const QgsDetailedItemData theData ) const; const QgsDetailedItemData &theData ) const;
void paintAsWidget( QPainter *thePainter, void paintAsWidget( QPainter *thePainter,
const QStyleOptionViewItem &theOption, const QStyleOptionViewItem &theOption,
const QgsDetailedItemData theData ) const; const QgsDetailedItemData &theData ) const;
int height( const QStyleOptionViewItem &theOption, int height( const QStyleOptionViewItem &theOption,
const QgsDetailedItemData theData ) const; const QgsDetailedItemData &theData ) const;
QgsDetailedItemWidget * mpWidget; QgsDetailedItemWidget * mpWidget;
QCheckBox * mpCheckBox; QCheckBox * mpCheckBox;
int mVerticalSpacing; int mVerticalSpacing;

View File

@ -88,7 +88,7 @@ void QgsHighlight::init()
{ {
if ( mMapCanvas->mapSettings().hasCrsTransformEnabled() ) if ( mMapCanvas->mapSettings().hasCrsTransformEnabled() )
{ {
const QgsCoordinateTransform* ct = mMapCanvas->mapSettings().layerTransfrom( mLayer ); const QgsCoordinateTransform* ct = mMapCanvas->mapSettings().layerTransform( mLayer );
if ( ct ) if ( ct )
{ {
if ( mGeometry ) if ( mGeometry )

View File

@ -778,7 +778,7 @@ void QgsRasterHistogramWidget::histoActionTriggered( QAction* action )
histoAction( action->data().toString(), action->isChecked() ); histoAction( action->data().toString(), action->isChecked() );
} }
void QgsRasterHistogramWidget::histoAction( const QString actionName, bool actionFlag ) void QgsRasterHistogramWidget::histoAction( const QString &actionName, bool actionFlag )
{ {
if ( actionName == "" ) if ( actionName == "" )
return; return;

View File

@ -55,7 +55,7 @@ class GUI_EXPORT QgsRasterHistogramWidget : public QWidget, private Ui::QgsRaste
bool computeHistogram( bool forceComputeFlag ); bool computeHistogram( bool forceComputeFlag );
/** Apply a histoActionTriggered() event. */ /** Apply a histoActionTriggered() event. */
void histoAction( const QString actionName, bool actionFlag = true ); void histoAction( const QString &actionName, bool actionFlag = true );
/** Apply a histoActionTriggered() event. */ /** Apply a histoActionTriggered() event. */
void setSelectedBand( int index ); void setSelectedBand( int index );

View File

@ -585,15 +585,13 @@ void QgsGraduatedSymbolRendererV2Widget::classifyGraduated()
mRenderer->setClassAttribute( attrName ); mRenderer->setClassAttribute( attrName );
mRenderer->setMode( mode ); mRenderer->setMode( mode );
mRenderer->setSourceColorRamp( ramp->clone() ); mRenderer->setSourceColorRamp( ramp->clone() );
bool updateUiCount = true;
QApplication::setOverrideCursor( Qt::WaitCursor ); QApplication::setOverrideCursor( Qt::WaitCursor );
mRenderer->updateClasses( mLayer, mode, nclasses ); mRenderer->updateClasses( mLayer, mode, nclasses );
mRenderer->calculateLabelPrecision(); mRenderer->calculateLabelPrecision();
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
// PrettyBreaks and StdDev calculation don't generate exact // PrettyBreaks and StdDev calculation don't generate exact
// number of classes - leave user interface unchanged for these // number of classes - leave user interface unchanged for these
updateUiCount = false; updateUiFromRenderer( false );
updateUiFromRenderer( updateUiCount );
} }
void QgsGraduatedSymbolRendererV2Widget::reapplyColorRamp() void QgsGraduatedSymbolRendererV2Widget::reapplyColorRamp()

View File

@ -56,10 +56,13 @@
#define TO8(x) (x).toLocal8Bit().constData() #define TO8(x) (x).toLocal8Bit().constData()
#endif #endif
QgsSLDConfigParser::QgsSLDConfigParser( QDomDocument* doc, const QMap<QString, QString>& parameters ): QgsSLDConfigParser::QgsSLDConfigParser( QDomDocument* doc, const QMap<QString, QString>& parameters )
QgsWMSConfigParser(), mXMLDoc( doc ), mParameterMap( parameters ), mFallbackParser( 0 ) : QgsWMSConfigParser()
, mXMLDoc( doc )
, mParameterMap( parameters )
, mSLDNamespace( "http://www.opengis.net/sld" )
, mFallbackParser( 0 )
{ {
mSLDNamespace = "http://www.opengis.net/sld";
//set output units //set output units
if ( mXMLDoc ) if ( mXMLDoc )
@ -278,10 +281,6 @@ QList<QgsMapLayer*> QgsSLDConfigParser::mapLayerFromStyle( const QString& lName,
QgsFeatureRendererV2* theRenderer = 0; QgsFeatureRendererV2* theRenderer = 0;
QgsVectorLayer* theVectorLayer = dynamic_cast<QgsVectorLayer*>( theMapLayer );
if ( !theVectorLayer )
{
//a raster layer
QgsRasterLayer* theRasterLayer = dynamic_cast<QgsRasterLayer*>( theMapLayer ); QgsRasterLayer* theRasterLayer = dynamic_cast<QgsRasterLayer*>( theMapLayer );
if ( theRasterLayer ) if ( theRasterLayer )
{ {
@ -304,8 +303,8 @@ QList<QgsMapLayer*> QgsSLDConfigParser::mapLayerFromStyle( const QString& lName,
return resultList; return resultList;
} }
}
QgsVectorLayer* theVectorLayer = dynamic_cast<QgsVectorLayer*>( theMapLayer );
if ( userStyleElement.isNull() )//apply a default style if ( userStyleElement.isNull() )//apply a default style
{ {
QgsSymbolV2* symbol = QgsSymbolV2::defaultSymbol( theVectorLayer->geometryType() ); QgsSymbolV2* symbol = QgsSymbolV2::defaultSymbol( theVectorLayer->geometryType() );

View File

@ -53,7 +53,6 @@ void QgsSOAPRequestHandler::parseInput()
QgsDebugMsg( "the xml string was:" ); QgsDebugMsg( "the xml string was:" );
QgsDebugMsg( inputString ); QgsDebugMsg( inputString );
throw QgsMapServiceException( "InvalidXML", "XML error: " + errorMsg ); throw QgsMapServiceException( "InvalidXML", "XML error: " + errorMsg );
return;
} }
// if xml reading was successfull, save the inputXML in a file // if xml reading was successfull, save the inputXML in a file
@ -66,7 +65,6 @@ void QgsSOAPRequestHandler::parseInput()
{ {
QgsDebugMsg( "Envelope element not found" ); QgsDebugMsg( "Envelope element not found" );
throw QgsMapServiceException( "SOAPError", "Element <Envelope> not found" ); throw QgsMapServiceException( "SOAPError", "Element <Envelope> not found" );
return;
} }
QDomNodeList bodyNodeList = envelopeNodeList.item( 0 ).toElement().elementsByTagNameNS( "http://schemas.xmlsoap.org/soap/envelope/", "Body" ); QDomNodeList bodyNodeList = envelopeNodeList.item( 0 ).toElement().elementsByTagNameNS( "http://schemas.xmlsoap.org/soap/envelope/", "Body" );
@ -74,7 +72,6 @@ void QgsSOAPRequestHandler::parseInput()
{ {
QgsDebugMsg( "body node not found" ); QgsDebugMsg( "body node not found" );
throw QgsMapServiceException( "SOAPError", "Element <Body> not found" ); throw QgsMapServiceException( "SOAPError", "Element <Body> not found" );
return;
} }
QDomElement bodyElement = bodyNodeList.item( 0 ).toElement(); QDomElement bodyElement = bodyNodeList.item( 0 ).toElement();
QDomElement firstChildElement = bodyElement.firstChild().toElement(); QDomElement firstChildElement = bodyElement.firstChild().toElement();

View File

@ -258,6 +258,9 @@ class DL_CreationInterface
protected: protected:
DL_Attributes attributes; DL_Attributes attributes;
DL_Extrusion *extrusion; DL_Extrusion *extrusion;
DL_CreationInterface(const DL_CreationInterface &);
DL_CreationInterface&operator=(const DL_CreationInterface&);
}; };
#endif #endif

View File

@ -152,6 +152,8 @@ class DL_Extrusion
private: private:
double *direction; double *direction;
double elevation; double elevation;
DL_Extrusion(const DL_Extrusion &);
}; };
#endif #endif

View File

@ -1799,18 +1799,19 @@ ControlNodeBin::draw( const ControlContext& context, bool newContext, int bin )
if ( _sortingEnabled && _sortByDistance ) if ( _sortingEnabled && _sortByDistance )
{ {
for( ControlNodeCollection::iterator i = _controlNodes.begin(); i != _controlNodes.end(); ++i ) for( ControlNodeCollection::iterator i = _controlNodes.begin(); i != _controlNodes.end(); )
{ {
ControlNode* node = i->second.get(); ControlNode* node = i->second.get();
if ( node->getNumParents() == 0 ) if ( node->getNumParents() == 0 )
{ {
_renderNodes.erase( node ); _renderNodes.erase( node );
_controlNodes.erase( i ); i = _controlNodes.erase( i );
} }
else else
{ {
ControlNode::PerViewData& nodeData = node->getData( context._view ); ControlNode::PerViewData& nodeData = node->getData( context._view );
byDepth.insert( ControlNodePair(nodeData._screenPos.z(), node) ); byDepth.insert( ControlNodePair(nodeData._screenPos.z(), node) );
++i;
} }
} }

View File

@ -74,6 +74,8 @@ class QgsRubberSelectId
int mWidth; int mWidth;
QGis::GeometryType mGeometryType; QGis::GeometryType mGeometryType;
QgsMapCanvas* mMapCanvas; QgsMapCanvas* mMapCanvas;
Q_DISABLE_COPY( QgsRubberSelectId )
}; };
#endif #endif

View File

@ -669,6 +669,7 @@ ErrorList topolTest::checkGaps( double tolerance, QgsVectorLayer *layer1, QgsVec
if ( geomList.size() == 0 ) if ( geomList.size() == 0 )
{ {
//qDebug() << "geometry list is empty!"; //qDebug() << "geometry list is empty!";
delete [] geomArray;
return errorList; return errorList;
} }

View File

@ -2256,7 +2256,7 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs
{ {
QgsDebugMsg( QString( "res:%1 >= %2" ).arg( it.key() ).arg( vres ) ); QgsDebugMsg( QString( "res:%1 >= %2" ).arg( it.key() ).arg( vres ) );
prev = it; prev = it;
it++; ++it;
} }
if ( it == m.constEnd() || if ( it == m.constEnd() ||

View File

@ -56,7 +56,7 @@ bool QgsCompositionChecker::testComposition( QString &theReport, int page, int p
mComposition->setPlotStyle( QgsComposition::Print ); mComposition->setPlotStyle( QgsComposition::Print );
newImage.setDotsPerMeterX( 96 / 25.4 * 1000 ); newImage.setDotsPerMeterX( 96 / 25.4 * 1000 );
newImage.setDotsPerMeterY( 96 / 25.4 * 1000 ); newImage.setDotsPerMeterY( 96 / 25.4 * 1000 );
drawBackround( &newImage ); drawBackground( &newImage );
QPainter expectedPainter( &newImage ); QPainter expectedPainter( &newImage );
//QRectF sourceArea( 0, 0, mComposition->paperWidth(), mComposition->paperHeight() ); //QRectF sourceArea( 0, 0, mComposition->paperWidth(), mComposition->paperHeight() );
//QRectF targetArea( 0, 0, 3507, 2480 ); //QRectF targetArea( 0, 0, 3507, 2480 );
@ -71,7 +71,7 @@ bool QgsCompositionChecker::testComposition( QString &theReport, int page, int p
mComposition->setPlotStyle( QgsComposition::Print ); mComposition->setPlotStyle( QgsComposition::Print );
outputImage.setDotsPerMeterX( mDotsPerMeter ); outputImage.setDotsPerMeterX( mDotsPerMeter );
outputImage.setDotsPerMeterY( mDotsPerMeter ); outputImage.setDotsPerMeterY( mDotsPerMeter );
drawBackround( &outputImage ); drawBackground( &outputImage );
QPainter p( &outputImage ); QPainter p( &outputImage );
mComposition->renderPage( &p, page ); mComposition->renderPage( &p, page );
p.end(); p.end();

View File

@ -30,8 +30,8 @@ class DummyColorScheme : public QgsColorScheme
virtual QString schemeName() const { return QString( "Dummy scheme" ); } virtual QString schemeName() const { return QString( "Dummy scheme" ); }
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ) const QColor &baseColor = QColor() )
{ {
QList< QPair< QColor, QString> > colors; QList< QPair< QColor, QString> > colors;
if ( context == QString( "testscheme" ) ) if ( context == QString( "testscheme" ) )

View File

@ -31,8 +31,8 @@ class DummyColorScheme : public QgsColorScheme
virtual QString schemeName() const { return QString( "Dummy scheme" ); } virtual QString schemeName() const { return QString( "Dummy scheme" ); }
virtual QgsNamedColorList fetchColors( const QString context = QString(), virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor baseColor = QColor() ) const QColor &baseColor = QColor() )
{ {
QList< QPair< QColor, QString> > colors; QList< QPair< QColor, QString> > colors;
if ( context == QString( "testscheme" ) ) if ( context == QString( "testscheme" ) )

View File

@ -43,7 +43,7 @@ class QgsCompositionChecker(QgsMultiRenderChecker):
self.mComposition.setPlotStyle( QgsComposition.Print ) self.mComposition.setPlotStyle( QgsComposition.Print )
outputImage.setDotsPerMeterX( self.mDotsPerMeter ) outputImage.setDotsPerMeterX( self.mDotsPerMeter )
outputImage.setDotsPerMeterY( self.mDotsPerMeter ) outputImage.setDotsPerMeterY( self.mDotsPerMeter )
QgsMultiRenderChecker.drawBackround( outputImage ) QgsMultiRenderChecker.drawBackground( outputImage )
p = QPainter( outputImage ) p = QPainter( outputImage )
self.mComposition.renderPage( p, page ) self.mComposition.renderPage( p, page )
p.end() p.end()