sip update

This commit is contained in:
Juergen E. Fischer 2013-06-23 16:00:16 +02:00
parent b53e80b84a
commit 3854086d47
54 changed files with 600 additions and 265 deletions

View File

@ -51,5 +51,3 @@ class QgsGraphAnalyzer
*/
static QgsGraph* shortestTree( const QgsGraph* source, int startVertexIdx, int criterionNum );
};

View File

@ -44,6 +44,9 @@ public:
bool sortAscending() const;
void setSortAscending( bool ascending );
bool filterFeatures() const;
void setFilterFeatures( bool doFilter );
QString featureFilter() const;
void setFeatureFilter( const QString& expression );
@ -69,7 +72,7 @@ public:
QgsComposition* composition();
signals:
signals:
/** emitted when one of the parameters changes */
void parameterChanged();
};

View File

@ -5,8 +5,6 @@ class QgsComposerItem: QObject, QGraphicsRectItem
{
%TypeHeaderCode
#include <qgscomposeritem.h>
//#include <qgscomposerarrow.h>
//#include <qgscomposeritemgroup.h>
#include <qgscomposerlabel.h>
#include <qgscomposerlegend.h>
#include <qgscomposermap.h>
@ -16,7 +14,6 @@ class QgsComposerItem: QObject, QGraphicsRectItem
#include <qgscomposershape.h>
#include <qgscomposertable.h>
#include <qgscomposerattributetable.h>
//#include <qgscomposertexttable.h>
%End
%ConvertToSubClassCode
@ -231,6 +228,55 @@ class QgsComposerItem: QObject, QGraphicsRectItem
*/
void setFrameEnabled( bool drawFrame );
/** Whether this item has a Background or not.
* @returns true if there is a Background around this item, otherwise false.
* @note introduced since 2.0
* @see hasBackground
*/
bool hasBackground() const;
/** Set whether this item has a Background drawn around it or not.
* @param drawBackground draw Background
* @returns nothing
* @note introduced in 2.0
* @see hasBackground
*/
void setBackgroundEnabled( bool drawBackground );
/** Gets the background color for this item
* @returns background color
* @note introduced in 2.0
*/
QColor backgroundColor() const;
/** Sets the background color for this item
* @param backgroundColor new background color
* @returns nothing
* @note introduced in 2.0
*/
void setBackgroundColor( const QColor& backgroundColor );
/** Returns the item's composition blending mode */
QPainter::CompositionMode blendMode() const;
/** Sets the item's composition blending mode*/
void setBlendMode( QPainter::CompositionMode blendMode );
/** Returns the item's transparency */
int transparency() const;
/** Sets the item's transparency */
void setTransparency( int transparency );
/** Returns true if effects (eg blend modes) are enabled for the item
* @note introduced in 2.0
*/
bool effectsEnabled() const;
/** Sets whether effects (eg blend modes) are enabled for the item
* @note introduced in 2.0
*/
void setEffectsEnabled( bool effectsEnabled );
/**Composite operations for item groups do nothing per default*/
virtual void addItem( QgsComposerItem* item );
virtual void removeItems();
@ -269,6 +315,9 @@ class QgsComposerItem: QObject, QGraphicsRectItem
/**Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE*/
double fontAscentMillimeters( const QFont& font ) const;
/**Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE*/
double fontDescentMillimeters( const QFont& font ) const;
/**Calculates font to from point size to pixel size*/
double pixelFontSize( double pointSize ) const;
@ -304,30 +353,6 @@ class QgsComposerItem: QObject, QGraphicsRectItem
@note this method was added in version 2.0
@note there is not setter since one can't manually set the id*/
QString uuid() const;
/** Gets the background color for this item
* @note introduced in 2.0
*/
const QColor backgroundColor() const;
/** Sets the background color for this item
* @note introduced in 2.0
*/
void setBackgroundColor( const QColor& backgroundColor );
/* Returns the current blending mode for the composer item
@note added in version 1.9*/
const QPainter::CompositionMode blendMode() const;
/* Sets the composer item's blending mode
@note added in version 1.9*/
void setBlendMode( const QPainter::CompositionMode blendMode );
/** Returns the composer item's transparency
@note added in version 1.9*/
const int transparency() const;
/** Sets the composer item's transparency
@note added in version 1.9*/
void setTransparency( const int transparency );
public slots:
virtual void setRotation( double r );
@ -401,6 +426,14 @@ class QgsComposerItem: QObject, QGraphicsRectItem
@param y in/out: y cooreinate before / after the rotation*/
void rotate( double angle, double& x, double& y ) const;
/**Return horizontal align snap item. Creates a new graphics line if 0*/
QGraphicsLineItem* hAlignSnapItem();
void deleteHAlignSnapItem();
/**Return vertical align snap item. Creates a new graphics line if 0*/
QGraphicsLineItem* vAlignSnapItem();
void deleteVAlignSnapItem();
void deleteAlignItems();
signals:
/**Is emitted on rotation change to notify north arrow pictures*/
void rotationChanged( double newRotation );

View File

@ -52,13 +52,18 @@ class QgsComposerMergeCommand : QgsComposerItemCommand
ComposerMapAnnotationDistance,
//composer legend
ComposerLegendText,
LegendColumnCount,
LegendSplitLayer,
LegendEqualColumnWidth,
LegendSymbolWidth,
LegendSymbolHeight,
LegendTitleSpaceBottom,
LegendGroupSpace,
LegendLayerSpace,
LegendSymbolSpace,
LegendIconSymbolSpace,
LegendBoxSpace,
LegendColumnSpace,
//composer picture
ComposerPictureRotation,
// composer scalebar

View File

@ -22,6 +22,9 @@ class QgsComposerLabel : QgsComposerItem
QString text();
void setText( const QString& text );
int htmlState();
void setHtmlState( int state );
/**Returns the text as it appears on screen (with replaced data field)
@note this function was added in version 1.2*/
QString displayText() const;

View File

@ -31,18 +31,29 @@ class QgsComposerLegend : QgsComposerItem
void setTitle( const QString& t );
QString title() const;
/*
QgsComposerLegendStyle style(QgsComposerLegendStyle::Style s) const;
void setStyle(QgsComposerLegendStyle::Style s, const QgsComposerLegendStyle style);
/** Returns reference to modifiable style */
QgsComposerLegendStyle & rstyle( QgsComposerLegendStyle::Style s );
/** Returns style */
QgsComposerLegendStyle style( QgsComposerLegendStyle::Style s ) const;
void setStyle( QgsComposerLegendStyle::Style s, const QgsComposerLegendStyle style );
QFont styleFont( QgsComposerLegendStyle::Style s ) const;
/** Set style font */
void setStyleFont( QgsComposerLegendStyle::Style s, const QFont& f );
/** Set style margin*/
void setStyleMargin( QgsComposerLegendStyle::Style s, double margin );
void setStyleMargin( QgsComposerLegendStyle::Style s, QgsComposerLegendStyle::Side side, double margin );
*/
double boxSpace() const;
void setBoxSpace( double s );
double columnSpace() const;
void setColumnSpace( double s );
QColor fontColor() const;
void setFontColor( const QColor& c );
double symbolWidth() const;
void setSymbolWidth( double w );
@ -52,6 +63,15 @@ class QgsComposerLegend : QgsComposerItem
void setWrapChar( const QString& t );
QString wrapChar() const;
int columnCount() const;
void setColumnCount( int c );
int splitLayer() const;
void setSplitLayer( bool s );
int equalColumnWidth() const;
void setEqualColumnWidth( bool s );
void setComposerMap( const QgsComposerMap* map );
const QgsComposerMap* composerMap() const;

View File

@ -15,7 +15,8 @@ class QgsComposerLegendItem : QStandardItem
GroupItem = QStandardItem::UserType,
LayerItem,
SymbologyV2Item,
RasterSymbolItem
RasterSymbolItem,
StyleItem
};
virtual void writeXML( QDomElement& elem, QDomDocument& doc ) const = 0;
@ -27,6 +28,13 @@ class QgsComposerLegendItem : QStandardItem
virtual ItemType itemType() const = 0;
virtual QStandardItem* clone() const = 0;
QgsComposerLegendStyle::Style style() const;
void setStyle( QgsComposerLegendStyle::Style style );
// Get text defined by user
virtual QString userText() const;
// Set text defined by user
virtual void setUserText( const QString & text );
protected:
void writeXMLChildren( QDomElement& elem, QDomDocument& doc ) const;
};
@ -99,6 +107,11 @@ class QgsComposerLayerItem : QgsComposerLegendItem
void setLayerID( const QString& id );
QString layerID() const;
void setShowFeatureCount( bool show );
bool showFeatureCount() const;
void setDefaultStyle();
};
class QgsComposerGroupItem : QgsComposerLegendItem

