3666 Commits

Author SHA1 Message Date
Blottiere Paul
c6f97e53de Add unit tests 2017-05-18 11:09:23 +02:00
Martin Dobias
e001d5c70a Add QgsGeometry::isSimple() - useful for self-intersection checks 2017-05-18 09:02:41 +08:00
Nyall Dawson
09975cec07 Fix transform shear value not saved (fix #16567) 2017-05-18 08:56:53 +10:00
Nyall Dawson
6e98b9fe54 Add failing test for #16567 2017-05-18 08:56:53 +10:00
Nyall Dawson
936125555f Forward port test for #16517 2017-05-18 07:29:05 +10:00
Nyall Dawson
b4de0acef5 Merge pull request #4512 from nyalldawson/locator
[FEATURE] Implement a QtCreator style locator bar in the QGIS status bar
2017-05-18 07:06:53 +10:00
Denis Rouzaud
8231d7528b sipify QgsExpressionContext, QgsFeatureRequest, QgsOptionalExpression 2017-05-17 15:20:31 +02:00
Nyall Dawson
a7d590e041 Add a context variable for locator searches
This allows encapsulation of properties relating to the context
of a search, such as a target map extent. Locator filters could
use this to prioritise results close to the current canvas extent.
2017-05-17 21:33:47 +10:00
Nyall Dawson
71f7872251 [FEATURE] Implement a QtCreator style locator bar in the QGIS status bar
This adds a new "locator" bar to the QGIS status bar. If you're not
familiar with QtCreator's locator, it's a quick search bar
(activated by Ctrl+K) which displays matching search results
from any number of registered search filters.

Search filters are subclassed from QgsLocatorFilter, and
added to the app's locator via iface.registerLocatorFilter(...)

Searching is handled using threads, so that results always
become available as quickly as possible, regardless of whether
any slow search filters may be installed. They also appear
as soon as each result is encountered by each filter, which means
that e.g. a file search filter will show results one by one
as the file tree is scanned. This ensures that the UI is always
responsive even if a very slow search filter is present (e.g.
one which uses an online service).

This framework is designed to be extended by plugins, such as
OSM nominatim searches, direct database searching (i.e. Discovery
plugin), layer catalog searches, etc...
2017-05-17 21:33:47 +10:00
Nyall Dawson
afc9788881 Better method to ensure memory layers always have unique sources 2017-05-17 21:31:37 +10:00
Sandro Santilli
0bac937173 Fix indentation as requested by Travis
NOTE: I do have the prepare-commit.sh hook in place, but it did
      not handle this
2017-05-16 19:22:58 +02:00
Sandro Santilli
4ed096b94d Add test for unprojectible polygon labeling
See #15507
2017-05-16 18:16:54 +02:00
Martin Dobias
f153e19168 Fix saving of "obstacle only" state + misc fixes to unit tests 2017-05-16 14:25:32 +08:00
Martin Dobias
bfdc84fc69 Fixes to unit tests 2017-05-16 14:25:32 +08:00
Martin Dobias
828bd384c5 Convert remaining bits where labeling was configured using setCustomProperty() 2017-05-16 14:25:32 +08:00
Martin Dobias
21f03bc11c Clean up reading/writing of labeling configuration in vector layers
Historically the configuration used to be stored in layer's custom properties, but that does not scale
beyond simple rendering and so rule-based labeling introduced storage of configuration natively in XML elements.
That left us with two different ways of reading/writing labeling configurations. This work makes all configuration
to use native XML elements.

To keep compatibility of 2.x projects, reading of configuration from custom properties is preserved.

This commit also adds Python APIs for direct manipulation of labeling configuration through vector layer's
setLabeling() and labeling() calls.
2017-05-16 14:25:32 +08:00
Nyall Dawson
a517c683cd Ensure created memory layers have unique source
Sometimes the layer source is used for "looser" comparison then
layer ID
2017-05-16 11:29:49 +10:00
Nyall Dawson
87052a7712 Merge pull request #4558 from nyalldawson/native-lib-mac
Add OS native interface lib, with objective-c++ interface to Mac Cocoa libraries, v3
2017-05-15 18:24:26 +10:00
Nyall Dawson
ae97c333d6 Revert "Port algorithm countVisibleParameters to c++"
This reverts commit c3c694f8ccfbe0b64df14365f950f5895968a66a.
2017-05-15 10:24:38 +10:00
Nyall Dawson
6efe160a65 Move QgsNative instance from app->QgsGui singleton
This allows gui widgets to utilise native platform interfaces.
Additionally attaching the instance to QgsGui allows QgsNative
to become a QObject in future if required and for use
of signals/slots in the native interfaces.
2017-05-15 09:56:52 +10:00
Nyall Dawson
cbc2a3df64 Indentation 2017-05-15 09:15:09 +10:00
Matthias Kuhn
d1593caed7 Create a virtual QgsNative base class for platform services
A QgsNative base class is added, that offers default implementations for
a platform interface. These methods can be overridded for the current
platform at compile time to allow specialized handling for integration
with the current system.
2017-05-15 09:15:09 +10:00
Larry Shaffer
f6bd7b3b58 Add OS native interface lib, with objective-c++ interface to Mac Cocoa libraries 2017-05-15 09:15:09 +10:00
Nyall Dawson
f8f7d60cf0 Merge pull request #4514 from nyalldawson/gui_instance
Make a new global QgsGui singleton
2017-05-15 09:03:55 +10:00
Nyall Dawson
c3c694f8cc Port algorithm countVisibleParameters to c++ 2017-05-15 08:44:28 +10:00
Nyall Dawson
ac94345331 Rename QgisGui to QgsGuiUtils
Better reflects what this namespace contains, and replaces the
non-standard Qgis prefix with the Qgs standard
2017-05-15 07:33:52 +10:00
Nyall Dawson
711f6dcc50 QgsShortcutsManager is no longer a singleton
Move the global instance to QgsGui::shortcutsManager()
2017-05-15 07:32:01 +10:00
Nyall Dawson
4a5c9a7ba3 Make a new global QgsGui singleton
Move QgsEditorWidgetRegistry from being a singleton itself to
instead being a member of the QgsGui singleton
2017-05-15 07:32:01 +10:00
Nyall Dawson
280ca31972 Merge pull request #4401 from nyalldawson/processing_params
c++ framework for parameters and running algorithms
2017-05-15 07:08:07 +10:00
Martin Dobias
590526ee32 Another trial to fix mac tests on travis 2017-05-14 00:33:57 +08:00
Martin Dobias
40f683d64f Trying to fix mac test for QgsProject 2017-05-13 23:16:58 +08:00
Martin Dobias
dfcfadc70a Fix build and add bits to project test to understand fail on mac 2017-05-13 22:12:16 +08:00
Martin Dobias
bbb13f4338 Fix text renderer test 2017-05-13 19:53:11 +08:00
Martin Dobias
5bdae75156 API break update + read/write context in labeling and text renderer
This enables correct loading/saving of relative paths of SVG files for background of labels
2017-05-13 18:12:04 +08:00
Martin Dobias
23a7bd0fd9 Introduce QgsReadWriteContext that encapsulates QgsPathResolver
This should make the read/write methods more flexible if we need to give them extra context.
2017-05-13 18:09:26 +08:00
Martin Dobias
bbe59969b7 Fixes to unit tests 2017-05-13 18:02:58 +08:00
Martin Dobias
3e18cc15f8 Respect relative paths in embedded projects (fixes #16355) 2017-05-13 18:02:58 +08:00
Martin Dobias
8ffd91ea90 Propagate path resolver through renderers, annotations, diagrams
This is necessary in order to be able to correctly translate between absolute and relative paths
deeper in the code - e.g. paths to SVG files used in marker or fill symbols.

Until now, relative paths were translated to absolute paths on the fly.
This is now changed - paths to files should be always absolute within QGIS objects - and paths
only get turned into relative when saving projects. When loading a project, relative paths
are translated to absolute paths immediately.

This should lower the overall confusion about relative/absolute paths within QGIS, and also
allow having different base directories for relative paths (e.g. QML or QPT files may use relative paths
to their directory - rather than to the project directory)
2017-05-13 18:02:19 +08:00
lbartoletti
bc0c3a22b0 Add inclination method for QgsPointV2 (#4536) 2017-05-13 17:29:50 +10:00
Alessandro Pasotti
3f9c4e5fa7 Merge pull request #4535 from boundlessgeo/attributetable-fixes-16492
Attributetable fixes  crash #16492
2017-05-12 14:51:28 +02:00
Matthias Kuhn
f9842426dc Improve stability of QgsTask::waitForFinished test 2017-05-12 10:51:13 +02:00
Nyall Dawson
75a5d5dda1 Remove unused skipAttributeCreation option in QgsVectorLayerExporter::exportLayer 2017-05-12 08:03:23 +10:00
Nyall Dawson
384369c3c4 Rename QgsVectorLayerImport to QgsVectorLayerExporter
Since the majority of users of this class will be exporting
an existing map layer to a data provider, the QgsVectorLayerImport
name is misleading and suggests that this class is designed
just to bring layers "into" QGIS.

Explicitly naming the class "Exporter" should help API users
discover this class.

Also cleanup API and improve docs
2017-05-12 08:02:51 +10:00
Alessandro Pasotti
62bd07dd3b Added a comment to the test header 2017-05-11 18:28:51 +02:00
Matthias Kuhn
95597e3bab Add tests for QgsTask::waitForFinished() 2017-05-11 12:42:26 +02:00
lbartoletti
13c1318a5f New geometry class: QgsRegularPolygon (#4502) 2017-05-10 22:23:28 +10:00
Alessandro Pasotti
55cb855003 Use a valid polygon in attr-table test 2017-05-10 12:06:48 +02:00
Nyall Dawson
271a1e38db Convert remaining parameters from python 2017-05-10 17:04:11 +10:00
Nyall Dawson
3706d88045 [processing] c++ framework for parameters and running algorithms (WIP)
This commit adds the virtual method for running processing algs
to the base c++ class, and adds the initial framework
for c++ algorithm parameters.

When running an algorithm, a QVariantMap is passed
as the algorithm parameters. The high level API provided
by QgsProcessingParameters should be used to retrieve
strings/layers/doubles/etc from this QVariantMap.

This allows advanced use cases, such as passing QgsProperty
with the QVariantMap for "dynamic" parameters, where the
value should be evaluated for every feature processed.

E.g. if the buffer algorithm uses a dynamic property for distance,
then the distance could be bound to either a field value or
to a custom expression. This gets evaluated before buffering
each feature to allow for advanced variable buffering.

Support for dynamic parameters will be "opt in", and non default.
So algorithms will need to specifically add support for
dynamic properties as required.
2017-05-10 10:14:37 +10:00
Alessandro Pasotti
212acc120c Merge pull request #4503 from boundlessgeo/attributetable-fixes
[bugfix] Fixes attribute table duplicated rows #15974
2017-05-09 15:13:10 +02:00