[qgis] 01/01: Imported Upstream version 2.12.2+dfsg
Sebastiaan Couwenberg
sebastic at moszumanska.debian.org
Mon Dec 21 11:45:52 UTC 2015
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch upstream
in repository qgis.
commit d5c42650d4d06d176c8da1478eeec1d105b4215f
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Mon Dec 21 02:57:32 2015 +0100
Imported Upstream version 2.12.2+dfsg
---
CMakeLists.txt | 2 +-
ChangeLog | 82 +++++++
debian/changelog | 10 +-
debian/control.in | 11 +-
debian/rules | 19 +-
python/core/dxf/qgsdxfexport.sip | 4 +-
python/core/qgsdataitem.sip | 1 +
python/core/qgsdatasourceuri.sip | 1 +
python/core/qgsfeature.sip | 2 +-
python/core/qgsgml.sip | 1 +
python/core/qgsvectorlayer.sip | 237 +++++++++++++++++++--
.../raster/qgssinglebandpseudocolorrenderer.sip | 1 +
.../qgscategorizedsymbolrendererv2.sip | 3 +
.../symbology-ng/qgsgraduatedsymbolrendererv2.sip | 4 +-
python/core/symbology-ng/qgsheatmaprenderer.sip | 2 +
.../symbology-ng/qgsinvertedpolygonrenderer.sip | 24 ++-
.../symbology-ng/qgspointdisplacementrenderer.sip | 24 ++-
python/core/symbology-ng/qgsrendererv2.sip | 3 +-
.../core/symbology-ng/qgsrulebasedrendererv2.sip | 138 +++++++++++-
.../symbology-ng/qgssinglesymbolrendererv2.sip | 3 +
python/core/symbology-ng/qgssymbollayerv2.sip | 1 +
python/core/symbology-ng/qgssymbollayerv2utils.sip | 4 +-
.../attributetable/qgsifeatureselectionmanager.sip | 2 +-
python/gui/qgscollapsiblegroupbox.sip | 21 +-
.../db_manager/db_plugins/oracle/connector.py | 4 +-
python/plugins/db_manager/dlg_sql_window.py | 26 ++-
src/app/legend/qgsapplegendinterface.cpp | 26 ++-
src/core/dxf/qgsdxfexport.cpp | 2 +-
src/core/dxf/qgsdxfexport.h | 1 +
src/core/qgsdataitem.h | 1 +
src/core/qgsdatasourceuri.h | 1 +
src/core/qgsgml.h | 1 +
src/core/qgsvectorlayer.h | 16 +-
src/core/raster/qgssinglebandpseudocolorrenderer.h | 1 +
.../symbology-ng/qgscategorizedsymbolrendererv2.h | 3 +
.../symbology-ng/qgsgraduatedsymbolrendererv2.h | 4 +-
src/core/symbology-ng/qgsheatmaprenderer.h | 2 +
src/core/symbology-ng/qgsinvertedpolygonrenderer.h | 24 ++-
.../symbology-ng/qgspointdisplacementrenderer.h | 24 ++-
src/core/symbology-ng/qgsrendererv2.h | 4 +-
src/core/symbology-ng/qgsrulebasedrendererv2.cpp | 2 +-
src/core/symbology-ng/qgsrulebasedrendererv2.h | 3 +-
src/core/symbology-ng/qgssinglesymbolrendererv2.h | 3 +
src/core/symbology-ng/qgssymbollayerv2.h | 1 +
src/core/symbology-ng/qgssymbollayerv2utils.h | 2 +
.../symbology-ng/qgsrulebasedrendererv2widget.cpp | 2 +-
.../oracle/ocispatial/qsql_ocispatial.cpp | 88 +++++---
src/providers/oracle/qgsoracleconn.h | 4 +-
src/providers/oracle/qgsoracledataitems.cpp | 8 +-
src/providers/oracle/qgsoraclefeatureiterator.cpp | 21 +-
src/providers/oracle/qgsoracleprovider.cpp | 91 +++++---
src/providers/oracle/qgsoraclesourceselect.cpp | 22 +-
src/providers/oracle/qgsoracletablecache.cpp | 14 +-
src/providers/oracle/qgsoracletablemodel.cpp | 2 +-
src/server/qgshttprequesthandler.cpp | 1 +
src/server/qgsserverprojectparser.cpp | 40 +++-
src/server/qgswmsconfigparser.cpp | 2 +-
57 files changed, 836 insertions(+), 210 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bdc1925..5610400 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "12")
-SET(CPACK_PACKAGE_VERSION_PATCH "1")
+SET(CPACK_PACKAGE_VERSION_PATCH "2")
SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
SET(RELEASE_NAME "Lyon")
IF (POLICY CMP0048) # in CMake 3.0.0+
diff --git a/ChangeLog b/ChangeLog
index 2ebdaec..14e3f12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,85 @@
+rldhont <rldhont at gmail.com> 2015-12-18
+
+ [BUGFIX] WFS GetCapabilities respons misses <keywords> key
+
+ Fixes #13037 WFS GetCapabilities respons misses <keywords> key
+
+ Replace KeywordList by Keywords in WFS Getcapabilities and keywords in WCS GetCapabilities.
+
+Juergen E. Fischer <jef at norbit.de> 2015-12-02
+
+ oracle provider: fix geometry type/srid detection for queries
+
+Juergen E. Fischer <jef at norbit.de> 2015-11-08
+
+ oracle provider: add/fix support for multiple geometry columns (fixes #13158)
+
+rldhont <rldhont at gmail.com> 2015-12-15
+
+ Dont set content-length header on streamed response. Fixes #13991
+
+ Thanks to @AsgerPetersen to help fixing #13991
+ closes #2582
+
+Juergen E. Fischer <jef at norbit.de> 2015-12-14
+
+ debian packaging update (partly reverts 245659f; fixes #13981)
+
+ (cherry picked from commit 24a61ff48d16309d4a43fe5e12d7e110984f2655)
+
+rldhont <rldhont at gmail.com> 2015-12-14
+
+ [BUGFIX][QGIS Server] Update Layer order from group in GetPrint
+
+ Update commit da5e73ef4a4508c4b215dd726380a8a94bd73ada
+
+Juergen E. Fischer <jef at norbit.de> 2015-12-14
+
+ dxf export: trim whitespace from layernames
+
+ (cherry picked from commit 36267f59350881e10e2eae0aa9f110019a5e8d8c)
+
+Juergen E. Fischer <jef at norbit.de> 2015-12-02
+
+ db manager: only alias subqueries on postgres (fixes #13731)
+
+ Conflicts:
+python/plugins/db_manager/dlg_sql_window.py
+
+Juergen E. Fischer <jef at norbit.de> 2015-12-02
+
+ db manager oracle plugin: avoid tablespace index parameter
+
+Juergen E. Fischer <jef at norbit.de> 2015-12-07
+
+ fix deprecation warnings (followup 5f86422)
+
+Juergen E. Fischer <jef at norbit.de> 2015-12-06
+
+ debian packaging update
+ * sync other branches
+ * avoid testing and installing twice
+ * manually merge PR#2524
+
+Juergen E. Fischer <jef at norbit.de> 2015-11-08
+
+ * fix QgsFeatureIds typedef (fixes missing signal
+ QgsVectorLayer.featuresDeleted and others; fixes #13740)
+ * add missing notes for PyNames
+ * include some missing new methods in bindings
+
+ (backported from commit b5794b2)
+
+Juergen E. Fischer <jef at norbit.de> 2015-11-29
+
+ legend interface: guard layer dereferences (fixes #13899)
+
+ (cherry picked from commit 3b2d7173f66ee260021a262167f571eb7ff72788)
+
+Juergen E. Fischer <jef at norbit.de> 2015-11-27
+
+ Release of 2.12.1
+
Matthias Kuhn <matthias at opengis.ch> 2015-11-26
Disable grass7 tests
diff --git a/debian/changelog b/debian/changelog
index e4c40f6..0a2af33 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,14 @@
-qgis (2.12.1) UNRELEASED; urgency=medium
+qgis (2.12.2) UNRELEASED; urgency=medium
+
+ * Release of 2.12.2
+
+ -- Jürgen E. Fischer <jef at norbit.de> Fri, 18 Dec 2015 14:21:33 +0100
+
+qgis (2.12.1) unstable; urgency=medium
* Release of 2.12.1
- -- Jürgen E. Fischer <jef at norbit.de> Fri, 27 Nov 2015 13:00:38 +0100
+ -- Jürgen E. Fischer <jef at norbit.de> Fri, 18 Dec 2015 14:21:33 +0100
qgis (2.12.0) unstable; urgency=medium
diff --git a/debian/control.in b/debian/control.in
index d9fe037..218da77 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -7,6 +7,7 @@ Build-Depends:
bison,
cmake (>= 2.8),
#sid stretch jessie wheezy saucy trusty utopic vivid wily# debhelper (>= 9),
+#sid stretch jessie trusty vivid wily# dh-python,
#precise# debhelper (>= 7),
flex,
grass-dev,
@@ -16,8 +17,9 @@ Build-Depends:
#precise# libgdal-dev (>= 1.9.0) | libgdal1-dev (<< 1.9.0),
#saucy# libgdal-dev (>= 1.9.0),
#wheezy# libgdal1-dev,
+ python-gdal,
libgeos-dev (>= 3.0.0),
- libgsl0-dev,
+ libgsl-dev | libgsl0-dev,
libpq-dev,
libproj-dev,
libqt4-dev (>= 4.7.0),
@@ -26,7 +28,7 @@ Build-Depends:
libqca2-plugin-ossl,
libqtwebkit-dev,
#stretch jessie wheezy# libqwt-dev,
-#precise saucy trusty utopic vivid wily stretch sid# libqwt5-qt4-dev,
+#precise saucy trusty utopic vivid wily sid# libqwt5-qt4-dev,
libspatialite-dev,
libsqlite3-dev,
libspatialindex-dev,
@@ -41,9 +43,8 @@ Build-Depends:
#saucy wheezy# python-dev,
#saucy# libpython2.7-dev,
#sid stretch jessie trusty utopic vivid wily# python-all (>= 2.6.6-3~), python-all-dev (>= 2.6.6-3~),
-#sid stretch jessie# pyqt4.qsci-dev,
+#sid stretch jessie wily# pyqt4.qsci-dev,
#sid stretch jessie trusty utopic vivid wily# python-pyspatialite,
-#sid stretch# dh-python,
python-sip (>= 4.5.0),
python-sip-dev (>= 4.5.0),
libosgearth-dev,
@@ -241,7 +242,7 @@ Depends:
#saucy# libgdal-dev (>= 1.9.0),
#wheezy# libgdal1-dev,
libgeos-dev (>= 3.0.0),
- libgsl0-dev,
+ libgsl-dev | libgsl0-dev,
libpq-dev,
libproj-dev,
libqgis-app{QGIS_ABI} (= ${binary:Version}),
diff --git a/debian/rules b/debian/rules
index 6b62fc8..0150458 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,9 +16,9 @@ DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
QT_PLUGIN_DIR = usr/lib/$(DEB_BUILD_MULTIARCH)/qt4/plugins
DEB_TEST_TARGET ?= Experimental
-BUILDDIR ?= debian/build
+QGIS_BUILDDIR ?= debian/build
-QGIS_VERSION=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p')
+QGIS_VERSION=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \([0-9]\+:\)\?\([^+-]\+\).*$$/\2/p')
ifeq (,$(DISTRIBUTION))
DISTRIBUTION := $(shell dpkg-parsechangelog --format rfc822 | sed -ne "s/^Distribution: //p")
@@ -148,6 +148,7 @@ ifneq (,$(findstring profile,$(DEB_BUILD_OPTIONS)))
LDFLAGS += -pg
endif
+
# multi distribution support:
# - remove lines with applicable excludes
# - remove prefixes with applicable includes
@@ -190,7 +191,7 @@ cleantemplates:
$(MAKE) -f debian/rules debian/control debian/compat
binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep:
- dh $@ --with python2 --parallel --builddirectory=$(BUILDDIR)
+ dh $@ --with python2 --parallel --builddirectory=$(QGIS_BUILDDIR)
override_dh_clean: cleantemplates
dh_clean
@@ -199,25 +200,27 @@ override_dh_clean: cleantemplates
-$(RM) $(CURDIR)/src/core/qgscontexthelp_texts.cpp
-$(RM) $(CURDIR)/src/core/qgsexpression_texts.cpp
- -$(RM) -r $(CURDIR)/$(BUILDDIR)/
+ -$(RM) -r $(CURDIR)/$(QGIS_BUILDDIR)/
override_dh_auto_configure: templates
dh_auto_configure -- $(CMAKE_OPTS)
+override_dh_auto_test: test-stamp
+
+test-stamp:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-override_dh_auto_test:
# Code to run the package test suite - and ignore the outcome for now
mkdir -p debian/tmp/locale/
localedef -f UTF-8 -i en_US ./debian/tmp/locale/en_US.UTF-8/
-LOCPATH=$(CURDIR)/debian/tmp/locale/ \
LC_ALL=en_US.UTF-8 \
- LD_LIBRARY_PATH=$(CURDIR)/$(BUILDDIR)/output/lib:$(LD_LIBRARY_PATH) \
+ LD_LIBRARY_PATH=$(CURDIR)/$(QGIS_BUILDDIR)/output/lib:$(LD_LIBRARY_PATH) \
PATH=/usr/sbin:$(PATH) \
- $(TESTMAKE) -C $(BUILDDIR) $(DEB_TEST_TARGET)
+ $(TESTMAKE) -C $(QGIS_BUILDDIR) $(DEB_TEST_TARGET)
else
-override_dh_auto_test:
@echo Skipping tests.
endif
+ touch test-stamp
override_dh_auto_install:
dh_auto_install
diff --git a/python/core/dxf/qgsdxfexport.sip b/python/core/dxf/qgsdxfexport.sip
index 11a80fc..1880f27 100644
--- a/python/core/dxf/qgsdxfexport.sip
+++ b/python/core/dxf/qgsdxfexport.sip
@@ -60,13 +60,13 @@ class QgsDxfExport
void writeInt( int i );
void writeDouble( double d );
void writeString( const QString &s );
+ //! @note available in python bindings as writeGroupPoint
void writeGroup( int code, const QgsPoint &p, double z = 0.0, bool skipz = false ) /PyName=writeGroupPoint/;
void writeGroup( const QColor& color, int exactMatch = 62, int rgbCode = 420, int transparencyCode = 440 );
- //! Write handle
int writeHandle( int code = 5, int handle = 0 );
- //! Draw dxf polyline
+ //! Draw dxf primitives (LWPOLYLINE)
void writePolyline( const QgsPolyline &line, const QString &layer, const QString &lineStyleName, const QColor& color, double width = -1 );
//! Draw dxf polygon (HATCH)
diff --git a/python/core/qgsdataitem.sip b/python/core/qgsdataitem.sip
index fadef58..7246841 100644
--- a/python/core/qgsdataitem.sip
+++ b/python/core/qgsdataitem.sip
@@ -354,6 +354,7 @@ class QgsZipItem : QgsDataCollectionItem
static QString vsiPrefix( const QString& uri );
static QgsDataItem* itemFromPath( QgsDataItem* parent, QString path, QString name ) /Factory/;
+ //! @note available in python as itemFromFilePath
static QgsDataItem* itemFromPath( QgsDataItem* parent, const QString& filePath, const QString& name, const QString& path ) /Factory,PyName=itemFromFilePath/;
static const QIcon &iconZip();
diff --git a/python/core/qgsdatasourceuri.sip b/python/core/qgsdatasourceuri.sip
index 67d5214..3206dd5 100644
--- a/python/core/qgsdatasourceuri.sip
+++ b/python/core/qgsdatasourceuri.sip
@@ -38,6 +38,7 @@ class QgsDataSourceURI
//! Set generic param (generic mode)
// \note if key exists, another is inserted
void setParam( const QString &key, const QString &value );
+ //! @note available in python as setParamList
void setParam( const QString &key, const QStringList &value ) /PyName=setParamList/;
//! Remove generic param (generic mode)
diff --git a/python/core/qgsfeature.sip b/python/core/qgsfeature.sip
index 6903693..5a65122 100644
--- a/python/core/qgsfeature.sip
+++ b/python/core/qgsfeature.sip
@@ -498,4 +498,4 @@ class QgsFeature
}; // class QgsFeature
-typedef QSet<QgsFeatureId> QgsFeatureIds;
+typedef QSet<qint64> QgsFeatureIds;
diff --git a/python/core/qgsgml.sip b/python/core/qgsgml.sip
index 7e3f985..15dc583 100644
--- a/python/core/qgsgml.sip
+++ b/python/core/qgsgml.sip
@@ -21,6 +21,7 @@ class QgsGml: QObject
* @param password password for authentication
* @param authcfg authentication configuration id
* @return 0 in case of success
+ * @note available in python as getFeaturesUri
*/
int getFeatures( const QString& uri, QGis::WkbType* wkbType, QgsRectangle* extent = 0, const QString& userName = QString(), const QString& password = QString(), const QString& authcfg = QString() ) /PyName=getFeaturesUri/;
diff --git a/python/core/qgsvectorlayer.sip b/python/core/qgsvectorlayer.sip
index a36fd0c..558a11f 100644
--- a/python/core/qgsvectorlayer.sip
+++ b/python/core/qgsvectorlayer.sip
@@ -35,13 +35,39 @@ class QgsAttributeEditorElement : QObject
AeTypeInvalid
};
+ /**
+ * Constructor
+ *
+ * @param type The type of the new element. Should never
+ * @param name
+ * @param parent
+ */
QgsAttributeEditorElement( AttributeEditorType type, const QString& name, QObject *parent /TransferThis/ = NULL );
+ //! Destructor
virtual ~QgsAttributeEditorElement();
+ /**
+ * Return the name of this element
+ *
+ * @return The name for this element
+ */
QString name() const;
+
+ /**
+ * The type of this element
+ *
+ * @return The type
+ */
AttributeEditorType type() const;
+ /**
+ * Is reimplemented in classes inheriting from this to serialize it.
+ *
+ * @param doc The QDomDocument which is used to create new XML elements
+ *
+ * @return An DOM element which represents this element
+ */
virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
};
@@ -52,43 +78,152 @@ class QgsAttributeEditorContainer : QgsAttributeEditorElement
%End
public:
+ /**
+ * Creates a new attribute editor container
+ *
+ * @param name The name to show as title
+ * @param parent The parent. May be another container.
+ */
QgsAttributeEditorContainer( const QString& name, QObject *parent /TransferThis/ );
+ //! Destructor
~QgsAttributeEditorContainer();
+ /**
+ * Will serialize this containers information into a QDomElement for saving it in an XML file.
+ *
+ * @param doc The QDomDocument used to generate the QDomElement
+ *
+ * @return The XML element
+ */
virtual QDomElement toDomElement( QDomDocument& doc ) const;
+
+ /**
+ * Add a child element to this container. This may be another container, a field or a relation.
+ *
+ * @param element The element to add as child
+ */
virtual void addChildElement( QgsAttributeEditorElement *widget );
+
+ /**
+ * Determines if this container is rendered as collapsible group box or tab in a tabwidget
+ *
+ * @param isGroupBox If true, this will be a group box
+ */
virtual void setIsGroupBox( bool isGroupBox );
+
+ /**
+ * Returns if this container is going to be rendered as a group box
+ *
+ * @return True if it will be a group box, false if it will be a tab
+ */
virtual bool isGroupBox() const;
- virtual void setName( const QString& name );
+
+ /**
+ * Get a list of the children elements of this container
+ *
+ * @return A list of elements
+ */
QList<QgsAttributeEditorElement*> children() const;
+
+ /**
+ * Traverses the element tree to find any element of the specified type
+ *
+ * @param type The type which should be searched
+ *
+ * @return A list of elements of the type which has been searched for
+ */
+ virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
+
+ /**
+ * Change the name of this container
+ *
+ * @param name
+ */
+ virtual void setName( const QString& name );
+
};
+/**
+ * This element will load a field's widget onto the form.
+ */
class QgsAttributeEditorField : QgsAttributeEditorElement
{
%TypeHeaderCode
#include "qgsvectorlayer.h"
%End
public:
+ /**
+ * Creates a new attribute editor element which represents a field
+ *
+ * @param name The name of the element
+ * @param idx The index of the field which should be embedded
+ * @param parent The parent of this widget (used as container)
+ */
QgsAttributeEditorField( const QString& name, int idx, QObject *parent /TransferThis/ );
+ //! Destructor
~QgsAttributeEditorField();
+ /**
+ * Will serialize this elements information into a QDomElement for saving it in an XML file.
+ *
+ * @param doc The QDomDocument used to generate the QDomElement
+ *
+ * @return The XML element
+ */
virtual QDomElement toDomElement( QDomDocument& doc ) const;
+
+ /**
+ * Return the index of the field
+ * @return
+ */
int idx() const;
};
-/** @note Added in 2.1 */
+/**
+ * This element will load a relation editor onto the form.
+ *
+ * @note Added in 2.1
+ */
class QgsAttributeEditorRelation : QgsAttributeEditorElement
{
public:
+ /**
+ * Creates a new element which embeds a relation.
+ *
+ * @param name The name of this element
+ * @param relationId The id of the relation to embed
+ * @param parent The parent (used as container)
+ */
QgsAttributeEditorRelation( const QString& name, const QString &relationId, QObject *parent /TransferThis/ );
+ /**
+ * Creates a new element which embeds a relation.
+ *
+ * @param name The name of this element
+ * @param relation The relation to embed
+ * @param parent The parent (used as container)
+ */
QgsAttributeEditorRelation( const QString& name, const QgsRelation& relation, QObject *parent /TransferThis/);
+ //! Destructor
~QgsAttributeEditorRelation();
+ /**
+ * Will serialize this elements information into a QDomElement for saving it in an XML file.
+ *
+ * @param doc The QDomDocument used to generate the QDomElement
+ *
+ * @return The XML element
+ */
virtual QDomElement toDomElement( QDomDocument& doc ) const;
+
+ /**
+ * Get the id of the relation which shall be embedded
+ *
+ * @return the id
+ */
const QgsRelation& relation() const;
/**
@@ -119,13 +254,13 @@ struct QgsVectorJoinInfo
*/
// QHash< QString, QgsAttributeMap> cachedAttributes;
- bool operator==( const QgsVectorJoinInfo& other ) const;
-
/** An optional prefix. If it is a Null string "{layername}_" will be used
* @note Added in 2.8
*/
QString prefix;
+ bool operator==( const QgsVectorJoinInfo& other ) const;
+
/** Set subset of fields to be used from joined layer. Takes ownership of the passed pointer. Null pointer tells to use all fields.
@note added in 2.6 */
void setJoinFieldNamesSubset( QStringList* fieldNamesSubset /Transfer/ );
@@ -302,7 +437,7 @@ class QgsVectorLayer : QgsMapLayer
/** Removes a vector layer join */
void removeJoin( const QString& joinLayerId );
- const QList< QgsVectorJoinInfo > vectorJoins() const;
+ const QList<QgsVectorJoinInfo> vectorJoins() const;
/**
* Add a new field which is calculated by the expression specified
@@ -428,7 +563,7 @@ class QgsVectorLayer : QgsMapLayer
/**
* Return reference to identifiers of selected features
*
- * @return A list of { @link QgsFeatureId } 's
+ * @return A list of { @link QgsFeatureId }s
* @see selectedFeatures()
*/
const QgsFeatureIds &selectedFeaturesIds() const;
@@ -570,6 +705,14 @@ class QgsVectorLayer : QgsMapLayer
bool readSld( const QDomNode& node, QString& errorMessage );
/**
+ * Number of features rendered with specified symbol. Features must be first
+ * calculated by countSymbolFeatures()
+ * @param symbol the symbol
+ * @return number of features rendered by symbol or -1 if failed or counts are not available
+ */
+ long featureCount( QgsSymbolV2* symbol );
+
+ /**
* Update the data source of the layer. The layer's renderer and legend will be preserved only
* if the geometry type of the new data source matches the current geometry type of the layer.
* @param dataSource new layer data source
@@ -582,14 +725,6 @@ class QgsVectorLayer : QgsMapLayer
void setDataSource( const QString& dataSource, const QString& baseName, const QString& provider, bool loadDefaultStyleFlag = false );
/**
- * Number of features rendered with specified symbol. Features must be first
- * calculated by countSymbolFeatures()
- * @param symbol the symbol
- * @return number of features rendered by symbol or -1 if failed or counts are not available
- */
- long featureCount( QgsSymbolV2* symbol );
-
- /**
* Count features for symbols. Feature counts may be get by featureCount( QgsSymbolV2*).
* @param showProgress show progress dialog
* @return true if calculated, false if failed or was canceled by user
@@ -643,6 +778,13 @@ class QgsVectorLayer : QgsMapLayer
*/
bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
+ /** Moves the vertex at the given position number,
+ * ring and item (first number is index 0), and feature
+ * to the given coordinates
+ * @note available in python as moveVertexV2
+ */
+ bool moveVertex( const QgsPointV2& p, QgsFeatureId atFeatureId, int atVertex ) /PyName=moveVertexV2/;
+
/** Deletes a vertex from a feature
*/
bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
@@ -665,6 +807,18 @@ class QgsVectorLayer : QgsMapLayer
6 layer not editable */
int addRing( const QList<QgsPoint>& ring, QgsFeatureId* featureId = 0 );
+ /** Adds a ring to polygon/multipolygon features (takes ownership)
+ * @param ring ring to add
+ * @param featureId if specified, feature ID for feature ring was added to will be stored in this parameter
+ @return
+ 0 in case of success
+ 1 problem with feature type
+ 2 ring not closed
+ 6 layer not editable
+ @note available in python as addCurvedRing
+ */
+ int addRing( QgsCurveV2* ring /Transfer/, QgsFeatureId* featureId = 0 ) /PyName=addCurvedRing/;
+
/** Adds a new part polygon to a multipart feature
@return
0 in case of success,
@@ -674,9 +828,13 @@ class QgsVectorLayer : QgsMapLayer
4 if no feature was selected,
5 if several features are selected,
6 if selected geometry not found
- 7 layer not editable */
+ 7 layer not editable
+ */
int addPart( const QList<QgsPoint>& ring );
+ //! @note available in python as addCurvedPart
+ int addPart( QgsCurveV2* ring /Transfer/ ) /PyName=addCurvedPart/;
+
/** Translates feature by dx, dy
@param featureId id of the feature to translate
@param dx translation of x-coordinate
@@ -850,7 +1008,12 @@ class QgsVectorLayer : QgsMapLayer
*/
bool setReadOnly( bool readonly = true );
- /** Make layer editable */
+ /**
+ * Make layer editable.
+ * This starts an edit session on this layer. Changes made in this edit session will not
+ * be made persistent until {@link commitChanges()} is called and can be reverted by calling
+ * {@link rollBack()}.
+ */
bool startEditing();
/** Change feature's geometry */
@@ -921,7 +1084,7 @@ class QgsVectorLayer : QgsMapLayer
const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
/**
- * Get the configuration for the editor widget used to represent the field at the given index
+ * Get the configuration for the editor widget used to represent the field with the given name
*
* @param fieldName The name of the field
*
@@ -1342,30 +1505,63 @@ class QgsVectorLayer : QgsMapLayer
/**
* Will be emitted, when a new attribute has been added to this vector layer.
- * Applies only to types {@link QgsFields::OriginEdit} and {@link QgsFields::OriginProvider}
+ * Applies only to types {@link QgsFields::OriginEdit}, {@link QgsFields::OriginProvider} and {@link QgsFields::OriginExpression }
*
* @param idx The index of the new attribute
*
* @see updatedFields()
*/
void attributeAdded( int idx );
+
+ /**
+ * Will be emitted, when an expression field is going to be added to this vector layer.
+ * Applies only to types {@link QgsFields::OriginExpression }
+ *
+ * @param fieldName The name of the attribute to be added
+ */
+ void beforeAddingExpressionField( const QString& fieldName );
+
/**
* Will be emitted, when an attribute has been deleted from this vector layer.
- * Applies only to types {@link QgsFields::OriginEdit} and {@link QgsFields::OriginProvider}
+ * Applies only to types {@link QgsFields::OriginEdit}, {@link QgsFields::OriginProvider} and {@link QgsFields::OriginExpression }
*
* @param idx The index of the deleted attribute
*
* @see updatedFields()
*/
void attributeDeleted( int idx );
+
+ /**
+ * Will be emitted, when an expression field is going to be deleted from this vector layer.
+ * Applies only to types {@link QgsFields::OriginExpression }
+ *
+ * @param idx The index of the attribute to be deleted
+ */
+ void beforeRemovingExpressionField( int idx );
+
+ /**
+ * Emitted when a new feature has been added to the layer
+ *
+ * @param fid The id of the new feature
+ */
void featureAdded( QgsFeatureId fid );
+
+ /**
+ * Emitted when a feature has been deleted.
+ *
+ * If you do expensive operations in a slot connected to this, you should prever to use
+ * {@link featuresDeleted( const QgsFeatureIds& )}.
+ *
+ * @param fid The id of the feature which has been deleted
+ */
void featureDeleted( QgsFeatureId fid );
+
/**
* Emitted when features have been deleted.
*
* If features are deleted within an edit command, this will only be emitted once at the end
* to allow connected slots to minimize the overhead.
- * If features are delted outside of an edit command, this signal will be emitted once per feature.
+ * If features are deleted outside of an edit command, this signal will be emitted once per feature.
*
* @param fids The feature ids that have been deleted.
*/
@@ -1445,6 +1641,7 @@ class QgsVectorLayer : QgsMapLayer
private slots:
void onRelationsLoaded();
void onJoinedFieldsChanged();
+ void onFeatureDeleted( const QgsFeatureId& fid );
protected:
/** Set the extent */
diff --git a/python/core/raster/qgssinglebandpseudocolorrenderer.sip b/python/core/raster/qgssinglebandpseudocolorrenderer.sip
index de5cd63..ebf5f60 100644
--- a/python/core/raster/qgssinglebandpseudocolorrenderer.sip
+++ b/python/core/raster/qgssinglebandpseudocolorrenderer.sip
@@ -16,6 +16,7 @@ class QgsSingleBandPseudoColorRenderer: QgsRasterRenderer
/** Takes ownership of the shader*/
void setShader( QgsRasterShader* shader /Transfer/ );
QgsRasterShader* shader();
+ //! @note available in python as constShader
const QgsRasterShader* shader() const /PyName=constShader/;
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;
diff --git a/python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip b/python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip
index 036b04c..2381765 100644
--- a/python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip
+++ b/python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip
@@ -45,8 +45,10 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
virtual ~QgsCategorizedSymbolRendererV2();
+ //! @note available in python as symbolForFeature2
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
+ //! @note available in python as originalSymbolForFeature2
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
@@ -64,6 +66,7 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities();
+ //! @note available in python as symbols2
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
void updateSymbols( QgsSymbolV2 * sym );
diff --git a/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip b/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip
index c1a3664..cc94361 100644
--- a/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip
+++ b/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip
@@ -87,8 +87,9 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
virtual ~QgsGraduatedSymbolRendererV2();
+ //! @note labelForLowerUpper in python bindings
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
-
+ //! @note originalSymbolForFeature2 in python bindings
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
@@ -106,6 +107,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities();
+ //! @note symbol2 in python bindings
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
QString classAttribute() const;
diff --git a/python/core/symbology-ng/qgsheatmaprenderer.sip b/python/core/symbology-ng/qgsheatmaprenderer.sip
index b3549c1..16a01bf 100644
--- a/python/core/symbology-ng/qgsheatmaprenderer.sip
+++ b/python/core/symbology-ng/qgsheatmaprenderer.sip
@@ -13,7 +13,9 @@ class QgsHeatmapRenderer : QgsFeatureRendererV2
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );
virtual void stopRender( QgsRenderContext& context );
+ //! @note symbolForFeature2 in python bindings
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
+ //! @note symbol2 in python bindings
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QString dump() const;
virtual QList<QString> usedAttributes();
diff --git a/python/core/symbology-ng/qgsinvertedpolygonrenderer.sip b/python/core/symbology-ng/qgsinvertedpolygonrenderer.sip
index ab98cc8..da89242 100644
--- a/python/core/symbology-ng/qgsinvertedpolygonrenderer.sip
+++ b/python/core/symbology-ng/qgsinvertedpolygonrenderer.sip
@@ -40,15 +40,25 @@ class QgsInvertedPolygonRenderer : QgsFeatureRendererV2
virtual QList<QString> usedAttributes();
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities();
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as symbol2
+ */
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as symbolForFeature2
+ */
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as originalSymbolForFeature2
+ */
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as symbolsForFeature
+ */
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature/;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as originalSymbolsForFeature2
+ */
virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
/** Proxy that will call this method on the embedded renderer. */
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
@@ -56,7 +66,9 @@ class QgsInvertedPolygonRenderer : QgsFeatureRendererV2
@note not available in python bindings
*/
// virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, const QString& rule = "" );
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as willRenderFeature2
+ */
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;
/** Creates a renderer out of an XML, for loading*/
diff --git a/python/core/symbology-ng/qgspointdisplacementrenderer.sip b/python/core/symbology-ng/qgspointdisplacementrenderer.sip
index bf70fe5..8f84e5c 100644
--- a/python/core/symbology-ng/qgspointdisplacementrenderer.sip
+++ b/python/core/symbology-ng/qgspointdisplacementrenderer.sip
@@ -27,17 +27,29 @@ class QgsPointDisplacementRenderer : QgsFeatureRendererV2
virtual QList<QString> usedAttributes();
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities();
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as symbols2
+ */
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as symbolForFeature2
+ */
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as originalSymbolForFeature2
+ */
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as symbolsForFeature2
+ */
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature2/;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as originalSymbolsForFeature2
+ */
virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as willRenderFeature2
+ */
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
diff --git a/python/core/symbology-ng/qgsrendererv2.sip b/python/core/symbology-ng/qgsrendererv2.sip
index 5cf341d..68cdde5 100644
--- a/python/core/symbology-ng/qgsrendererv2.sip
+++ b/python/core/symbology-ng/qgsrendererv2.sip
@@ -74,7 +74,8 @@ class QgsFeatureRendererV2
* @note added in QGIS 2.12
* @note available in Python bindings as symbolForFeature2
*/
- //TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed
+ // TODO - QGIS 3.0 make pure virtual when above method is removed
+ // TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
/**
diff --git a/python/core/symbology-ng/qgsrulebasedrendererv2.sip b/python/core/symbology-ng/qgsrulebasedrendererv2.sip
index 6efc0ae..9623959 100644
--- a/python/core/symbology-ng/qgsrulebasedrendererv2.sip
+++ b/python/core/symbology-ng/qgsrulebasedrendererv2.sip
@@ -67,12 +67,31 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
~Rule();
QString dump( int offset = 0 ) const;
QSet<QString> usedAttributes();
+
+ //! @note available in python bindings as symbol2
QgsSymbolV2List symbols( const QgsRenderContext& context = QgsRenderContext() ) /PyName=symbols2/;
+
//! @note not available in python bindings
// QgsLegendSymbolList legendSymbolItems();
+
//! @note added in 2.6
QgsLegendSymbolListV2 legendSymbolItemsV2( int currentLevel = -1 ) const;
- bool isFilterOK( QgsFeature& f, QgsRenderContext* context = 0 ) const;
+
+ /**
+ * Check if a given feature shall be rendered by this rule
+ *
+ * @param f The feature to test
+ * @param context The context in which the rendering happens
+ * @return True if the feature shall be rendered
+ */
+ bool isFilterOK( QgsFeature& f, QgsRenderContext *context = 0 ) const;
+
+ /**
+ * Check if this rule applies for a given scale
+ * @param scale The scale to check. If set to 0, it will always return true.
+ *
+ * @return If the rule will be evaluated at this scale
+ */
bool isScaleOK( double scale ) const;
QgsSymbolV2* symbol();
@@ -80,11 +99,35 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
bool dependsOnScale() const;
int scaleMinDenom() const;
int scaleMaxDenom() const;
+
+ /**
+ * A filter that will check if this rule applies
+ * @return An expression
+ */
QgsExpression* filter() const;
+
+ /**
+ * A filter that will check if this rule applies
+ * @return An expression
+ */
QString filterExpression() const;
+
+ /**
+ * A human readable description for this rule
+ *
+ * @return Description
+ */
QString description() const;
+
//! @note added in 2.6
- bool checkState() const;
+ //! @deprecated use active instead
+ bool checkState() const /Deprecated/;
+ /**
+ * Returns if this rule is active
+ *
+ * @return True if the rule is active
+ */
+ bool active() const;
//! Unique rule identifier (for identification of rule within renderer)
//! @note added in 2.6
@@ -96,13 +139,41 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
//! set a new symbol (or NULL). Deletes old symbol.
void setSymbol( QgsSymbolV2* sym /Transfer/ );
void setLabel( const QString& label );
+
+ /**
+ * Set the minimum denominator for which this rule shall apply.
+ * E.g. 1000 if it shall be evaluated between 1:1000 and 1:100'000
+ * Set to 0 to disable the minimum check
+ * @param scaleMinDenom The minimum scale denominator for this rule
+ */
void setScaleMinDenom( int scaleMinDenom );
+
+ /**
+ * Set the maximum denominator for which this rule shall apply.
+ * E.g. 100'000 if it shall be evaluated between 1:1000 and 1:100'000
+ * Set to 0 to disable the maximum check
+ * @param scaleMaxDenom maximum scale denominator for this rule
+ */
void setScaleMaxDenom( int scaleMaxDenom );
+
+ /**
+ * Set the expression used to check if a given feature shall be rendered with this rule
+ *
+ * @param filterExp An expression
+ */
void setFilterExpression( const QString& filterExp );
+
+ /**
+ * Set a human readable description for this rule
+ *
+ * @param description Description
+ */
void setDescription( const QString& description );
+
//! @note added in 2.6
//! @deprecated use setActive instead
void setCheckState( bool state );
+
/**
* Sets if this rule is active
* @param state Determines if the rule should be activated or deactivated
@@ -119,14 +190,26 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
//! prepare the rule for rendering and its children (build active children array)
bool startRender( QgsRenderContext& context, const QgsFields& fields ) /Deprecated/;
+
//! prepare the rule for rendering and its children (build active children array)
bool startRender( QgsRenderContext& context, const QgsFields& fields, QString& filter );
+
//! get all used z-levels from this rule and children
QSet<int> collectZLevels();
+
//! assign normalized z-levels [0..N-1] for this rule's symbol for quick access during rendering
//! @note not available in python bindings
// void setNormZLevels( const QMap<int, int>& zLevelsToNormLevels );
+ /**
+ * Render a given feature, will recursively call subclasses and only render if the constraints apply.
+ *
+ * @param featToRender The feature to render
+ * @param context The rendering context
+ * @param renderQueue The rendering queue to which the feature should be added
+ * @return The result of the rendering. In explicit if the feature is added to the queue or
+ * the reason for not rendering the feature.
+ */
QgsRuleBasedRendererV2::Rule::RenderResult renderFeature( QgsRuleBasedRendererV2::FeatureToRender& featToRender, QgsRenderContext& context, QgsRuleBasedRendererV2::RenderQueue& renderQueue );
//! only tell whether a feature will be rendered without actually rendering it
@@ -138,24 +221,59 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
//! tell which rules will be used to render the feature
QList<QgsRuleBasedRendererV2::Rule*> rulesForFeature( QgsFeature& feat, QgsRenderContext* context = 0 );
+ /**
+ * Stop a rendering process. Used to clean up the internal state of this rule
+ *
+ * @param context The rendering context
+ */
void stopRender( QgsRenderContext& context );
+ /**
+ * Create a rule from an XML definition
+ *
+ * @param ruleElem The XML rule element
+ * @param symbolMap Symbol map
+ *
+ * @return A new rule
+ */
static QgsRuleBasedRendererV2::Rule* create( QDomElement& ruleElem, QgsSymbolV2Map& symbolMap ) /Factory/;
+ /**
+ * Return all children rules of this rule
+ *
+ * @return A list of rules
+ */
QList<QgsRuleBasedRendererV2::Rule*>& children();
+
+ /**
+ * Returns all children, grand-children, grand-grand-children, grand-gra... you get it
+ *
+ * @return A list of descendant rules
+ */
QList<QgsRuleBasedRendererV2::Rule*> descendants() const;
+
+ /**
+ * The parent rule
+ *
+ * @return Parent rule
+ */
QgsRuleBasedRendererV2::Rule* parent();
//! add child rule, take ownership, sets this as parent
void appendChild( QgsRuleBasedRendererV2::Rule* rule /Transfer/ );
+
//! add child rule, take ownership, sets this as parent
void insertChild( int i, QgsRuleBasedRendererV2::Rule* rule /Transfer/ );
+
//! delete child rule
void removeChild( QgsRuleBasedRendererV2::Rule* rule );
+
//! delete child rule
void removeChildAt( int i );
+
//! take child rule out, set parent as null
void takeChild( QgsRuleBasedRendererV2::Rule* rule );
+
//! take child rule out, set parent as null
QgsRuleBasedRendererV2::Rule* takeChildAt( int i ) /TransferBack/;
@@ -163,9 +281,25 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
//! @note added in 2.6
QgsRuleBasedRendererV2::Rule* findRuleByKey( const QString& key );
+ /**
+ * Check which child rules are else rules and update the internal list of else rules
+ *
+ * TODO QGIS 3: Does this need to be public?
+ */
void updateElseRules();
+ /**
+ * Sets if this rule is an ELSE rule
+ *
+ * @param iselse If true, this rule is an ELSE rule
+ */
void setIsElse( bool iselse );
+
+ /**
+ * Check if this rule is an ELSE rule
+ *
+ * @return True if this rule is an else rule
+ */
bool isElse();
protected:
diff --git a/python/core/symbology-ng/qgssinglesymbolrendererv2.sip b/python/core/symbology-ng/qgssinglesymbolrendererv2.sip
index 9cc8b06..f148ebb 100644
--- a/python/core/symbology-ng/qgssinglesymbolrendererv2.sip
+++ b/python/core/symbology-ng/qgssinglesymbolrendererv2.sip
@@ -9,8 +9,10 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2
virtual ~QgsSingleSymbolRendererV2();
+ //! @note available in python as symbolForFeature2
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
+ //! @note available in python as originalSymbolForFeature2
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
@@ -41,6 +43,7 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities();
+ //! @note available in python as symbol2
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
//! create renderer from XML element
diff --git a/python/core/symbology-ng/qgssymbollayerv2.sip b/python/core/symbology-ng/qgssymbollayerv2.sip
index f7d3768..13d2982 100644
--- a/python/core/symbology-ng/qgssymbollayerv2.sip
+++ b/python/core/symbology-ng/qgssymbollayerv2.sip
@@ -391,6 +391,7 @@ class QgsMarkerSymbolLayerV2 : QgsSymbolLayerV2
//handles marker offset and anchor point shift together
void markerOffset( QgsSymbolV2RenderContext& context, double& offsetX, double& offsetY ) const;
+ //! @note available in python as markerOffsetWithWidthAndHeight
void markerOffset( QgsSymbolV2RenderContext& context, double width, double height, double& offsetX, double& offsetY ) const /PyName=markerOffsetWithWidthAndHeight/;
//! @note available in python bindings as markerOffset2
diff --git a/python/core/symbology-ng/qgssymbollayerv2utils.sip b/python/core/symbology-ng/qgssymbollayerv2utils.sip
index db00c18..2861e4e 100644
--- a/python/core/symbology-ng/qgssymbollayerv2utils.sip
+++ b/python/core/symbology-ng/qgssymbollayerv2utils.sip
@@ -162,6 +162,8 @@ class QgsSymbolLayerV2Utils
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor,
double &borderWidth, double &size ) /Deprecated/;
+
+ //! @note available in python as wellKnownMarkerFromSld2
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle,
double &borderWidth, double &size ) /PyName=wellKnownMarkerFromSld2/;
@@ -175,7 +177,7 @@ class QgsSymbolLayerV2Utils
static void labelTextToSld( QDomDocument &doc, QDomElement &element, const QString& label,
- const QFont& font, const QColor& color = QColor(), double size = -1 );
+ const QFont &font, const 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,
diff --git a/python/gui/attributetable/qgsifeatureselectionmanager.sip b/python/gui/attributetable/qgsifeatureselectionmanager.sip
index e2442fe..adf2b1e 100644
--- a/python/gui/attributetable/qgsifeatureselectionmanager.sip
+++ b/python/gui/attributetable/qgsifeatureselectionmanager.sip
@@ -16,7 +16,7 @@
/**
* Is an interface class to abstract feature selection handling.
*
- * e.g. @link{QgsVectorLayer} implements this interface to manage its selections.
+ * e.g. { @link QgsVectorLayer } implements this interface to manage its selections.
*/
class QgsIFeatureSelectionManager : QObject
diff --git a/python/gui/qgscollapsiblegroupbox.sip b/python/gui/qgscollapsiblegroupbox.sip
index f2583f0..b402936 100644
--- a/python/gui/qgscollapsiblegroupbox.sip
+++ b/python/gui/qgscollapsiblegroupbox.sip
@@ -22,7 +22,7 @@ class QgsGroupBoxCollapseButton : QToolButton
* Holding Alt modifier key when toggling collapsed state will synchronize the toggling across other collapsible group boxes with the same syncGroup QString value
* Holding Shift modifier key when attempting to toggle collapsed state will expand current group box, then collapse any others with the same syncGroup QString value
* @note To add Collapsible properties in promoted QtDesigner widgets, you can add the following "Dynamic properties" by clicking on the green + in the propreties palette:
- * bool collapsed, QString syncGroup
+ * bool collapsed, QString syncGroup, bool scrollOnExpand
*/
class QgsCollapsibleGroupBoxBasic : QGroupBox
@@ -35,16 +35,31 @@ class QgsCollapsibleGroupBoxBasic : QGroupBox
QgsCollapsibleGroupBoxBasic( const QString &title, QWidget *parent /TransferThis/ = 0 );
~QgsCollapsibleGroupBoxBasic();
+ /**
+ * Returns the current collapsed state of this group box
+ */
bool isCollapsed() const;
+ /**
+ * Collapse or uncollapse this groupbox
+ *
+ * @param collapse Will collapse on true and uncollapse on false
+ */
void setCollapsed( bool collapse );
- /** Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key */
+ /**
+ * Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key
+ */
QString syncGroup() const;
+
+ /**
+ * Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key
+ */
void setSyncGroup( const QString& grp );
- //! set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded
+ //! Set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded
void setScrollOnExpand( bool scroll );
+ //! If this is set to false the parent QScrollArea will not be automatically scrolled to this widget's contents when expanded
bool scrollOnExpand();
signals:
diff --git a/python/plugins/db_manager/db_plugins/oracle/connector.py b/python/plugins/db_manager/db_plugins/oracle/connector.py
index 8cc4980..6425cc6 100644
--- a/python/plugins/db_manager/db_plugins/oracle/connector.py
+++ b/python/plugins/db_manager/db_plugins/oracle/connector.py
@@ -1621,10 +1621,8 @@ class OracleDBConnector(DBConnector):
CREATE INDEX {0}
ON {1}({2})
INDEXTYPE IS MDSYS.SPATIAL_INDEX
- PARAMETERS ('TABLESPACE={3} SDO_DML_BATCH_SIZE = 1')
""".format(idx_name, self.quoteId(table),
- self.quoteId(geom_column),
- u"{}_INDEX".format(schema))
+ self.quoteId(geom_column))
self._execute_and_commit(sql)
def deleteSpatialIndex(self, table, geom_column='GEOM'):
diff --git a/python/plugins/db_manager/dlg_sql_window.py b/python/plugins/db_manager/dlg_sql_window.py
index 76bbdef..b6d2842 100644
--- a/python/plugins/db_manager/dlg_sql_window.py
+++ b/python/plugins/db_manager/dlg_sql_window.py
@@ -54,7 +54,8 @@ class DlgSqlWindow(QWidget, Ui_Dialog):
QWidget.__init__(self, parent)
self.iface = iface
self.db = db
- self.allowMultiColumnPk = isinstance(db, PGDatabase) # at the moment only PostGIS allows a primary key to span multiple columns, spatialite doesn't
+ self.allowMultiColumnPk = isinstance(db, PGDatabase) # at the moment only PostgreSQL allows a primary key to span multiple columns, spatialite doesn't
+ self.aliasSubQuery = isinstance(db, PGDatabase) # only PostgreSQL requires subqueries to be aliases
self.setupUi(self)
self.setWindowTitle(
u"%s - %s [%s]" % (self.windowTitle(), db.connection().connectionName(), db.connection().typeNameString()))
@@ -270,15 +271,6 @@ class DlgSqlWindow(QWidget, Ui_Dialog):
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
- # get a new alias
- aliasIndex = 0
- while True:
- alias = "_%s__%d" % ("subQuery", aliasIndex)
- escaped = re.compile('\\b("?)' + re.escape(alias) + '\\1\\b')
- if not escaped.search(query):
- break
- aliasIndex += 1
-
# remove a trailing ';' from query if present
if query.strip().endswith(';'):
query = query.strip()[:-1]
@@ -287,7 +279,19 @@ class DlgSqlWindow(QWidget, Ui_Dialog):
cols = []
quotedCols = []
connector = self.db.connector
- sql = u"SELECT * FROM (%s\n) AS %s WHERE 0=1" % (unicode(query), connector.quoteId(alias))
+ if self.aliasSubQuery:
+ # get a new alias
+ aliasIndex = 0
+ while True:
+ alias = "_subQuery__%d" % aliasIndex
+ escaped = re.compile('\\b("?)' + re.escape(alias) + '\\1\\b')
+ if not escaped.search(query):
+ break
+ aliasIndex += 1
+
+ sql = u"SELECT * FROM (%s\n) AS %s LIMIT 0" % (unicode(query), connector.quoteId(alias))
+ else:
+ sql = u"SELECT * FROM (%s\n) WHERE 1=0" % unicode(query)
c = None
try:
diff --git a/src/app/legend/qgsapplegendinterface.cpp b/src/app/legend/qgsapplegendinterface.cpp
index 9433013..2155aed 100644
--- a/src/app/legend/qgsapplegendinterface.cpp
+++ b/src/app/legend/qgsapplegendinterface.cpp
@@ -75,8 +75,11 @@ void QgsAppLegendInterface::removeGroup( int groupIndex )
parentGroup->removeChildNode( group );
}
-void QgsAppLegendInterface::moveLayer( QgsMapLayer * ml, int groupIndex )
+void QgsAppLegendInterface::moveLayer( QgsMapLayer *ml, int groupIndex )
{
+ if ( !ml )
+ return;
+
QgsLayerTreeGroup* group = groupIndexToNode( groupIndex );
if ( !group )
return;
@@ -155,14 +158,20 @@ int QgsAppLegendInterface::groupNodeToIndex( QgsLayerTreeGroup* group )
return _groupNodeToIndex( group, mLayerTreeView->layerTreeModel()->rootGroup(), currentIndex );
}
-void QgsAppLegendInterface::setLayerVisible( QgsMapLayer * ml, bool visible )
+void QgsAppLegendInterface::setLayerVisible( QgsMapLayer *ml, bool visible )
{
+ if ( !ml )
+ return;
+
if ( QgsLayerTreeLayer* nodeLayer = mLayerTreeView->layerTreeModel()->rootGroup()->findLayer( ml->id() ) )
nodeLayer->setVisible( visible ? Qt::Checked : Qt::Unchecked );
}
void QgsAppLegendInterface::setLayerExpanded( QgsMapLayer * ml, bool expand )
{
+ if ( !ml )
+ return;
+
if ( QgsLayerTreeLayer* nodeLayer = mLayerTreeView->layerTreeModel()->rootGroup()->findLayer( ml->id() ) )
setExpanded( nodeLayer, expand );
}
@@ -247,8 +256,11 @@ bool QgsAppLegendInterface::isGroupVisible( int groupIndex )
return false;
}
-bool QgsAppLegendInterface::isLayerExpanded( QgsMapLayer * ml )
+bool QgsAppLegendInterface::isLayerExpanded( QgsMapLayer *ml )
{
+ if ( !ml )
+ return false;
+
if ( QgsLayerTreeLayer* nodeLayer = mLayerTreeView->layerTreeModel()->rootGroup()->findLayer( ml->id() ) )
return nodeLayer->isExpanded();
@@ -256,8 +268,11 @@ bool QgsAppLegendInterface::isLayerExpanded( QgsMapLayer * ml )
}
-bool QgsAppLegendInterface::isLayerVisible( QgsMapLayer * ml )
+bool QgsAppLegendInterface::isLayerVisible( QgsMapLayer *ml )
{
+ if ( !ml )
+ return false;
+
if ( QgsLayerTreeLayer* nodeLayer = mLayerTreeView->layerTreeModel()->rootGroup()->findLayer( ml->id() ) )
return nodeLayer->isVisible() == Qt::Checked;
@@ -283,6 +298,9 @@ QList< QgsMapLayer * > QgsAppLegendInterface::layers() const
void QgsAppLegendInterface::refreshLayerSymbology( QgsMapLayer *ml )
{
+ if ( !ml )
+ return;
+
mLayerTreeView->refreshLayerSymbology( ml->id() );
}
diff --git a/src/core/dxf/qgsdxfexport.cpp b/src/core/dxf/qgsdxfexport.cpp
index 4650785..602b521 100644
--- a/src/core/dxf/qgsdxfexport.cpp
+++ b/src/core/dxf/qgsdxfexport.cpp
@@ -4098,7 +4098,7 @@ QString QgsDxfExport::dxfLayerName( const QString& name )
layerName.replace( "=", "_" );
layerName.replace( "\'", "_" );
- return layerName;
+ return layerName.trimmed();
}
bool QgsDxfExport::layerIsScaleBasedVisible( const QgsMapLayer* layer ) const
diff --git a/src/core/dxf/qgsdxfexport.h b/src/core/dxf/qgsdxfexport.h
index 7b52ab9..d90c56d 100644
--- a/src/core/dxf/qgsdxfexport.h
+++ b/src/core/dxf/qgsdxfexport.h
@@ -73,6 +73,7 @@ class CORE_EXPORT QgsDxfExport
void writeInt( int i );
void writeDouble( double d );
void writeString( const QString &s );
+ //! @note available in python bindings as writeGroupPoint
void writeGroup( int code, const QgsPoint &p, double z = 0.0, bool skipz = false );
void writeGroup( const QColor& color, int exactMatch = 62, int rgbCode = 420, int transparencyCode = 440 );
diff --git a/src/core/qgsdataitem.h b/src/core/qgsdataitem.h
index d9b4207..1bbc133 100644
--- a/src/core/qgsdataitem.h
+++ b/src/core/qgsdataitem.h
@@ -493,6 +493,7 @@ class CORE_EXPORT QgsZipItem : public QgsDataCollectionItem
static QString vsiPrefix( const QString& uri ) { return qgsVsiPrefix( uri ); }
static QgsDataItem* itemFromPath( QgsDataItem* parent, QString path, QString name );
+ //! @note available in python as itemFromFilePath
static QgsDataItem* itemFromPath( QgsDataItem* parent, const QString& filePath, const QString& name, const QString& path );
static const QIcon &iconZip();
diff --git a/src/core/qgsdatasourceuri.h b/src/core/qgsdatasourceuri.h
index 379ac77..1ef0d0b 100644
--- a/src/core/qgsdatasourceuri.h
+++ b/src/core/qgsdatasourceuri.h
@@ -68,6 +68,7 @@ class CORE_EXPORT QgsDataSourceURI
//! Set generic param (generic mode)
// \note if key exists, another is inserted
void setParam( const QString &key, const QString &value );
+ //! @note available in python as setParamList
void setParam( const QString &key, const QStringList &value );
//! Remove generic param (generic mode)
diff --git a/src/core/qgsgml.h b/src/core/qgsgml.h
index ab463cb..79b6a8b 100644
--- a/src/core/qgsgml.h
+++ b/src/core/qgsgml.h
@@ -58,6 +58,7 @@ class CORE_EXPORT QgsGml : public QObject
* @param password password for authentication
* @param authcfg authentication configuration id
* @return 0 in case of success
+ * @note available in python as getFeaturesUri
*/
int getFeatures( const QString& uri,
QGis::WkbType* wkbType,
diff --git a/src/core/qgsvectorlayer.h b/src/core/qgsvectorlayer.h
index 54a5a9c..764fcdd 100644
--- a/src/core/qgsvectorlayer.h
+++ b/src/core/qgsvectorlayer.h
@@ -178,7 +178,7 @@ class CORE_EXPORT QgsAttributeEditorContainer : public QgsAttributeEditorElement
virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
/**
- * Returns if this ccontainer is going to be rendered as a group box
+ * Returns if this container is going to be rendered as a group box
*
* @return True if it will be a group box, false if it will be a tab
*/
@@ -1149,6 +1149,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
/** Moves the vertex at the given position number,
* ring and item (first number is index 0), and feature
* to the given coordinates
+ * @note available in python as moveVertexV2
*/
bool moveVertex( const QgsPointV2& p, QgsFeatureId atFeatureId, int atVertex );
@@ -1181,7 +1182,9 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
0 in case of success
1 problem with feature type
2 ring not closed
- 6 layer not editable*/
+ 6 layer not editable
+ @note available in python as addCurvedRing
+ */
int addRing( QgsCurveV2* ring, QgsFeatureId* featureId = 0 );
/** Adds a new part polygon to a multipart feature
@@ -1196,6 +1199,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
7 layer not editable */
int addPart( const QList<QgsPoint>& ring );
+ //! @note available in python as addCurvedPart
int addPart( QgsCurveV2* ring );
/** Translates feature by dx, dy
@@ -1885,6 +1889,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @see updatedFields()
*/
void attributeAdded( int idx );
+
/**
* Will be emitted, when an expression field is going to be added to this vector layer.
* Applies only to types {@link QgsFields::OriginExpression }
@@ -1901,6 +1906,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @see updatedFields()
*/
void attributeDeleted( int idx );
+
/**
* Will be emitted, when an expression field is going to be deleted from this vector layer.
* Applies only to types {@link QgsFields::OriginExpression }
@@ -1915,6 +1921,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @param fid The id of the new feature
*/
void featureAdded( QgsFeatureId fid );
+
/**
* Emitted when a feature has been deleted.
*
@@ -1924,16 +1931,18 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @param fid The id of the feature which has been deleted
*/
void featureDeleted( QgsFeatureId fid );
+
/**
* Emitted when features have been deleted.
*
* If features are deleted within an edit command, this will only be emitted once at the end
* to allow connected slots to minimize the overhead.
- * If features are delted outside of an edit command, this signal will be emitted once per feature.
+ * If features are deleted outside of an edit command, this signal will be emitted once per feature.
*
* @param fids The feature ids that have been deleted.
*/
void featuresDeleted( QgsFeatureIds fids );
+
/**
* Is emitted, whenever the fields available from this layer have been changed.
* This can be due to manually adding attributes or due to a join.
@@ -2006,7 +2015,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
*/
void writeCustomSymbology( QDomElement& element, QDomDocument& doc, QString& errorMessage ) const;
-
private slots:
void onRelationsLoaded();
void onJoinedFieldsChanged();
diff --git a/src/core/raster/qgssinglebandpseudocolorrenderer.h b/src/core/raster/qgssinglebandpseudocolorrenderer.h
index fd2900e..564a587 100644
--- a/src/core/raster/qgssinglebandpseudocolorrenderer.h
+++ b/src/core/raster/qgssinglebandpseudocolorrenderer.h
@@ -41,6 +41,7 @@ class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer
/** Takes ownership of the shader*/
void setShader( QgsRasterShader* shader );
QgsRasterShader* shader() { return mShader; }
+ //! @note available in python as constShader
const QgsRasterShader* shader() const { return mShader; }
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const override;
diff --git a/src/core/symbology-ng/qgscategorizedsymbolrendererv2.h b/src/core/symbology-ng/qgscategorizedsymbolrendererv2.h
index dc58494..8fed4de 100644
--- a/src/core/symbology-ng/qgscategorizedsymbolrendererv2.h
+++ b/src/core/symbology-ng/qgscategorizedsymbolrendererv2.h
@@ -76,8 +76,10 @@ class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendererV2
virtual ~QgsCategorizedSymbolRendererV2();
+ //! @note available in python as symbolForFeature2
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;
+ //! @note available in python as originalSymbolForFeature2
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;
virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
@@ -95,6 +97,7 @@ class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities() override { return SymbolLevels | RotationField | Filter; }
+ //! @note available in python as symbols2
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) override;
void updateSymbols( QgsSymbolV2 * sym );
diff --git a/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h b/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h
index e071781..866cb05 100644
--- a/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h
+++ b/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h
@@ -120,8 +120,9 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2
virtual ~QgsGraduatedSymbolRendererV2();
+ //! @note labelForLowerUpper in python bindings
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext &context ) override;
-
+ //! @note originalSymbolForFeature2 in python bindings
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext &context ) override;
virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
@@ -139,6 +140,7 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities() override { return SymbolLevels | RotationField | Filter; }
+ //! @note symbol2 in python bindings
virtual QgsSymbolV2List symbols( QgsRenderContext &context ) override;
QString classAttribute() const { return mAttrName; }
diff --git a/src/core/symbology-ng/qgsheatmaprenderer.h b/src/core/symbology-ng/qgsheatmaprenderer.h
index a2fab32..90ce13f 100644
--- a/src/core/symbology-ng/qgsheatmaprenderer.h
+++ b/src/core/symbology-ng/qgsheatmaprenderer.h
@@ -42,7 +42,9 @@ class CORE_EXPORT QgsHeatmapRenderer : public QgsFeatureRendererV2
virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false ) override;
virtual void stopRender( QgsRenderContext& context ) override;
+ //! @note symbolForFeature2 in python bindings
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext &context ) override;
+ //! @note symbol2 in python bindings
virtual QgsSymbolV2List symbols( QgsRenderContext &context ) override;
virtual QString dump() const override;
virtual QList<QString> usedAttributes() override;
diff --git a/src/core/symbology-ng/qgsinvertedpolygonrenderer.h b/src/core/symbology-ng/qgsinvertedpolygonrenderer.h
index 27bf6b3..c7d7add 100644
--- a/src/core/symbology-ng/qgsinvertedpolygonrenderer.h
+++ b/src/core/symbology-ng/qgsinvertedpolygonrenderer.h
@@ -76,15 +76,25 @@ class CORE_EXPORT QgsInvertedPolygonRenderer : public QgsFeatureRendererV2
virtual QList<QString> usedAttributes() override;
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities() override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as symbol2
+ */
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as symbolForFeature2
+ */
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as originalSymbolForFeature2
+ */
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as symbolsForFeature
+ */
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as originalSymbolsForFeature2
+ */
virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ) override;
@@ -92,7 +102,9 @@ class CORE_EXPORT QgsInvertedPolygonRenderer : public QgsFeatureRendererV2
@note not available in python bindings
*/
virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, const QString& rule = "" ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python bindings as willRenderFeature2
+ */
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) override;
/** Creates a renderer out of an XML, for loading*/
diff --git a/src/core/symbology-ng/qgspointdisplacementrenderer.h b/src/core/symbology-ng/qgspointdisplacementrenderer.h
index ccc7ff4..84e642f 100644
--- a/src/core/symbology-ng/qgspointdisplacementrenderer.h
+++ b/src/core/symbology-ng/qgspointdisplacementrenderer.h
@@ -54,17 +54,29 @@ class CORE_EXPORT QgsPointDisplacementRenderer: public QgsFeatureRendererV2
virtual QList<QString> usedAttributes() override;
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities() override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as symbols2
+ */
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as symbolForFeature2
+ */
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as originalSymbolForFeature2
+ */
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as symbolsForFeature2
+ */
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as originalSymbolsForFeature2
+ */
virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
- /** Proxy that will call this method on the embedded renderer. */
+ /** Proxy that will call this method on the embedded renderer.
+ @note available in python as willRenderFeature2
+ */
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) override;
virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
diff --git a/src/core/symbology-ng/qgsrendererv2.h b/src/core/symbology-ng/qgsrendererv2.h
index 6a90e3f..55dc255 100644
--- a/src/core/symbology-ng/qgsrendererv2.h
+++ b/src/core/symbology-ng/qgsrendererv2.h
@@ -94,8 +94,8 @@ class CORE_EXPORT QgsFeatureRendererV2
* @note added in QGIS 2.12
* @note available in Python bindings as symbolForFeature2
*/
- //TODO - QGIS 3.0 make pure virtual when above method is removed
- //TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed
+ // TODO - QGIS 3.0 make pure virtual when above method is removed
+ // TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
/**
diff --git a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp
index b42d7dc..ccb1013 100644
--- a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp
+++ b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp
@@ -980,7 +980,7 @@ bool QgsRuleBasedRendererV2::legendSymbolItemsCheckable() const
bool QgsRuleBasedRendererV2::legendSymbolItemChecked( const QString& key )
{
Rule* rule = mRootRule->findRuleByKey( key );
- return rule ? rule->checkState() : true;
+ return rule ? rule->active() : true;
}
void QgsRuleBasedRendererV2::checkLegendSymbolItem( const QString& key, bool state )
diff --git a/src/core/symbology-ng/qgsrulebasedrendererv2.h b/src/core/symbology-ng/qgsrulebasedrendererv2.h
index 02f17ba..6847388 100644
--- a/src/core/symbology-ng/qgsrulebasedrendererv2.h
+++ b/src/core/symbology-ng/qgsrulebasedrendererv2.h
@@ -110,6 +110,7 @@ class CORE_EXPORT QgsRuleBasedRendererV2 : public QgsFeatureRendererV2
*/
QSet<QString> usedAttributes();
+ //! @note available in python bindings as symbol2
QgsSymbolV2List symbols( const QgsRenderContext& context = QgsRenderContext() );
//! @note not available in python bindings
@@ -162,7 +163,7 @@ class CORE_EXPORT QgsRuleBasedRendererV2 : public QgsFeatureRendererV2
//! @note added in 2.6
//! @deprecated use active instead
- bool checkState() const { return mIsActive; }
+ Q_DECL_DEPRECATED bool checkState() const { return mIsActive; }
/**
* Returns if this rule is active
*
diff --git a/src/core/symbology-ng/qgssinglesymbolrendererv2.h b/src/core/symbology-ng/qgssinglesymbolrendererv2.h
index 781b359..1c89f1d 100644
--- a/src/core/symbology-ng/qgssinglesymbolrendererv2.h
+++ b/src/core/symbology-ng/qgssinglesymbolrendererv2.h
@@ -30,8 +30,10 @@ class CORE_EXPORT QgsSingleSymbolRendererV2 : public QgsFeatureRendererV2
virtual ~QgsSingleSymbolRendererV2();
+ //! @note available in python as symbolForFeature2
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;
+ //! @note available in python as originalSymbolForFeature2
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;
virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
@@ -62,6 +64,7 @@ class CORE_EXPORT QgsSingleSymbolRendererV2 : public QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities() override { return SymbolLevels | RotationField; }
+ //! @note available in python as symbol2
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) override;
//! create renderer from XML element
diff --git a/src/core/symbology-ng/qgssymbollayerv2.h b/src/core/symbology-ng/qgssymbollayerv2.h
index 6b287f1..b82ba78 100644
--- a/src/core/symbology-ng/qgssymbollayerv2.h
+++ b/src/core/symbology-ng/qgssymbollayerv2.h
@@ -448,6 +448,7 @@ class CORE_EXPORT QgsMarkerSymbolLayerV2 : public QgsSymbolLayerV2
//handles marker offset and anchor point shift together
void markerOffset( QgsSymbolV2RenderContext& context, double& offsetX, double& offsetY ) const;
+ //! @note available in python as markerOffsetWithWidthAndHeight
void markerOffset( QgsSymbolV2RenderContext& context, double width, double height, double& offsetX, double& offsetY ) const;
//! @note available in python bindings as markerOffset2
diff --git a/src/core/symbology-ng/qgssymbollayerv2utils.h b/src/core/symbology-ng/qgssymbollayerv2utils.h
index 43a0e4e..d9228db 100644
--- a/src/core/symbology-ng/qgssymbollayerv2utils.h
+++ b/src/core/symbology-ng/qgssymbollayerv2utils.h
@@ -214,6 +214,8 @@ class CORE_EXPORT QgsSymbolLayerV2Utils
Q_DECL_DEPRECATED static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor,
double &borderWidth, double &size );
+
+ //! @note available in python as wellKnownMarkerFromSld2
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle,
double &borderWidth, double &size );
diff --git a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
index e878751..f5238ff 100644
--- a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
+++ b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
@@ -861,7 +861,7 @@ QVariant QgsRuleBasedRendererV2Model::data( const QModelIndex &index, int role )
{
if ( index.column() != 0 )
return QVariant();
- return rule->checkState() ? Qt::Checked : Qt::Unchecked;
+ return rule->active() ? Qt::Checked : Qt::Unchecked;
}
else
return QVariant();
diff --git a/src/providers/oracle/ocispatial/qsql_ocispatial.cpp b/src/providers/oracle/ocispatial/qsql_ocispatial.cpp
index b25ba6b..e681079 100644
--- a/src/providers/oracle/ocispatial/qsql_ocispatial.cpp
+++ b/src/providers/oracle/ocispatial/qsql_ocispatial.cpp
@@ -347,8 +347,8 @@ struct QOCISpatialResultPrivate
OCIError *err;
OCISvcCtx *&svc;
OCIStmt *sql;
- QOCISDOGeometryObj *sdoobj;
- QOCISDOGeometryInd *sdoind;
+ QList<QOCISDOGeometryObj*> sdoobj;
+ QList<QOCISDOGeometryInd*> sdoind;
bool transaction;
int serverVersion;
int prefetchRows, prefetchMem;
@@ -1151,7 +1151,7 @@ class QOCISpatialCols
QString oraTypeName;
};
- bool convertToWkb( QVariant &v );
+ bool convertToWkb( QVariant &v, int index );
bool getValue( OCINumber *num, unsigned int &value );
bool getValue( OCINumber *num, int &value );
bool getValue( OCINumber *num, double &value );
@@ -1336,12 +1336,15 @@ QOCISpatialCols::QOCISpatialCols( int size, QOCISpatialResultPrivate* dp )
if ( r == OCI_SUCCESS )
{
+ dp->sdoobj.push_back( 0 );
+ dp->sdoind.push_back( 0 );
+
qDebug( "define object" );
r = OCIDefineObject( dfn,
d->err,
ofi.oraOCIType,
- ( void** ) & dp->sdoobj, 0,
- ( void** ) & dp->sdoind, 0 );
+ ( void** ) & dp->sdoobj.last(), 0,
+ ( void** ) & dp->sdoind.last(), 0 );
}
else
{
@@ -2315,31 +2318,37 @@ bool QOCISpatialCols::getElemInfoElem( int iElem, const QVector<int> &vElems, in
return true;
}
-bool QOCISpatialCols::convertToWkb( QVariant &v )
+bool QOCISpatialCols::convertToWkb( QVariant &v, int index )
{
ENTER
- qDebug() << "sdoobj =" << d->sdoobj;
- qDebug() << "sdoinf =" << d->sdoind;
- if ( d->sdoind )
- qDebug() << "sdoind->_atomic =" << d->sdoind->_atomic;
+ Q_ASSERT( index < d->sdoobj.size() );
+ Q_ASSERT( index < d->sdoind.size() );
+
+ QOCISDOGeometryObj *sdoobj = d->sdoobj[index];
+ QOCISDOGeometryInd *sdoind = d->sdoind[index];
+
+ qDebug() << "sdoobj =" << sdoobj;
+ qDebug() << "sdoinf =" << sdoind;
+ if ( sdoind )
+ qDebug() << "sdoind->_atomic =" << sdoind->_atomic;
v = QVariant( QVariant::ByteArray );
- if ( !d->sdoobj || !d->sdoind )
+ if ( !sdoobj || !sdoind )
{
qDebug() << "sdoobj or sdoind not set";
return false;
}
- if ( d->sdoind->_atomic == OCI_IND_NULL )
+ if ( sdoind->_atomic == OCI_IND_NULL )
{
qDebug() << "geometry is NULL";
return true;
}
unsigned int iGType;
- if ( !getValue( &d->sdoobj->gtype, iGType ) )
+ if ( !getValue( &sdoobj->gtype, iGType ) )
return false;
int nDims = SDO_GTYPE_D( iGType );
@@ -2353,9 +2362,9 @@ bool QOCISpatialCols::convertToWkb( QVariant &v )
}
int iSrid = 0;
- if ( d->sdoind->srid == OCI_IND_NOTNULL )
+ if ( sdoind->srid == OCI_IND_NOTNULL )
{
- if ( !getValue( &d->sdoobj->srid, iSrid ) )
+ if ( !getValue( &sdoobj->srid, iSrid ) )
return false;
}
@@ -2366,14 +2375,14 @@ bool QOCISpatialCols::convertToWkb( QVariant &v )
union wkbPtr ptr;
int nElems;
- if ( !getArraySize( d->sdoobj->elem_info, nElems ) )
+ if ( !getArraySize( sdoobj->elem_info, nElems ) )
{
qWarning() << "could not determine element info array size";
return false;
}
int nOrds;
- if ( !getArraySize( d->sdoobj->ordinates, nOrds ) )
+ if ( !getArraySize( sdoobj->ordinates, nOrds ) )
{
qWarning() << "could not determine ordinate array size";
return false;
@@ -2392,9 +2401,9 @@ bool QOCISpatialCols::convertToWkb( QVariant &v )
{
Q_ASSERT( nOrds == 0 );
- if ( d->sdoind->_atomic != OCI_IND_NOTNULL ||
- d->sdoind->point.x != OCI_IND_NOTNULL ||
- d->sdoind->point.y != OCI_IND_NOTNULL )
+ if ( sdoind->_atomic != OCI_IND_NOTNULL ||
+ sdoind->point.x != OCI_IND_NOTNULL ||
+ sdoind->point.y != OCI_IND_NOTNULL )
{
qDebug() << "null point";
v = QVariant();
@@ -2402,13 +2411,13 @@ bool QOCISpatialCols::convertToWkb( QVariant &v )
}
double x, y, z = 0.0;
- if ( !getValue( &d->sdoobj->point.x, x ) )
+ if ( !getValue( &sdoobj->point.x, x ) )
{
qWarning() << "could not convert x ordinate to real";
return false;
}
- if ( !getValue( &d->sdoobj->point.y, y ) )
+ if ( !getValue( &sdoobj->point.y, y ) )
{
qWarning() << "could not convert y ordinate to real";
return false;
@@ -2416,13 +2425,13 @@ bool QOCISpatialCols::convertToWkb( QVariant &v )
if ( nDims > 2 )
{
- if ( d->sdoind->point.z != OCI_IND_NOTNULL )
+ if ( sdoind->point.z != OCI_IND_NOTNULL )
{
qWarning() << "null value in z ordinate";
return false;
}
- if ( !getValue( &d->sdoobj->point.z, z ) )
+ if ( !getValue( &sdoobj->point.z, z ) )
{
qDebug() << "could not convert z ordinate to real";
return false;
@@ -2442,7 +2451,7 @@ bool QOCISpatialCols::convertToWkb( QVariant &v )
return true;
}
- if ( d->sdoind->_atomic != OCI_IND_NOTNULL )
+ if ( sdoind->_atomic != OCI_IND_NOTNULL )
{
qWarning() << "geometry with sdo_elem_info and non-null sdo_point found.";
return false;
@@ -2455,7 +2464,7 @@ bool QOCISpatialCols::convertToWkb( QVariant &v )
QVector<boolean> exists( nElems );
QVector<OCINumber*> numbers( nElems );
uword nelems = nElems;
- OCI_VERIFY_E( d->err, OCICollGetElemArray( d->env, d->err, d->sdoobj->elem_info, 0, exists.data(), ( void** ) numbers.data(), 0, &nelems ) );
+ OCI_VERIFY_E( d->err, OCICollGetElemArray( d->env, d->err, sdoobj->elem_info, 0, exists.data(), ( void** ) numbers.data(), 0, &nelems ) );
if ( !exists[0] )
{
qWarning() << "element info array does not exists";
@@ -2484,7 +2493,7 @@ bool QOCISpatialCols::convertToWkb( QVariant &v )
QVector<boolean> exists( nOrds );
QVector<OCINumber*> numbers( nOrds );
uword nords = nOrds;
- OCI_VERIFY_E( d->err, OCICollGetElemArray( d->env, d->err, d->sdoobj->ordinates, 0, exists.data(), ( void** ) numbers.data(), 0, &nords ) );
+ OCI_VERIFY_E( d->err, OCICollGetElemArray( d->env, d->err, sdoobj->ordinates, 0, exists.data(), ( void** ) numbers.data(), 0, &nords ) );
if ( !exists[0] )
{
qWarning() << "ordinate array does not exists";
@@ -2797,7 +2806,7 @@ bool QOCISpatialCols::convertToWkb( QVariant &v )
void QOCISpatialCols::getValues( QVector<QVariant> &v, int index )
{
ENTER
- for ( int i = 0; i < fieldInf.size(); ++i )
+ for ( int i = 0, gcindex = 0; i < fieldInf.size(); ++i )
{
qDebug() << "getValues( index =" << index << "i =" << i << " )";
const OraFieldInf &fld = fieldInf.at( i );
@@ -2871,7 +2880,7 @@ void QOCISpatialCols::getValues( QVector<QVariant> &v, int index )
if ( fld.oraType == SQLT_NTY && fld.oraTypeName == "SDO_GEOMETRY" )
{
qDebug() << "SQLT_NTY SDO_GEOMETRY";
- convertToWkb( v[ index+i ] );
+ convertToWkb( v[ index+i ], gcindex++ );
}
else
{
@@ -2896,8 +2905,8 @@ QOCISpatialResultPrivate::QOCISpatialResultPrivate( QOCISpatialResult *result, c
, err( 0 )
, svc( const_cast<OCISvcCtx*&>( driver->svc ) )
, sql( 0 )
- , sdoobj( 0 )
- , sdoind( 0 )
+ , sdoobj()
+ , sdoind()
, transaction( driver->transaction )
, serverVersion( driver->serverVersion )
, prefetchRows( driver->prefetchRows )
@@ -3066,7 +3075,18 @@ int QOCISpatialResult::numRowsAffected()
bool QOCISpatialResult::prepare( const QString& query )
{
ENTER
- qDebug() << "prepare(" << query << ")";
+
+ static int sDebugLevel = -1;
+ if ( sDebugLevel < 0 )
+ {
+ if ( getenv( "QGIS_DEBUG" ) )
+ sDebugLevel = atoi( getenv( "QGIS_DEBUG" ) );
+ else
+ sDebugLevel = 0;
+ }
+
+ if ( sDebugLevel >= 4 )
+ qDebug() << "prepare(" << query << ")";
int r = 0;
QSqlResult::prepare( query );
@@ -3190,8 +3210,8 @@ bool QOCISpatialResult::exec()
0, OCI_ATTR_PARAM_COUNT, d->err );
if ( r == OCI_SUCCESS && !d->cols )
{
- d->sdoobj = 0;
- d->sdoind = 0;
+ d->sdoobj.clear();
+ d->sdoind.clear();
d->cols = new QOCISpatialCols( parmCount, d );
}
else
diff --git a/src/providers/oracle/qgsoracleconn.h b/src/providers/oracle/qgsoracleconn.h
index e722bb1..45d3a9a 100644
--- a/src/providers/oracle/qgsoracleconn.h
+++ b/src/providers/oracle/qgsoracleconn.h
@@ -76,14 +76,14 @@ struct QgsOracleLayerProperty
QString toString() const
{
QString typeString;
- foreach ( QGis::WkbType type, types )
+ Q_FOREACH ( QGis::WkbType type, types )
{
if ( !typeString.isEmpty() )
typeString += "|";
typeString += QString::number( type );
}
QString sridString;
- foreach ( int srid, srids )
+ Q_FOREACH ( int srid, srids )
{
if ( !sridString.isEmpty() )
sridString += "|";
diff --git a/src/providers/oracle/qgsoracledataitems.cpp b/src/providers/oracle/qgsoracledataitems.cpp
index 8ce1307..8bfe203 100644
--- a/src/providers/oracle/qgsoracledataitems.cpp
+++ b/src/providers/oracle/qgsoracledataitems.cpp
@@ -57,12 +57,12 @@ void QgsOracleConnectionItem::refresh()
stop();
- foreach ( QgsDataItem *child, mChildren )
+ Q_FOREACH ( QgsDataItem *child, mChildren )
{
deleteChildItem( child );
}
- foreach ( QgsDataItem *item, createChildren() )
+ Q_FOREACH ( QgsDataItem *item, createChildren() )
{
addChildItem( item, true );
}
@@ -215,7 +215,7 @@ bool QgsOracleConnectionItem::handleDrop( const QMimeData * data, Qt::DropAction
QStringList importResults;
bool hasError = false;
QgsMimeDataUtils::UriList lst = QgsMimeDataUtils::decodeUriList( data );
- foreach ( const QgsMimeDataUtils::Uri& u, lst )
+ Q_FOREACH ( const QgsMimeDataUtils::Uri& u, lst )
{
if ( u.layerType != "vector" )
{
@@ -415,7 +415,7 @@ QgsOracleRootItem::~QgsOracleRootItem()
QVector<QgsDataItem*> QgsOracleRootItem::createChildren()
{
QVector<QgsDataItem*> connections;
- foreach ( QString connName, QgsOracleConn::connectionList() )
+ Q_FOREACH ( QString connName, QgsOracleConn::connectionList() )
{
connections << new QgsOracleConnectionItem( this, connName, mPath + "/" + connName );
}
diff --git a/src/providers/oracle/qgsoraclefeatureiterator.cpp b/src/providers/oracle/qgsoraclefeatureiterator.cpp
index 8e2a07e..518a80d 100644
--- a/src/providers/oracle/qgsoraclefeatureiterator.cpp
+++ b/src/providers/oracle/qgsoraclefeatureiterator.cpp
@@ -187,7 +187,7 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
if ( mSource->mPrimaryKeyType == pktFidMap )
{
- foreach ( int idx, mSource->mPrimaryKeyAttrs )
+ Q_FOREACH ( int idx, mSource->mPrimaryKeyAttrs )
{
const QgsField &fld = mSource->mFields[idx];
@@ -220,7 +220,7 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
QgsDebugMsgLevel( QString( "fid=%1" ).arg( fid ), 5 );
// iterate attributes
- foreach ( int idx, mAttributeList )
+ Q_FOREACH ( int idx, mAttributeList )
{
if ( mSource->mPrimaryKeyAttrs.contains( idx ) )
continue;
@@ -228,7 +228,18 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
const QgsField &fld = mSource->mFields[idx];
QVariant v = mQry.value( col );
- if ( v.type() != fld.type() )
+ if ( fld.type() == QVariant::ByteArray && fld.typeName().endsWith( ".SDO_GEOMETRY" ) )
+ {
+ QByteArray *ba = static_cast<QByteArray*>( v.data() );
+ unsigned char *copy = new unsigned char[ba->size()];
+ memcpy( copy, ba->constData(), ba->size() );
+
+ QgsGeometry *g = new QgsGeometry();
+ g->fromWkb( copy, ba->size() );
+ v = g->exportToWkt();
+ delete g;
+ }
+ else if ( v.type() != fld.type() )
v = QgsVectorDataProvider::convertValue( fld.type(), v.toString() );
feature.setAttribute( idx, v );
@@ -291,7 +302,7 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause )
break;
case pktFidMap:
- foreach ( int idx, mSource->mPrimaryKeyAttrs )
+ Q_FOREACH ( int idx, mSource->mPrimaryKeyAttrs )
{
query += delim + mConnection->fieldExpression( mSource->mFields[idx] );
delim = ",";
@@ -304,7 +315,7 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause )
break;
}
- foreach ( int idx, mAttributeList )
+ Q_FOREACH ( int idx, mAttributeList )
{
if ( mSource->mPrimaryKeyAttrs.contains( idx ) )
continue;
diff --git a/src/providers/oracle/qgsoracleprovider.cpp b/src/providers/oracle/qgsoracleprovider.cpp
index 2c46085..2d85e1a 100644
--- a/src/providers/oracle/qgsoracleprovider.cpp
+++ b/src/providers/oracle/qgsoracleprovider.cpp
@@ -171,7 +171,7 @@ QgsOracleProvider::QgsOracleProvider( QString const & uri )
Q_ASSERT( mPrimaryKeyType != pktInt || mPrimaryKeyAttrs.size() == 1 );
QString delim;
- foreach ( int idx, mPrimaryKeyAttrs )
+ Q_FOREACH ( int idx, mPrimaryKeyAttrs )
{
Q_ASSERT( idx >= 0 && idx < mAttributeFields.size() );
key += delim + mAttributeFields[ idx ].name();
@@ -373,7 +373,7 @@ void QgsOracleProvider::appendPkParams( QgsFeatureId fid, QSqlQuery &qry ) const
QVariant pkValsVariant = mShared->lookupKey( fid );
if ( !pkValsVariant.isNull() )
{
- foreach ( const QVariant &v, pkValsVariant.toList() )
+ Q_FOREACH ( const QVariant &v, pkValsVariant.toList() )
{
QgsDebugMsgLevel( QString( "addBindValue pk %1" ).arg( FID_TO_STRING( fid ) ), 4 );
qry.addBindValue( v );
@@ -457,7 +457,7 @@ QString QgsOracleUtils::whereClause( QgsFeatureId featureId, const QgsFields& fi
QString QgsOracleUtils::whereClause( QgsFeatureIds featureIds, const QgsFields &fields, QgsOraclePrimaryKeyType primaryKeyType, const QList<int> &primaryKeyAttrs, QSharedPointer<QgsOracleSharedData> sharedData )
{
QStringList whereClauses;
- foreach ( const QgsFeatureId featureId, featureIds )
+ Q_FOREACH ( const QgsFeatureId featureId, featureIds )
{
whereClauses << whereClause( featureId, fields, primaryKeyType, primaryKeyAttrs, sharedData );
}
@@ -637,14 +637,6 @@ bool QgsOracleProvider::loadFields()
types.insert( name, QString( "%1(%2,%3)" ).arg( type ).arg( prec ).arg( scale ) );
}
}
- else if ( type == "MDSYS.SDO_GEOMETRY" )
- {
- if ( !mConnection->hasSpatial() )
- {
- QgsMessageLog::logMessage( tr( "Other spatial field %1.%2.%3 ignored" ).arg( mOwnerName ).arg( mTableName ).arg( name ), tr( "Oracle" ) );
- continue;
- }
- }
else
{
types.insert( name, type );
@@ -1204,7 +1196,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist )
{
QString keys, kdelim = "";
- foreach ( int idx, mPrimaryKeyAttrs )
+ Q_FOREACH ( int idx, mPrimaryKeyAttrs )
{
const QgsField &fld = field( idx );
insert += delim + quotedIdentifier( fld.name() );
@@ -1272,7 +1264,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist )
values += delim + defVal;
}
}
- else if ( fld.typeName() == "MDSYS.SDO_GEOMETRY" )
+ else if ( fld.typeName().endsWith( ".SDO_GEOMETRY" ) )
{
values += delim + "?";
}
@@ -1352,7 +1344,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist )
throw OracleException( tr( "Could not retrieve feature id %1" ).arg( features->id() ), getfid );
int col = 0;
- foreach ( int idx, mPrimaryKeyAttrs )
+ Q_FOREACH ( int idx, mPrimaryKeyAttrs )
{
const QgsField &fld = field( idx );
@@ -1386,7 +1378,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist )
{
QList<QVariant> primaryKeyVals;
- foreach ( int idx, mPrimaryKeyAttrs )
+ Q_FOREACH ( int idx, mPrimaryKeyAttrs )
{
primaryKeyVals << attributevec[ idx ];
}
@@ -1567,7 +1559,7 @@ bool QgsOracleProvider::deleteAttributes( const QgsAttributeIds& ids )
QList<int> idsList = ids.values();
qSort( idsList.begin(), idsList.end(), qGreater<int>() );
- foreach ( int id, idsList )
+ Q_FOREACH ( int id, idsList )
{
const QgsField &fld = mAttributeFields.at( id );
@@ -1644,6 +1636,7 @@ bool QgsOracleProvider::changeAttributeValues( const QgsChangedAttributesMap &at
QString sql = QString( "UPDATE %1 SET " ).arg( mQuery );
bool pkChanged = false;
+ QList<int> geometryParams;
// cycle through the changed attributes of the feature
QString delim;
@@ -1658,9 +1651,15 @@ bool QgsOracleProvider::changeAttributeValues( const QgsChangedAttributesMap &at
sql += delim + QString( "%1=" ).arg( quotedIdentifier( fld.name() ) );
delim = ",";
- if ( fld.typeName() == "MDSYS.SDO_GEOMETRY" )
+ if ( fld.typeName().endsWith( ".SDO_GEOMETRY" ) )
{
- sql += QString( "SDO_UTIL.FROM_WKTGEOMETRY(%1)" ).arg( quotedValue( siter->toString() ) );
+ if ( mConnection->hasSpatial() )
+ sql += QString( "SDO_UTIL.FROM_WKTGEOMETRY(%1)" ).arg( quotedValue( siter->toString() ) );
+ else
+ {
+ geometryParams << siter.key();
+ sql += "?";
+ }
}
else
{
@@ -1675,11 +1674,33 @@ bool QgsOracleProvider::changeAttributeValues( const QgsChangedAttributesMap &at
sql += QString( " WHERE %1" ).arg( whereClause( fid ) );
- if ( !exec( qry, sql ) )
+ if ( !qry.prepare( sql ) )
+ {
+ throw OracleException( tr( "Could not prepare update statement." ), qry );
+ }
+
+ Q_FOREACH ( int idx, geometryParams )
{
- throw OracleException( tr( "Update of feature %1 failed" ).arg( fid ), qry );
+ QgsGeometry *g;
+ if ( !attrs[idx].isNull() )
+ {
+ g = QgsGeometry::fromWkt( attrs[ idx ].toString() );
+ }
+ else
+ {
+ g = new QgsGeometry();
+ }
+
+ appendGeomParam( g, qry );
+
+ delete g;
}
+ if ( !qry.exec() )
+ throw OracleException( tr( "Update of feature %1 failed" ).arg( iter.key() ), qry );
+
+ qry.finish();
+
// update feature id map if key was changed
if ( pkChanged && mPrimaryKeyType == pktFidMap )
{
@@ -2198,23 +2219,27 @@ bool QgsOracleProvider::getGeometryDetails()
if ( detectedType == QGis::WKBUnknown || detectedSrid <= 0 )
{
QgsOracleLayerProperty layerProperty;
- layerProperty.ownerName = ownerName;
- layerProperty.tableName = tableName;
- layerProperty.geometryColName = mGeometryColumn;
- layerProperty.types << detectedType;
- layerProperty.srids << detectedSrid;
- QString delim = "";
-
- if ( !mSqlWhereClause.isEmpty() )
+ if ( !mIsQuery )
{
- layerProperty.sql += delim + "(" + mSqlWhereClause + ")";
- delim = " AND ";
- }
+ layerProperty.ownerName = ownerName;
+ layerProperty.tableName = tableName;
+ layerProperty.geometryColName = mGeometryColumn;
+ layerProperty.types << detectedType;
+ layerProperty.srids << detectedSrid;
- mConnection->retrieveLayerTypes( layerProperty, mUseEstimatedMetadata, false );
+ QString delim = "";
+
+ if ( !mSqlWhereClause.isEmpty() )
+ {
+ layerProperty.sql += delim + "(" + mSqlWhereClause + ")";
+ delim = " AND ";
+ }
- Q_ASSERT( layerProperty.types.size() == layerProperty.srids.size() );
+ mConnection->retrieveLayerTypes( layerProperty, mUseEstimatedMetadata, false );
+
+ Q_ASSERT( layerProperty.types.size() == layerProperty.srids.size() );
+ }
if ( layerProperty.types.isEmpty() )
{
diff --git a/src/providers/oracle/qgsoraclesourceselect.cpp b/src/providers/oracle/qgsoraclesourceselect.cpp
index 464638d..fc81ebb 100644
--- a/src/providers/oracle/qgsoraclesourceselect.cpp
+++ b/src/providers/oracle/qgsoraclesourceselect.cpp
@@ -55,15 +55,15 @@ QWidget *QgsOracleSourceSelectDelegate::createEditor( QWidget *parent, const QSt
if ( index.column() == QgsOracleTableModel::dbtmType && index.data( Qt::UserRole + 1 ).toBool() )
{
QComboBox *cb = new QComboBox( parent );
- foreach ( QGis::WkbType type,
- QList<QGis::WkbType>()
- << QGis::WKBPoint
- << QGis::WKBLineString
- << QGis::WKBPolygon
- << QGis::WKBMultiPoint
- << QGis::WKBMultiLineString
- << QGis::WKBMultiPolygon
- << QGis::WKBNoGeometry )
+ Q_FOREACH ( QGis::WkbType type,
+ QList<QGis::WkbType>()
+ << QGis::WKBPoint
+ << QGis::WKBLineString
+ << QGis::WKBPolygon
+ << QGis::WKBMultiPoint
+ << QGis::WKBMultiLineString
+ << QGis::WKBMultiPolygon
+ << QGis::WKBNoGeometry )
{
cb->addItem( QgsOracleTableModel::iconForWkbType( type ), QgsOracleConn::displayStringForWkbType( type ), type );
}
@@ -475,7 +475,7 @@ void QgsOracleSourceSelect::addTables()
{
mSelectedTables.clear();
- foreach ( QModelIndex idx, mTablesTreeView->selectionModel()->selection().indexes() )
+ Q_FOREACH ( QModelIndex idx, mTablesTreeView->selectionModel()->selection().indexes() )
{
if ( idx.column() != QgsOracleTableModel::dbtmTable )
continue;
@@ -668,7 +668,7 @@ void QgsOracleSourceSelect::loadTableFromCache()
if ( !QgsOracleTableCache::loadFromCache( connName, _currentFlags( connName, uri.useEstimatedMetadata(), cbxAllowGeometrylessTables->isChecked() ), layers ) )
return;
- foreach ( const QgsOracleLayerProperty& layerProperty, layers )
+ Q_FOREACH ( const QgsOracleLayerProperty& layerProperty, layers )
mTableModel.addTableEntry( layerProperty );
QApplication::setOverrideCursor( Qt::BusyCursor );
diff --git a/src/providers/oracle/qgsoracletablecache.cpp b/src/providers/oracle/qgsoracletablecache.cpp
index 4a611f2..dc38370 100644
--- a/src/providers/oracle/qgsoracletablecache.cpp
+++ b/src/providers/oracle/qgsoracletablecache.cpp
@@ -156,7 +156,7 @@ bool QgsOracleTableCache::saveToCache( const QString& connName, CacheFlags flags
}
bool insertOk = true;
- foreach ( const QgsOracleLayerProperty& item, layers )
+ Q_FOREACH ( const QgsOracleLayerProperty& item, layers )
{
sqlite3_bind_text( stmtInsert, 1, item.ownerName.toUtf8().data(), -1, SQLITE_TRANSIENT );
sqlite3_bind_text( stmtInsert, 2, item.tableName.toUtf8().data(), -1, SQLITE_TRANSIENT );
@@ -167,12 +167,12 @@ bool QgsOracleTableCache::saveToCache( const QString& connName, CacheFlags flags
sqlite3_bind_text( stmtInsert, 6, item.pkCols.join( "," ).toUtf8().data(), -1, SQLITE_TRANSIENT );
QStringList geomTypes;
- foreach ( QGis::WkbType geomType, item.types )
+ Q_FOREACH ( QGis::WkbType geomType, item.types )
geomTypes.append( QString::number( static_cast<ulong>( geomType ) ) );
sqlite3_bind_text( stmtInsert, 7, geomTypes.join( "," ).toUtf8().data(), -1, SQLITE_TRANSIENT );
QStringList geomSrids;
- foreach ( int geomSrid, item.srids )
+ Q_FOREACH ( int geomSrid, item.srids )
geomSrids.append( QString::number( geomSrid ) );
sqlite3_bind_text( stmtInsert, 8, geomSrids.join( "," ).toUtf8().data(), -1, SQLITE_TRANSIENT );
@@ -221,11 +221,11 @@ bool QgsOracleTableCache::loadFromCache( const QString& connName, CacheFlags fla
layer.pkCols = pkCols.split( ",", QString::SkipEmptyParts );
QString geomTypes = QString::fromUtf8(( const char* ) sqlite3_column_text( stmt, 6 ) );
- foreach ( QString geomType, geomTypes.split( ",", QString::SkipEmptyParts ) )
+ Q_FOREACH ( QString geomType, geomTypes.split( ",", QString::SkipEmptyParts ) )
layer.types.append( static_cast<QGis::WkbType>( geomType.toInt() ) );
QString geomSrids = QString::fromUtf8(( const char* ) sqlite3_column_text( stmt, 7 ) );
- foreach ( QString geomSrid, geomSrids.split( ",", QString::SkipEmptyParts ) )
+ Q_FOREACH ( QString geomSrid, geomSrids.split( ",", QString::SkipEmptyParts ) )
layer.srids.append( geomSrid.toInt() );
layers.append( layer );
@@ -303,10 +303,10 @@ void _testTableCache()
// compare
- foreach ( const QgsOracleLayerProperty& item, layers )
+ Q_FOREACH ( const QgsOracleLayerProperty& item, layers )
qDebug( "== %s %s", item.tableName.toAscii().data(), item.geometryColName.toAscii().data() );
- foreach ( const QgsOracleLayerProperty& item, layersLoaded )
+ Q_FOREACH ( const QgsOracleLayerProperty& item, layersLoaded )
qDebug( "++ %s %s", item.tableName.toAscii().data(), item.geometryColName.toAscii().data() );
Q_ASSERT( layers == layersLoaded );
diff --git a/src/providers/oracle/qgsoracletablemodel.cpp b/src/providers/oracle/qgsoracletablemodel.cpp
index 0894d73..446b55c 100644
--- a/src/providers/oracle/qgsoracletablemodel.cpp
+++ b/src/providers/oracle/qgsoracletablemodel.cpp
@@ -119,7 +119,7 @@ void QgsOracleTableModel::addTableEntry( const QgsOracleLayerProperty &layerProp
childItemList << selItem;
childItemList << sqlItem;
- foreach ( QStandardItem *item, childItemList )
+ Q_FOREACH ( QStandardItem *item, childItemList )
{
if ( tip.isEmpty() )
{
diff --git a/src/server/qgshttprequesthandler.cpp b/src/server/qgshttprequesthandler.cpp
index e10058d..7a8d985 100644
--- a/src/server/qgshttprequesthandler.cpp
+++ b/src/server/qgshttprequesthandler.cpp
@@ -505,6 +505,7 @@ bool QgsHttpRequestHandler::startGetFeatureResponse( QByteArray* ba, const QStri
format = "text/xml";
setInfoFormat( format );
+ sendHeaders();
appendBody( *ba );
// Streaming
sendResponse();
diff --git a/src/server/qgsserverprojectparser.cpp b/src/server/qgsserverprojectparser.cpp
index efc9788..97d80a7 100644
--- a/src/server/qgsserverprojectparser.cpp
+++ b/src/server/qgsserverprojectparser.cpp
@@ -420,22 +420,40 @@ void QgsServerProjectParser::serviceCapabilities( QDomElement& parentElement, QD
QDomElement keywordListElem = propertiesElement.firstChildElement( "WMSKeywordList" );
if ( !keywordListElem.isNull() && !keywordListElem.text().isEmpty() )
{
- QDomElement wmsKeywordElem = doc.createElement( "KeywordList" );
- QDomNodeList keywordList = keywordListElem.elementsByTagName( "value" );
- for ( int i = 0; i < keywordList.size(); ++i )
+ if ( service.compare( "WMS", Qt::CaseInsensitive ) == 0 )
{
- QDomElement keywordElem = doc.createElement( "Keyword" );
- QDomText keywordText = doc.createTextNode( keywordList.at( i ).toElement().text() );
- keywordElem.appendChild( keywordText );
- if ( sia2045 )
+ QDomElement wmsKeywordElem = doc.createElement( "KeywordList" );
+ QDomNodeList keywordList = keywordListElem.elementsByTagName( "value" );
+ for ( int i = 0; i < keywordList.size(); ++i )
{
- keywordElem.setAttribute( "vocabulary", "SIA_Geo405" );
+ QDomElement keywordElem = doc.createElement( "Keyword" );
+ QDomText keywordText = doc.createTextNode( keywordList.at( i ).toElement().text() );
+ keywordElem.appendChild( keywordText );
+ if ( sia2045 )
+ {
+ keywordElem.setAttribute( "vocabulary", "SIA_Geo405" );
+ }
+ wmsKeywordElem.appendChild( keywordElem );
}
- wmsKeywordElem.appendChild( keywordElem );
- }
- if ( keywordList.size() > 0 )
+ if ( keywordList.size() > 0 )
+ {
+ serviceElem.appendChild( wmsKeywordElem );
+ }
+ }
+ else
{
+ QDomNodeList keywordNodeList = keywordListElem.elementsByTagName( "value" );
+ QStringList keywordList;
+ for ( int i = 0; i < keywordNodeList.size(); ++i )
+ {
+ keywordList.push_back( keywordNodeList.at( i ).toElement().text() );
+ }
+ QDomElement wmsKeywordElem = doc.createElement( "Keywords" );
+ if ( service.compare( "WCS", Qt::CaseInsensitive ) == 0 )
+ wmsKeywordElem = doc.createElement( "keywords" );
+ QDomText keywordText = doc.createTextNode( keywordList.join( ", " ) );
+ wmsKeywordElem.appendChild( keywordText );
serviceElem.appendChild( wmsKeywordElem );
}
}
diff --git a/src/server/qgswmsconfigparser.cpp b/src/server/qgswmsconfigparser.cpp
index 3a214c4..6460618 100644
--- a/src/server/qgswmsconfigparser.cpp
+++ b/src/server/qgswmsconfigparser.cpp
@@ -157,7 +157,7 @@ QgsComposition* QgsWMSConfigParser::createPrintComposition( const QString& compo
QList<QgsMapLayer*> layerList = mapLayerFromStyle( wmsLayer, styleName, allowCaching );
int listIndex;
- for ( listIndex = layerList.size() - 1; listIndex >= 0; listIndex-- )
+ for ( listIndex = 0; listIndex < layerList.size(); listIndex++ )
{
QgsMapLayer* layer = layerList.at( listIndex );
if ( layer )
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/qgis.git
More information about the Pkg-grass-devel
mailing list