View File

@ -53,6 +53,9 @@ class QgsComposerScaleBar: QgsComposerItem
QFont font() const;
QColor fontColor() const;
void setFontColor( const QColor& c );
void setFont( const QFont& font );
QPen pen() const;

View File

@ -46,4 +46,11 @@ class QgsComposerShape: QgsComposerItem
public slots:
/**Sets item rotation and resizes item bounds such that the shape always has the same size*/
virtual void setRotation( double r );
protected:
/* reimplement drawFrame, since it's not a rect, but a custom shape */
virtual void drawFrame( QPainter* p );
/* reimplement drawBackground, since it's not a rect, but a custom shape */
virtual void drawBackground( QPainter* p );
};

View File

@ -106,7 +106,7 @@ class QgsComposition : QGraphicsScene
const QgsComposerHtml* getComposerHtmlByItem( QgsComposerItem *item ) const;
/**Returns a composer item given its text identifier.
Ids are not necessarely unique, but this function returns only one element.
Ids are not necessarely unique, but this function returns only one element.
@note added in 2.0
@param theId - A QString representing the identifier of the item to
retrieve.
@ -114,15 +114,10 @@ class QgsComposition : QGraphicsScene
**/
const QgsComposerItem* getComposerItemById( QString theId ) const;
/**Returns a composer item given its unique identifier.
Warning : ids are not necessarely unique, but this function returns only one element.
@note added in 2.0
@param theId - A QString representing the UUID of the item to retrieve.
@param inAllComposers - Whether the search should be done in all composers of the project
@return QgsComposerItem pointer or 0 pointer if no such item exists.
@param theUuid A QString representing the UUID of the item to
**/
//const QgsComposerItem* getComposerItemByUuid( QString theUuid, bool inAllComposers = false ) const;
const QgsComposerItem* getComposerItemByUuid( QString theUuid ) const;
int printResolution() const;
@ -131,6 +126,13 @@ class QgsComposition : QGraphicsScene
bool printAsRaster() const;
void setPrintAsRaster( bool enabled );
/**Returns true if a composition should use advanced effects such as blend modes
@note added in 1.9*/
bool useAdvancedEffects() const;
/**Used to enable or disable advanced effects such as blend modes in a composition
@note: added in version 1.9*/
void setUseAdvancedEffects( bool effectsEnabled );
double selectionTolerance() const;
void setSelectionTolerance( double tol );
@ -167,11 +169,12 @@ class QgsComposition : QGraphicsScene
@param mapsToRestore for reading from project file: set preview move 'rectangle' to all maps and save the preview states to show composer maps on demand
@param addUndoCommands insert AddItem commands if true (e.g. for copy/paste)
@param pos item position. Optional, take position from xml if 0
@param pasteInPlace whether the position should be kept but mapped to the page origin. (the page is the page under to the mouse cursor)
@note not available in python bindings
*/
/*
void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
bool addUndoCommands = false, QPointF* pos = 0 );
bool addUndoCommands = false, QPointF* pos = 0, bool pasteInPlace = false );
*/
/**Adds item to z list. Usually called from constructor of QgsComposerItem*/
@ -204,6 +207,34 @@ class QgsComposition : QGraphicsScene
/**Snaps a scene coordinate point to grid*/
QPointF snapPointToGrid( const QPointF& scenePoint ) const;
/**Snaps item position to align with other items (left / middle / right or top / middle / bottom
@param item current item
@param alignX x-coordinate of align or -1 if not aligned to x
@param alignY y-coordinate of align or -1 if not aligned to y
@param dx item shift in x direction
@param dy item shift in y direction
@return new upper left point after the align*/
QPointF alignItem( const QgsComposerItem* item, double& alignX, double& alignY, double dx = 0, double dy = 0 );
/**Snaps position to align with the boundaries of other items
@param pos position to snap
@param excludeItem item to exclude
@param alignX snapped x coordinate or -1 if not snapped
@param alignY snapped y coordinate or -1 if not snapped
@return snapped position or original position if no snap*/
QPointF alignPos( const QPointF& pos, const QgsComposerItem* excludeItem, double& alignX, double& alignY );
/**Add a custom snap line (can be horizontal or vertical)*/
QGraphicsLineItem* addSnapLine();
/**Remove custom snap line (and delete the object)*/
void removeSnapLine( QGraphicsLineItem* line );
/**Get nearest snap line
* @note not availabel in python bindings
*/
// QGraphicsLineItem* nearestSnapLine( bool horizontal, double x, double y, double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems );
/**Hides / shows custom snap lines*/
void setSnapLinesVisible( bool visible );
/**Allocates new item command and saves initial state in it
@param item target item
@param commandText descriptive command text
@ -222,7 +253,8 @@ class QgsComposition : QGraphicsScene
void addMultiFrame( QgsComposerMultiFrame* multiFrame );
/**Removes multi frame (but does not delete it)*/
void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
/**Adds an arrow item to the graphics scene and advices composer to create a widget for it (through signal)*/
/**Adds an arrow item to the graphics scene and advices composer to create a widget for it (through signal)
@note not available in python bindings*/
void addComposerArrow( QgsComposerArrow* arrow );
/**Adds label to the graphics scene and advices composer to create a widget for it (through signal)*/
void addComposerLabel( QgsComposerLabel* label );

View File

@ -1,3 +1,16 @@
class QgsCoordinateTransformCache
{
public:
static QgsCoordinateTransformCache* instance();
~QgsCoordinateTransformCache();
/**Returns coordinate transformation. Cache keeps ownership
@param srcAuthId auth id string of source crs
@param destAuthId auth id string of dest crs*/
const QgsCoordinateTransform* transform( const QString& srcAuthId, const QString& destAuthId );
/**Removes transformations where a changed crs is involved from the cache*/
void invalidateCrs( const QString& crsAuthId );
};
class QgsCRSCache
{
%TypeHeaderCode
@ -9,7 +22,9 @@ class QgsCRSCache
~QgsCRSCache();
/**Returns the CRS for authid, e.g. 'EPSG:4326' (or an invalid CRS in case of error)*/
const QgsCoordinateReferenceSystem& crsByAuthId( const QString& authid );
const QgsCoordinateReferenceSystem& crsByEpsgId( long epgs );
const QgsCoordinateReferenceSystem& crsByEpsgId( long epsg );
void updateCRSCache( const QString &authid );
protected:
QgsCRSCache();

View File

@ -13,7 +13,6 @@ class QgsDataDefined
/**
* Construct a new data defined object
*
* @param parent The parent QWidget
* @param active Whether the current data defined is active
* @param useexpr Whether to use expression instead of field
* @param expr Expression string
@ -35,7 +34,9 @@ class QgsDataDefined
QString expressionString() const;
void setExpressionString( const QString& expr );
//QMap<QString, QVariant> expressionParams() const;
//void setExpressionParams( QMap<QString, QVariant> params );
void insertExpressionParam( QString key, QVariant param );

View File

@ -8,9 +8,10 @@ class QgsFeatureRequest
public:
enum Flag
{
NoGeometry = 0x01, //!< Do not fetch geometry
SubsetOfAttributes = 0x02, //!< Fetch only a subset of attributes (setSubsetOfAttributes sets this flag)
ExactIntersect = 0x04 //!< Use exact geometry intersection (slower) instead of bounding boxes
NoFlags = 0,
NoGeometry = 1,
SubsetOfAttributes = 2,
ExactIntersect = 4
};
typedef QFlags<QgsFeatureRequest::Flag> Flags;

View File

@ -108,6 +108,8 @@ public:
*/
void setComment( const QString & comment );
/**Formats string for display*/
QString displayString( const QVariant& v ) const;
}; // class QgsField
@ -117,39 +119,38 @@ class QgsFields
%TypeHeaderCode
#include <qgsfield.h>
%End
public:
public:
enum FieldOrigin { OriginUnknown, OriginProvider, OriginJoin, OriginEdit };
enum FieldOrigin { OriginUnknown, OriginProvider, OriginJoin, OriginEdit };
void clear();
void append( const QgsField& field, FieldOrigin origin = OriginProvider, int originIndex = -1 );
void remove( int fieldIdx );
void clear();
void append( const QgsField& field, FieldOrigin origin = OriginProvider, int originIndex = -1 );
void remove( int fieldIdx );
bool isEmpty() const;
// __len__ annotation since sip 4.10.3
//int count() const /__len__/;
int count() const;
int __len__() const;
bool isEmpty() const;
// __len__ annotation since sip 4.10.3
//int count() const /__len__/;
int count() const;
int __len__() const;
%MethodCode
sipRes = sipCpp->count();
%End
int size() const;
//const QgsField& operator[](int i) const;
//QgsField& operator[](int i);
const QgsField& at(int i) const;
QList<QgsField> toList() const;
int size() const;
//const QgsField& operator[](int i) const;
//QgsField& operator[](int i);
const QgsField& at(int i) const;
QList<QgsField> toList() const;
const QgsField& field( int fieldIdx ) const;
const QgsField& field( const QString& name ) const;
FieldOrigin fieldOrigin( int fieldIdx ) const;
int fieldOriginIndex( int fieldIdx ) const;
const QgsField& field( int fieldIdx ) const;
const QgsField& field( const QString& name ) const;
FieldOrigin fieldOrigin( int fieldIdx ) const;
int fieldOriginIndex( int fieldIdx ) const;
int indexFromName( const QString& name ) const;
void extend( const QgsFields& other );
int indexFromName( const QString& name ) const;
void extend( const QgsFields& other );
QgsField& operator[](int i) /Factory/;
QgsField& operator[](int i) /Factory/;
%MethodCode
SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)

View File

@ -82,10 +82,10 @@ class QgsGeometry
/**
* Returns the size of the WKB in asWkb().
*/
size_t wkbSize();
size_t wkbSize() const;
/** Returns type of wkb (point / linestring / polygon etc.) */
QGis::WkbType wkbType();
QGis::WkbType wkbType() const;
/** Returns type of the vector */
QGis::GeometryType type();
@ -124,7 +124,7 @@ class QgsGeometry
Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point
and the indices of the vertices before/after. The vertices before/after are -1 if not present
*/
QgsPoint closestVertex( const QgsPoint& point, int& atVertex /Out/, int& beforeVertex /Out/, int& afterVertex /Out/, double& sqrDist /Out/ );
QgsPoint closestVertex( const QgsPoint& point, int& atVertex /Out/, int& beforeVertex /Out/, int& afterVertex /Out/, double& sqrDist /Out/ ) const;
/**
@ -253,41 +253,41 @@ class QgsGeometry
QgsRectangle boundingBox();
/** Test for intersection with a rectangle (uses GEOS) */
bool intersects( const QgsRectangle& r );
bool intersects( const QgsRectangle& r ) const;
/** Test for intersection with a geometry (uses GEOS) */
bool intersects( QgsGeometry* geometry );
bool intersects( const QgsGeometry* geometry ) const;
/** Test for containment of a point (uses GEOS) */
bool contains( QgsPoint* p );
bool contains( const QgsPoint* p ) const;
/** Test for if geometry is contained in an other (uses GEOS)
* @note added in 1.5 */
bool contains( QgsGeometry* geometry );
bool contains( const QgsGeometry* geometry ) const;
/** Test for if geometry is disjoint of an other (uses GEOS)
* @note added in 1.5 */
bool disjoint( QgsGeometry* geometry );
bool disjoint( const QgsGeometry* geometry ) const;
/** Test for if geometry equals an other (uses GEOS)
* @note added in 1.5 */
bool equals( QgsGeometry* geometry );
bool equals( const QgsGeometry* geometry ) const;
/** Test for if geometry touch an other (uses GEOS)
* @note added in 1.5 */
bool touches( QgsGeometry* geometry );
bool touches( const QgsGeometry* geometry ) const;
/** Test for if geometry overlaps an other (uses GEOS)
* @note added in 1.5 */
bool overlaps( QgsGeometry* geometry );
bool overlaps( const QgsGeometry* geometry ) const;
/** Test for if geometry is within an other (uses GEOS)
* @note added in 1.5 */
bool within( QgsGeometry* geometry );
bool within( const QgsGeometry* geometry ) const;
/** Test for if geometry crosses an other (uses GEOS)
* @note added in 1.5 */
bool crosses( QgsGeometry* geometry );
bool crosses( const QgsGeometry* geometry ) const;
/** Returns a buffer region around this geometry having the given width and with a specified number
of segments used to approximate curves */
@ -326,45 +326,44 @@ class QgsGeometry
/** Exports the geometry to mWkt
* @return true in case of success and false else
*/
QString exportToWkt();
QString exportToWkt() const;
/** Exports the geometry to mGeoJSON
* @return true in case of success and false else
* @note added in 1.8
* @note python binding added in 1.9
*/
QString exportToGeoJSON();
QString exportToGeoJSON() const;
/* Accessor functions for getting geometry data */
/** return contents of the geometry as a point
if wkbType is WKBPoint, otherwise returns [0,0] */
QgsPoint asPoint();
QgsPoint asPoint() const;
/** return contents of the geometry as a polyline
if wkbType is WKBLineString, otherwise an empty list */
QgsPolyline asPolyline();
QgsPolyline asPolyline() const;
/** return contents of the geometry as a polygon
if wkbType is WKBPolygon, otherwise an empty list */
QgsPolygon asPolygon();
QgsPolygon asPolygon() const;
/** return contents of the geometry as a multi point
if wkbType is WKBMultiPoint, otherwise an empty list */
QgsMultiPoint asMultiPoint();
QgsMultiPoint asMultiPoint() const;
/** return contents of the geometry as a multi linestring
if wkbType is WKBMultiLineString, otherwise an empty list */
QgsMultiPolyline asMultiPolyline();
QgsMultiPolyline asMultiPolyline() const;
/** return contents of the geometry as a multi polygon
if wkbType is WKBMultiPolygon, otherwise an empty list */
QgsMultiPolygon asMultiPolygon();
QgsMultiPolygon asMultiPolygon() const;
/** return contents of the geometry as a list of geometries
@note added in version 1.1 */
// TODO: destruction of created geometries??
QList<QgsGeometry*> asGeometryCollection() /Factory/;
QList<QgsGeometry*> asGeometryCollection() const /Factory/;
/** delete a ring in polygon or multipolygon.
Ring 0 is outer ring and can't be deleted.

View File

@ -1,5 +1,23 @@
//typedef QMap<int, QgsField> QgsFieldMap;
/* Description of feature class in GML */
class QgsGmlFeatureClass
{
public:
QgsGmlFeatureClass( );
QgsGmlFeatureClass( QString name, QString path );
~QgsGmlFeatureClass();
QList<QgsField> & fields();
int fieldIndex( const QString & name );
QString path() const;
QStringList & geometryAttributes();
};
class QgsGmlSchema: QObject
{
@ -9,6 +27,7 @@ class QgsGmlSchema: QObject
public:
QgsGmlSchema();
~QgsGmlSchema();
/** Get fields info from XSD */
@ -22,7 +41,9 @@ class QgsGmlSchema: QObject
QStringList typeNames() const;
/** Get fields for type/class name parsed from GML or XSD */
QList<QgsField> fields( const QString & typeName );
/** Get list of geometry attributes for type/class name */
QStringList geometryAttributes( const QString & typeName );
};

View File

@ -70,7 +70,7 @@ class QgsLabel
void setFields( const QgsFields & fields );
//! Available vector fields
const QgsFields & fields();
QgsFields & fields();
/** Pointer to default attributes.
* @note this replaces the to-be-deprecated layerAttributes method.

View File

@ -87,6 +87,12 @@ class QgsMapLayer : QObject
void setKeywordList( const QString& kwdList );
const QString& keywordList() const;
/* Layer dataUrl information */
void setDataUrl( const QString& dataUrl );
const QString& dataUrl() const;
void setDataUrlFormat( const QString& dataUrlFormat );
const QString& dataUrlFormat() const;
/* Layer attribution information */
void setAttribution( const QString& attrib );
const QString& attribution() const;
@ -101,6 +107,11 @@ class QgsMapLayer : QObject
void setMetadataUrlFormat( const QString& metaUrlFormat );
const QString& metadataUrlFormat() const;
/* Set the blending mode used for rendering a layer */
void setBlendMode( const QPainter::CompositionMode blendMode );
/* Returns the current blending mode for a layer */
QPainter::CompositionMode blendMode() const;
/**Synchronises with changes in the datasource
@note added in version 1.6*/
virtual void reload();
@ -172,8 +183,8 @@ class QgsMapLayer : QObject
/** stores state in Dom node
@param layer_node is Dom node corresponding to ``projectlayers'' tag
@param document is Dom document
@param layerElement is a Dom element corresponding to ``maplayer'' tag
@param document is a the dom document being written
@note
The Dom node corresponds to a Dom document project file XML element to be
@ -186,7 +197,7 @@ class QgsMapLayer : QObject
@returns true if successful
*/
bool writeLayerXML( QDomElement& layerElement, QDomDocument & document );
bool writeLayerXML( QDomElement& layerElement, QDomDocument& document );
/** Set a custom property for layer. Properties are stored in a map and saved in project file.
* @note Added in v1.4 */
@ -198,11 +209,6 @@ class QgsMapLayer : QObject
* @note Added in v1.4 */
void removeCustomProperty( const QString& key );
/** Accessor for transparency level. */
// unsigned int getTransparency();
/** Mutator for transparency level. Should be between 0 and 255 */
// virtual void setTransparency( unsigned int );
/**
* If an operation returns 0 (e.g. draw()), this function
@ -220,6 +226,12 @@ class QgsMapLayer : QObject
*/
virtual QString lastError();
/** Get current status error. This error describes some principal problem
* for which layer cannot work and thus is not valid. It is not last error
* after accessing data by draw() etc.
*/
virtual QgsError error() const;
/** Returns layer's spatial reference system
@note This was introduced in QGIS 1.4
*/
@ -268,6 +280,24 @@ class QgsMapLayer : QObject
virtual bool loadNamedStyleFromDb( const QString db, const QString theURI, QString &qml /Out/ );
//TODO edit infos
/**
* Export the properties of this layer as named style in a QDomDocument
* @param doc the target QDomDocument
* @param errorMsg this QString will be initialized on error
* during the execution of writeSymbology
*/
virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg );
/**
* Export the properties of this layer as SLD style in a QDomDocument
* @param doc the target QDomDocument
* @param errorMsg this QString will be initialized on error
* during the execution of writeSymbology
*/
virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg );
/** Save the properties of this layer as the default style
* (either as a .qml file on disk or as a
* record in the users style table in their personal qgis.db)
@ -323,23 +353,22 @@ class QgsMapLayer : QObject
* @note This method was added in QGIS 1.4 **/
void setCacheImage( QImage * thepImage /Transfer/ );
/* Returns the current blending mode for a layer
@note added in version 1.9*/
const QPainter::CompositionMode blendMode() const;
/* Sets the blending mode for a layer
@note added in version 1.9*/
void setBlendMode( const QPainter::CompositionMode blendMode );
/**
* @brief Is called when the cache image is being deleted. Overwrite and use to clean up.
* @note added in 2.0
*/
virtual void onCacheImageDelete();
public slots:
/** Event handler for when a coordinate transform fails due to bad vertex error */
virtual void invalidTransformInput();
/** Accessor and mutator for the minimum scale member */
/** Accessor and mutator for the minimum scale denominator member */
void setMinimumScale( float theMinScale );
float minimumScale();
/** Accessor and mutator for the maximum scale member */
/** Accessor and mutator for the maximum scale denominator member */
void setMaximumScale( float theMaxScale );
float maximumScale();
@ -419,5 +448,8 @@ class QgsMapLayer : QObject
/** debugging member - invoked when a connect() is made to this object */
void connectNotify( const char * signal );
/** Add error message */
void appendError( const QgsErrorMessage & theMessage );
/** Set error message */
void setError( const QgsError & theError );
};

View File

@ -22,7 +22,7 @@ class QgsMapLayerRegistry : QObject
//! Retrieve a pointer to a loaded layer by id
QgsMapLayer *mapLayer( QString theLayerId );
//! Retrieve all layers using their name
//! Retrieve a pointer to a loaded layer by name
QList<QgsMapLayer *> mapLayersByName( QString layerName );
//! Retrieve the mapLayers collection (mainly intended for use by projection)
@ -35,10 +35,10 @@ class QgsMapLayerRegistry : QObject
* The layersAdded() and layersWasAdded() signals will be emitted in any case.
* The legendLayersAdded() signal only if addToLegend is true.
*
* @param theMapLayers A list of layer which should be added to the registry
* @param addToLegend If true (by default), the layers will be added to the
* legend and to the main canvas. If you have a private
* layer, you can set this parameter to false to hide it.
* @param theMapLayers A list of layer which should be added to the registry
* @param addToLegend If true (by default), the layers will be added to the
* legend and to the main canvas. If you have a private
* layer, you can set this parameter to false to hide it.
*
* @return QList<QgsMapLayer *> - a list of the map layers that were added
* successfully. If a layer is invalid, or already exists in the registry,
@ -86,7 +86,7 @@ class QgsMapLayerRegistry : QObject
*
* @note As a side-effect QgsProject is made dirty.
*/
void removeMapLayers(QStringList theLayerIds );
void removeMapLayers( QStringList theLayerIds );
/**
* @brief

View File

@ -6,54 +6,55 @@ class QgsOgcUtils
#include <qgsogcutils.h>
%End
public:
public:
/** static method that creates geometry from GML
@param XML representation of the geometry. GML elements are expected to be
in default namespace (<Point>...</Point>) or in "gml" namespace (<gml:Point>...</gml:Point>)
@note added in 1.9
*/
static QgsGeometry* geometryFromGML( const QString& xmlString ) /Factory/;
/** static method that creates geometry from GML
@param xmlString xml representation of the geometry. GML elements are expected to be
in default namespace (\verbatim {<Point>...</Point> \endverbatim) or in
"gml" namespace (\verbatim <gml:Point>...</gml:Point> \endverbatim)
*/
static QgsGeometry* geometryFromGML( const QString& xmlString ) /Factory/;
/** static method that creates geometry from GML
@note added in 1.9
*/
static QgsGeometry* geometryFromGML( const QDomNode& geometryNode ) /Factory/;
/** static method that creates geometry from GML
*/
static QgsGeometry* geometryFromGML( const QDomNode& geometryNode ) /Factory/;
/** read rectangle from GML2 Box */
static QgsRectangle rectangleFromGMLBox( const QDomNode& boxNode );
/** read rectangle from GML2 Box */
static QgsRectangle rectangleFromGMLBox( const QDomNode& boxNode );
/** read rectangle from GML3 Envelope */
static QgsRectangle rectangleFromGMLEnvelope( const QDomNode& envelopeNode );
/** read rectangle from GML3 Envelope */
static QgsRectangle rectangleFromGMLEnvelope( const QDomNode& envelopeNode );
/** Exports the geometry to GML2
@return QDomElement
*/
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc );
/** Exports the geometry to GML2
@return QDomElement
*/
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc );
/** Exports the geometry to GML2 or GML3
@return QDomElement
*/
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString Format );
/** Exports the geometry to GML2 or GML3
@return QDomElement
*/
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString Format );
/** Exports the rectangle to GML2 Box
@return QDomElement
*/
static QDomElement rectangleToGMLBox( QgsRectangle* box, QDomDocument& doc );
/** Exports the rectangle to GML2 Box
@return QDomElement
*/
static QDomElement rectangleToGMLBox( QgsRectangle* box, QDomDocument& doc );
/** Exports the rectangle to GML2 Envelope
@return QDomElement
*/
static QDomElement rectangleToGMLEnvelope( QgsRectangle* env, QDomDocument& doc );
/** Exports the rectangle to GML2 Envelope
@return QDomElement
*/
static QDomElement rectangleToGMLEnvelope( QgsRectangle* env, QDomDocument& doc );
/** Parse XML with OGC filter into QGIS expression */
static QgsExpression* expressionFromOgcFilter( const QDomElement& element ) /Factory/;
/** Parse XML with OGC filter into QGIS expression */
static QgsExpression* expressionFromOgcFilter( const QDomElement& element ) /Factory/;
/** Creates OGC filter XML element. Supports minimum standard filter according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT)
@return valid <Filter> QDomElement on success, otherwise null QDomElement
*/
static QDomElement expressionToOgcFilter( const QgsExpression& exp, QDomDocument& doc, QString* errorMessage /Out/ );
/** Creates OGC filter XML element. Supports minimum standard filter
* according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT)
* @return valid \verbatim <Filter> \endverbatim QDomElement on success,
* otherwise null QDomElement
*/
static QDomElement expressionToOgcFilter( const QgsExpression& exp, QDomDocument& doc, QString* errorMessage /Out/ );
};

View File

@ -48,7 +48,7 @@ class QgsSnapper
enum SnappingMode
{
/**Only one snapping result is retured*/
/**Only one snapping result is returned*/
SnapWithOneResult,
/**Several snapping results which have the same position are returned.
This is useful for topological editing*/

View File

@ -233,7 +233,7 @@ class QgsVectorLayer : QgsMapLayer
/** Joins another vector layer to this layer
@param joinInfo join object containing join layer id, target and source field
@note added in 1.7 */
void addJoin( QgsVectorJoinInfo joinInfo );
void addJoin( const QgsVectorJoinInfo& joinInfo );
/** Removes a vector layer join
@note added in 1.7 */
@ -812,11 +812,21 @@ class QgsVectorLayer : QgsMapLayer
**/
bool fieldEditable( int idx );
/**label widget on top
* @note added in 1.9
**/
bool labelOnTop( int idx );
/**set edit widget editable
* @note added in 1.9
**/
void setFieldEditable( int idx, bool editable );
/**label widget on top
* @note added in 1.9
**/
void setLabelOnTop( int idx, bool onTop );
/**Adds a new overlay to this class. QgsVectorLayer takes ownership of the object
@note this method was added in version 1.1
*/

View File

@ -1,8 +1,11 @@
/**
There are two possibilities how to use this class:
1. static call to QgsVectorLayerImport::importLayer(...) which saves the whole vector layer
1. static call to QgsVectorFileWriter::writeAsShapefile(...) which saves the whole vector layer
2. create an instance of the class and issue calls to addFeature(...)
Currently supports only writing to shapefiles, but shouldn't be a problem to add capability
to support other OGR-writable formats.
*/
class QgsVectorLayerImport
{

View File

@ -16,9 +16,11 @@ class QgsRasterPipe
UnknownRole = 0,
ProviderRole = 1,
RendererRole = 2,
ResamplerRole = 3,
ProjectorRole = 4,
NullerRole = 5,
BrightnessRole = 3,
ResamplerRole = 4,
ProjectorRole = 5,
NullerRole = 6,
HueSaturationRole = 7
};
QgsRasterPipe();

View File

@ -14,12 +14,12 @@ class QgsRendererCategoryV2
~QgsRendererCategoryV2();
QVariant value() const;
QgsSymbolV2* symbol();
QgsSymbolV2* symbol() const;
QString label() const;
void setValue( const QVariant &value );
void setSymbol( QgsSymbolV2* s /Transfer/ );
void setLabel( QString label );
void setLabel( const QString &label );
// debugging
QString dump();
@ -60,6 +60,8 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
virtual int capabilities();
virtual QgsSymbolV2List symbols();
//! @note added in 2.0
void updateSymbols( QgsSymbolV2 * sym );
const QgsCategoryList& categories();
@ -74,6 +76,12 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
bool deleteCategory( int catIndex );
void deleteAllCategories();
//! Moves the category at index position from to index position to.
void moveCategory( int from, int to );
void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
QString classAttribute() const;
void setClassAttribute( QString attr );

View File

@ -32,6 +32,8 @@ class QgsSimpleFillSymbolLayerV2 : QgsFillSymbolLayerV2
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
Qt::BrushStyle brushStyle() const;
void setBrushStyle( Qt::BrushStyle style );
@ -127,6 +129,8 @@ class QgsSVGFillSymbolLayer: QgsImageFillSymbolLayer
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;
protected:
void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context );
};
class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer
@ -153,6 +157,8 @@ class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
QString ogrFeatureStyleWidth( double widthScaleFactor ) const;
//getters and setters
void setLineAngle( double a );
double lineAngle() const;
@ -232,6 +238,9 @@ class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;
protected:
void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context );
};
class QgsCentroidFillSymbolLayerV2 : QgsFillSymbolLayerV2
@ -269,4 +278,7 @@ class QgsCentroidFillSymbolLayerV2 : QgsFillSymbolLayerV2
QgsSymbolV2* subSymbol();
bool setSubSymbol( QgsSymbolV2* symbol /Transfer/ );
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;
};

View File

@ -72,6 +72,13 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
void addClass( QgsSymbolV2* symbol );
void deleteClass( int idx );
void deleteAllClasses();
//! Moves the category at index position from to index position to.
void moveClass( int from, int to );
void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
enum Mode
{

View File

@ -167,4 +167,6 @@ class QgsFeatureRendererV2
static unsigned char* _getPoint( QPointF& pt, QgsRenderContext& context, unsigned char* wkb );
static unsigned char* _getLineString( QPolygonF& pts, QgsRenderContext& context, unsigned char* wkb );
static unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& holes, QgsRenderContext& context, unsigned char* wkb );
void setScaleMethodToSymbol( QgsSymbolV2* symbol, int scaleMethod );
};

View File

@ -77,6 +77,8 @@ class QgsSymbolLayerV2
virtual void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
virtual QgsStringMap properties() const = 0;
virtual void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) = 0;
@ -157,6 +159,8 @@ class QgsMarkerSymbolLayerV2 : QgsSymbolLayerV2
protected:
QgsMarkerSymbolLayerV2( bool locked = false );
void markerOffset( QgsSymbolV2RenderContext& context, double& offsetX, double& offsetY );
static QPointF _rotatedOffset( const QPointF& offset, double angle );
};
class QgsLineSymbolLayerV2 : QgsSymbolLayerV2

View File

@ -129,6 +129,16 @@ class QgsSymbolLayerV2Utils
static void labelTextToSld( QDomDocument &doc, QDomElement &element, QString label,
QFont font, QColor color = QColor(), double size = -1 );
/**Create ogr feature style string for pen */
static QString ogrFeatureStylePen( double width, double mmScaleFactor, double mapUnitsScaleFactor, const QColor& c,
Qt::PenJoinStyle joinStyle = Qt::MiterJoin,
Qt::PenCapStyle capStyle = Qt::FlatCap,
double offset = 0.0,
const QVector<qreal>* dashPattern = 0 );
/**Create ogr feature style string for brush
@param fillColr fill color*/
static QString ogrFeatureStyleBrush( const QColor& fillColr );
static void createRotationElement( QDomDocument &doc, QDomElement &element, QString rotationFunc );
static bool rotationFromSldElement( QDomElement &element, QString &rotationFunc );

View File

@ -16,8 +16,10 @@ class QgsVectorColorRampV2
public:
virtual ~QgsVectorColorRampV2();
// Number of defined colors
virtual int count() const = 0;
// Relative value (0,1) of color at index
virtual double value( int index ) const = 0;
virtual QColor color( double value ) const = 0;
@ -62,15 +64,18 @@ class QgsVectorGradientColorRampV2 : QgsVectorColorRampV2
QColor color1() const;
QColor color2() const;
void setColor1( QColor color );
void setColor2( QColor color );
bool isDiscrete() const;
void setDiscrete( bool discrete );
void convertToDiscrete( bool discrete );
void setStops( const QgsGradientStopsList& stops );
const QgsGradientStopsList& stops() const;
QgsStringMap info() const;
void setInfo( const QgsStringMap& info );
};
class QgsVectorRandomColorRampV2 : QgsVectorColorRampV2
@ -166,6 +171,7 @@ class QgsCptCityColorRampV2
virtual QgsVectorColorRampV2* clone() const /Factory/;
void copy( const QgsCptCityColorRampV2* other );
QgsVectorGradientColorRampV2* cloneGradientRamp() const /Factory/;
virtual QgsStringMap properties() const;

View File

@ -60,4 +60,10 @@ class QgsVectorFieldSymbolLayer : QgsMarkerSymbolLayerV2
AngleOrientation angleOrientation() const;
void setAngleUnits( AngleUnits units );
AngleUnits angleUnits() const;
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;
void setDistanceUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit distanceUnit() const;
};

View File

@ -8,27 +8,82 @@ class QgsAttributeTableView : QTableView
QgsAttributeTableView( QWidget* parent = 0 );
virtual ~QgsAttributeTableView();
virtual void setModel( QgsAttributeTableFilterModel* filterModel );
/**
* Autocreates the models
* @param layerCache The {@link QgsVectorLayerCache} to use ( as backend )
* @param canvas The {@link QgsMapCanvas} to use ( for the currently visible features filter )
* @param layerCache The @link QgsVectorLayerCache @endlink to use ( as backend )
* @param canvas The @link QgsMapCanvas @endlink to use ( for the currently visible features filter )
*
* @deprecated
*/
void setCanvasAndLayerCache( QgsMapCanvas *canvas, QgsVectorLayerCache *layerCache );
protected:
/**
* Called for mouse press events on a table cell.
* Disables selection change for these events.
*
* @param event The mouse event
*/
void mousePressEvent( QMouseEvent *event );
/**
* Called for mouse release events on a table cell.
* Disables selection change for these events.
*
* @param event The mouse event
*/
void mouseReleaseEvent( QMouseEvent *event );
/**
* Called for mouse move events on a table cell.
* Disables selection change for these events.
*
* @param event The mouse event
*/
void mouseMoveEvent( QMouseEvent *event );
/**
* Called for key press events
* Disables selection change by only pressing an arrow key
*
* @param event The mouse event
*/
void keyPressEvent( QKeyEvent *event );
/**
* @brief
* Is called when the context menu will be shown. Emits a @link willShowContextMenu @endlink signal,
* so the menu can be populated by other parts of the application.
*
* @param event The associated event object.
*/
void contextMenuEvent( QContextMenuEvent* event );
/**
* Saves geometry to the settings on close
* @param event not used
*/
void closeEvent( QCloseEvent *event );
void contextMenuEvent( QContextMenuEvent* );
signals:
/**
* @brief
* Is emitted, in order to provide a hook to add aditional menu entries to the context menu.
*
* @param menu If additional QMenuItems are added, they will show up in the context menu.
* @param atIndex The QModelIndex, to which the context menu belongs. Relative to the source model.
* In most cases, this will be a @link QgsAttributeTableFilterModel @endlink
*/
void willShowContextMenu( QMenu* menu, QModelIndex atIndex );
void finished();
// void progress( int i, bool &cancel );
public slots:
void repaintRequested( QModelIndexList indexes );
void repaintRequested();
virtual void selectAll();
virtual void selectRow( int row );
virtual void _q_selectRow( int row );
};

View File

@ -483,7 +483,8 @@ class QgisInterface : QObject
virtual QDialog* getFeatureForm( QgsVectorLayer *l, QgsFeature &f ) = 0;
virtual void preloadForm(QString uifile) = 0;
virtual void preloadForm( QString uifile ) = 0;
/** Return vector layers in edit mode
* @param modified whether to return only layers that have been modified
* @returns list of layers in legend order, or empty list

View File

@ -8,11 +8,34 @@ class QgsAttributeEditor : QObject
public:
QgsAttributeEditor( QObject *parent );
static QWidget *createAttributeEditor( QWidget *parent, QWidget *editor, QgsVectorLayer *vl, int idx, const QVariant &value );
static QWidget *createAttributeEditor( QWidget *parent, QWidget *editor, QgsVectorLayer *vl, int idx, const QVariant &value ) /Factory/;
static bool retrieveValue( QWidget *widget, QgsVectorLayer *vl, int idx, QVariant &value );
static bool setValue( QWidget *widget, QgsVectorLayer *vl, int idx, const QVariant &value );
public slots:
void selectFileName();
void selectDate();
void loadUrl( const QString & );
void loadPixmap( const QString & );
void updateUrl();
void openUrl();
void updateColor();
};
class QgsStringRelay : QObject
{
%TypeHeaderCode
#include "qgsattributeeditor.h"
%End
public:
QgsStringRelay( QObject* parent = 0 );
void appendProxy( QWidget* proxy );
public slots:
void changeText();
void changeText( QString str );
signals:
void textChanged( QString );
};

View File

@ -60,6 +60,12 @@ class QgsComposerView: QGraphicsView
void setPaintingEnabled( bool enabled );
bool paintingEnabled() const;
/**Update rulers with current scene rect*/
void updateRulers();
void setHorizontalRuler( QgsComposerRuler* r );
void setVerticalRuler( QgsComposerRuler* r );
protected:
void mousePressEvent( QMouseEvent* );
void mouseReleaseEvent( QMouseEvent* );
@ -75,6 +81,8 @@ class QgsComposerView: QGraphicsView
void hideEvent( QHideEvent* e );
void showEvent( QShowEvent* e );
void resizeEvent( QResizeEvent* event );
void scrollContentsBy( int dx, int dy );
signals:
/**Is emitted when selected item changed. If 0, no item is selected*/
void selectedItemChanged( QgsComposerItem* selected );

View File

@ -24,8 +24,10 @@ class QgsExpressionBuilderDialog : QDialog
protected:
/**
* Handle closing of the window
* @param event unused
* Is called when the dialog get accepted or rejected
* Used to save geometry
*
* @param r result value (unused)
*/
void closeEvent( QCloseEvent * event );
virtual void done( int r );
};

View File

@ -10,6 +10,10 @@ class QgsFilterLineEdit : QLineEdit
public:
QgsFilterLineEdit( QWidget* parent = 0 );
signals:
void cleared();
protected:
void resizeEvent( QResizeEvent * );
void changeEvent( QEvent * );
};

View File

@ -17,7 +17,8 @@ class QgsManageConnectionsDialog : QDialog
PostGIS,
WFS,
MSSQL,
WCS
WCS,
Oracle,
};
// constructor

View File

@ -49,7 +49,7 @@ class QgsMapTool : QObject
//! Mouse wheel event for overriding. Default implementation does nothing.
//! Added in version 2.0
virtual void wheelEvent( QWheelEvent * e );
virtual void wheelEvent( QWheelEvent* e );
//! Key event for overriding. Default implementation does nothing.
virtual void keyPressEvent( QKeyEvent* e );

View File

@ -6,21 +6,21 @@ class QgsMapToolIdentify : QgsMapTool
%End
public:
enum IdentifyMode
{
DefaultQgsSetting=-1,
ActiveLayer,
TopDownStopAtFirst,
TopDownAll,
DefaultQgsSetting = -1,
ActiveLayer,
TopDownStopAtFirst,
TopDownAll
};
enum LayerType
{
AllLayers=-1,
VectorLayer,
RasterLayer,
AllLayers = -1,
VectorLayer,
RasterLayer
};
struct IdentifyResult
{
@ -32,16 +32,19 @@ class QgsMapToolIdentify : QgsMapTool
IdentifyResult( QgsMapLayer * layer, QString label, QgsFields fields, QgsFeature feature, QMap< QString, QString > derivedAttributes );
QgsMapLayer* mLayer;
QgsMapLayer* mLayer;
QString mLabel;
QgsFields mFields;
QgsFeature mFeature;
QMap< QString, QString > mAttributes;
QMap< QString, QString > mDerivedAttributes;
QMap< QString, QVariant > mParams;
};
//! constructor
QgsMapToolIdentify( QgsMapCanvas* canvas );
//! constructor
QgsMapToolIdentify( QgsMapCanvas * canvas );
virtual ~QgsMapToolIdentify();
//! Overridden mouse move event
virtual void canvasMoveEvent( QMouseEvent * e );
@ -56,8 +59,6 @@ class QgsMapToolIdentify : QgsMapTool
virtual void deactivate();
//QgsMapLayer::LayerType LayerType;
/** Performs the identification.
@param x x coordinates of mouseEvent
@param y y coordinates of mouseEvent
@ -76,14 +77,11 @@ class QgsMapToolIdentify : QgsMapTool
@return a list of IdentifyResult*/
QList<QgsMapToolIdentify::IdentifyResult> identify(int x, int y, IdentifyMode mode, LayerType layerType = AllLayers);
public slots:
void formatChanged( QgsRasterLayer *layer );
signals:
void identifyProgress( int, int );
void identifyMessage( QString );
private:
//! Private helper
virtual void convertMeasurement( QgsDistanceArea &calc, double &measure, QGis::UnitType &u, bool isArea );
/** Transforms the measurements of derived attributes in the desired units*/
virtual QGis::UnitType displayUnits();
void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult>& );
};

View File

@ -4,6 +4,7 @@ class QgsSublayersDialog : QDialog
#include <qgssublayersdialog.h>
%End
public:
enum ProviderType
{
Ogr,
@ -15,6 +16,8 @@ class QgsSublayersDialog : QDialog
~QgsSublayersDialog();
void populateLayerTable( QStringList theList, QString delim = ":" );
// Returns list of selected layers, if there are more layers with the same name,
// geometry type is appended separated by semicolon, example: <layer>:<geometryType>
QStringList selectionNames();
QList<int> selectionIndexes();

View File

@ -11,6 +11,9 @@ class QgsRasterMinMaxWidget: QWidget
void setBands( const QList<int> & theBands );
// Load programmaticaly with current values
void load();
signals:
void load( int theBandNo, double theMin, double theMax, int origin );
};

View File

@ -5,6 +5,12 @@ class QgsSingleBandPseudoColorRendererWidget : QgsRasterRendererWidget
%End
public:
enum Mode
{
Continuous = 1, // Using breaks from color palette
EqualInterval = 2
};
QgsSingleBandPseudoColorRendererWidget( QgsRasterLayer* layer, const QgsRectangle &extent = QgsRectangle() );
~QgsSingleBandPseudoColorRendererWidget();

View File

@ -10,6 +10,8 @@ class QgsCptCityColorRampV2Dialog : QDialog
QString selectedName() const;
bool saveAsGradientRamp() const;
public slots:
void populateVariants();
@ -19,7 +21,7 @@ class QgsCptCityColorRampV2Dialog : QDialog
void on_pbtnLicenseDetails_pressed();
void on_cboVariantName_currentIndexChanged( int index );
void onFinished();
void on_buttonBox_helpRequested();
/* void refresh(); */
protected:

View File

@ -39,7 +39,10 @@ class QgsSimpleLineSymbolLayerV2Widget : QgsSymbolLayerV2Widget
void offsetChanged();
void on_mCustomCheckBox_stateChanged( int state );
void on_mChangePatternButton_clicked();
void on_mPenWidthUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mDashPatternUnitComboBox_currentIndexChanged( int index );
void on_mDataDefinedPropertiesButton_clicked();
protected:
//creates a new icon for the 'change pattern' button
@ -70,6 +73,11 @@ class QgsSimpleMarkerSymbolLayerV2Widget : QgsSymbolLayerV2Widget
void setSize();
void setAngle();
void setOffset();
void on_mSizeUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mOutlineWidthUnitComboBox_currentIndexChanged( int index );
void on_mDataDefinedPropertiesButton_clicked();
void on_mOutlineWidthSpinBox_valueChanged( double d );
};
///////////
@ -96,6 +104,9 @@ class QgsSimpleFillSymbolLayerV2Widget : QgsSymbolLayerV2Widget
void borderWidthChanged();
void borderStyleChanged();
void offsetChanged();
void on_mBorderWidthUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mDataDefinedPropertiesButton_clicked();
};
@ -121,6 +132,9 @@ class QgsMarkerLineSymbolLayerV2Widget : QgsSymbolLayerV2Widget
void setRotate();
void setOffset();
void setPlacement();
void on_mIntervalUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mDataDefinedPropertiesButton_clicked();
};
@ -150,9 +164,14 @@ class QgsSvgMarkerSymbolLayerV2Widget : QgsSymbolLayerV2Widget
void setOffset();
void on_mFileToolButton_clicked();
void on_mFileLineEdit_textEdited( const QString& text );
void on_mFileLineEdit_editingFinished();
void on_mChangeColorButton_colorChanged( const QColor& color );
void on_mChangeBorderColorButton_colorChanged( const QColor& color );
void on_mBorderWidthSpinBox_valueChanged( double d );
void on_mSizeUnitComboBox_currentIndexChanged( int index );
void on_mBorderWidthUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mDataDefinedPropertiesButton_clicked();
protected:
@ -182,6 +201,7 @@ class QgsLineDecorationSymbolLayerV2Widget : QgsSymbolLayerV2Widget
public slots:
void colorChanged( const QColor& color );
void penWidthChanged();
void on_mWidthUnitComboBox_currentIndexChanged( int index );
};
//////////
@ -200,6 +220,10 @@ class QgsSVGFillSymbolLayerWidget : QgsSymbolLayerV2Widget
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();
protected:
void insertIcons();
void updateParamGui();
};
//////////
@ -257,6 +281,8 @@ class QgsFontMarkerSymbolLayerV2Widget : QgsSymbolLayerV2Widget
void setAngle( double angle );
void setCharacter( const QChar& chr );
void setOffset();
void on_mSizeUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
};
//////////

View File

@ -49,59 +49,11 @@ class ANALYSIS_EXPORT QgsOverlayAnalyzer
const QString& shapefileName, bool onlySelectedFeatures = false,
QProgressDialog* p = 0 );
#if 0
/**Perform a union of two input vector layers and write output to a new shape file
@param layerA input vector layer
@param layerB input vector layer
@param shapefileName path to the output shp
@param onlySelectedFeatures if true, only selected features are considered, else all the features
@param p progress dialog (or 0 if no progress dialog is to be shown)
@note: added in version 1.4*/
bool combine( QgsVectorLayer* layerA, QgsVectorLayer* layerB,
const QString& shapefileName, bool onlySelectedFeatures = false,
QProgressDialog* p = 0 );
/**Clip a vector layer based on the boundary of another vector layer and
write output to a new shape file
@param layerA input vector layer
@param layerB input vector layer
@param shapefileName path to the output shp
@param onlySelectedFeatures if true, only selected features are considered, else all the features
@param p progress dialog (or 0 if no progress dialog is to be shown)
@note: added in version 1.4*/
bool clip( QgsVectorLayer* layerA, QgsVectorLayer* layerB,
const QString& shapefileName, bool onlySelectedFeatures = false,
QProgressDialog* p = 0 );
/**Difference a vector layer based on the geometries of another vector layer
and write the output to a new shape file
@param layerA input vector layer
@param layerB input vector layer
@param shapefileName path to the output shp
@param onlySelectedFeatures if true, only selected features are considered, else all the features
@param p progress dialog (or 0 if no progress dialog is to be shown)
@note: added in version 1.4*/
bool difference( QgsVectorLayer* layerA, QgsVectorLayer* layerB,
const QString& shapefileName, bool onlySelectedFeatures = false,
QProgressDialog* p = 0 );
/**Intersect two vector layers and write the geometries of each layer that
do not intersect with the other layer to a new shape file (Symmetrical difference)
@param layerA input vector layer
@param layerB input vector layer
@param shapefileName path to the output shp
@param onlySelectedFeatures if true, only selected features are considered, else all the features
@param p progress dialog (or 0 if no progress dialog is to be shown)
@note: added in version 1.4*/
bool symDifference( QgsVectorLayer* layerA, QgsVectorLayer* layerB,
const QString& shapefileName, bool onlySelectedFeatures = false,
QProgressDialog* p = 0 );
#endif
private:
void combineFieldLists( QgsFields& fieldListA, const QgsFields& fieldListB );
void intersectFeature( QgsFeature& f, QgsVectorFileWriter* vfw, QgsVectorLayer* dp, QgsSpatialIndex* index );
void combineAttributeMaps( QgsAttributes& attributesA, const QgsAttributes& attributesB );
};
#endif //QGSVECTORANALYZER

View File

@ -48,7 +48,6 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
/**Paints the legend and calculates its size. If painter is 0, only size is calculated*/
QSizeF paintAndDetermineSize( QPainter* painter );
/**Sets item box to the whole content*/
void adjustBoxSize();

View File

@ -94,7 +94,7 @@ class CORE_EXPORT QgsComposerSymbolV2Item: public QgsComposerLegendItem
QgsSymbolV2* mSymbolV2;
};
class CORE_EXPORT QgsComposerRasterSymbolItem: public QgsComposerLegendItem
class CORE_EXPORT QgsComposerRasterSymbolItem : public QgsComposerLegendItem
{
public:
QgsComposerRasterSymbolItem();
@ -119,7 +119,7 @@ class CORE_EXPORT QgsComposerRasterSymbolItem: public QgsComposerLegendItem
QColor mColor;
};
class CORE_EXPORT QgsComposerLayerItem: public QgsComposerLegendItem
class CORE_EXPORT QgsComposerLayerItem : public QgsComposerLegendItem
{
public:
QgsComposerLayerItem();

View File

@ -61,7 +61,7 @@ class QgsComposer;
* them in a list in ascending z-Order. This list can be changed to lower/raise items one position
* or to bring them to front/back.
* */
class CORE_EXPORT QgsComposition: public QGraphicsScene
class CORE_EXPORT QgsComposition : public QGraphicsScene
{
Q_OBJECT
public:
@ -282,7 +282,9 @@ class CORE_EXPORT QgsComposition: public QGraphicsScene
QGraphicsLineItem* addSnapLine();
/**Remove custom snap line (and delete the object)*/
void removeSnapLine( QGraphicsLineItem* line );
/**Get nearest snap line*/
/**Get nearest snap line
* @note not availabel in python bindings
*/
QGraphicsLineItem* nearestSnapLine( bool horizontal, double x, double y, double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > >& snappedItems );
/**Hides / shows custom snap lines*/
void setSnapLinesVisible( bool visible );

View File

@ -56,7 +56,9 @@ class CORE_EXPORT QgsDataDefined
QString expressionString() const { return mExpressionString; }
void setExpressionString( const QString& expr ) { mExpressionString = expr; }
// @note not available in python bindings
QMap<QString, QVariant> expressionParams() const { return mExpressionParams; }
// @note not available in python bindings
void setExpressionParams( QMap<QString, QVariant> params ) { mExpressionParams = params; }
void insertExpressionParam( QString key, QVariant param );
@ -69,6 +71,7 @@ class CORE_EXPORT QgsDataDefined
QString field() const { return mField; }
void setField( const QString& field ) { mField = field; }
// @note not available in python bindings
QMap< QString, QString > toMap();
private:

View File

@ -91,9 +91,6 @@ class CORE_EXPORT QgsGmlSchema: public QObject
/** Get list of dot separated paths to feature classes parsed from GML or XSD */
QStringList typeNames() const;
/** Get map of fields parsed from XSD by parseXSD */
//QMap<int, QgsField> fields();
/** Get fields for type/class name parsed from GML or XSD */
QList<QgsField> fields( const QString & typeName );

View File

@ -221,13 +221,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
* @note Added in v1.4 */
void removeCustomProperty( const QString& key );
#if 0
/** Accessor for transparency level. */
unsigned int getTransparency();
/** Mutator for transparency level. Should be between 0 and 255 */
virtual void setTransparency( unsigned int );
#endif
/**
* If an operation returns 0 (e.g. draw()), this function
@ -378,7 +371,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
* @brief Is called when the cache image is being deleted. Overwrite and use to clean up.
* @note added in 2.0
*/
virtual void onCacheImageDelete() {};
virtual void onCacheImageDelete() {}
public slots:

View File

@ -35,7 +35,6 @@ class CORE_EXPORT QgsRendererCategoryV2
//! copy constructor
QgsRendererCategoryV2( const QgsRendererCategoryV2& cat );
~QgsRendererCategoryV2();
QgsRendererCategoryV2& operator=( const QgsRendererCategoryV2& cat );