53087 Commits

Author SHA1 Message Date
Nyall Dawson
e569331abb Disable linked color buttons when a project color is set for a property 2019-01-11 22:34:34 +10:00
Nyall Dawson
eecfe50dc5 [FEATURE] Show Project Colors in color bound data defined buttons
This adds a new "Project Colors" section in data defined buttons
which are linked to a color value. The color menu contains all
colors defined as part of the current project's Project Color
Scheme (which is defined through project properties).

When a project color is selected from the button, the property
becomes linked to that color. It will automatically follow any
future changes to the color when made through project properties.

This allows users to define common colors for a project once,
and then "bind" symbol, label, layout, etc colors to these
preset colors. The link is live, so you change it once, and
the change is reflected EVERYWHERE. Sure beats updating a color
100 times when it's use has been scattered throughout a project's
symbols, labels, etc...

(Basically, this is just adding a shortcut to setting a data
defined expression "project_color(...)" for the property. The
project_color function has been around a LOOONG time, but it's
only really been usable by power users before this change)
2019-01-11 22:34:34 +10:00
Nyall Dawson
79d01a9b94 Move QgsColorButton::createMenuIcon to public API, make static 2019-01-11 22:34:34 +10:00
Nyall Dawson
938adb8c17 [api] Add PyQGIS helpers to QgsGeometry.asMultiPoint(), asMultiPolyline()
and asMultiPolygon()

- raise ValueError when these methods are called with null geometries
- raise TypeError when these methods are called with incompatible
geometry types, instead of silently returning empty lists
2019-01-11 21:31:14 +10:00
Matthias Kuhn
2664737fc2
Merge pull request #8827 from m-kuhn/gpkg_transaction_test
sqlite_fetch_and_increment cached mode for transactions
2019-01-11 12:26:33 +01:00
Julien Cabieces
06bf5a99db add unit test 2019-01-11 12:04:23 +01:00
Matthias Kuhn
5962afdf21
Improve expression documentation for sqlite_fetch_and_increment 2019-01-11 10:53:17 +01:00
Matthias Kuhn
ccdd133c8b
Fix test linking 2019-01-11 10:30:54 +01:00
Nyall Dawson
b49e940508 Make color swatch list hi-dpi friendly 2019-01-11 13:45:54 +10:00
Nyall Dawson
9d4b80e2f1 Refine multiline selection behaviour in editors 2019-01-11 10:15:51 +10:00
Nyall Dawson
fdfe0cee23 [api][needs-docs] Allow registering PyQGIS using a nice decorator syntax
This allows nice and simple, elegant construction of checks for
Python.

To use, Python based checks should use the decorator syntax:

  from qgis.core import check

  @check.register(type=QgsAbstractValidityCheck.TypeLayoutCheck)
  def my_layout_check(context, feedback):
    results = ...
    return results

Or, a more complete example. This one throws a warning when attempting
to export a layout with a map item set to the Web Mercator projection:

  @check.register(type=QgsAbstractValidityCheck.TypeLayoutCheck)
  def layout_map_crs_choice_check(context, feedback):
    layout = context.layout
    results = []
    for i in layout.items():
      if isinstance(i, QgsLayoutItemMap) and i.crs().authid() == 'EPSG:3857':
        res = QgsValidityCheckResult()
        res.type = QgsValidityCheckResult.Warning
        res.title='Map projection is misleading'
        res.detailedDescription='The projection for the map item {} is set to <i>Web Mercator (EPSG:3857)</i> which misrepresents areas and shapes. Consider using an appropriate local projection instead.'.format(i.displayName())
        results.append(res)

    return results
2019-01-11 09:51:04 +10:00
Nyall Dawson
fd001bbd4d [FEATURE][layouts] Add validity check to flag when a map item
has an overview which is not linked to any existing maps
2019-01-11 09:51:04 +10:00
Nyall Dawson
b80829ce59 Remove leftover QObject inheritance 2019-01-11 09:51:04 +10:00
Nyall Dawson
93bfbd00fc Astyle 2019-01-11 08:57:39 +10:00
Julien Cabieces
c478ba9c0f fixes #20547 : Fix error when using a spatialite layer with a non-int primary key an a spatial index 2019-01-10 18:53:54 +01:00
Matthias Kuhn
fd00cd54fe
Merge pull request #8705 from arnaud-morvan/server_diagrams_filter
Apply featureFilterProvider in QgsVectorLayerDiagramProvider
2019-01-10 18:02:36 +01:00
Peter Petrik
29ad9d7f2a on mac, terrain is sometimes not loaded on time [3d] fix #20963 2019-01-10 15:10:10 +01:00
Alessandro Pasotti
70466320a8 Typo (old one) 2019-01-10 11:18:03 +01:00
Matthias Kuhn
a740fec06b
Make sure sqlite_fetch_and_increment is always executed on the main thread 2019-01-10 10:59:56 +01:00
Alessandro Pasotti
cd763bccf2 Update override comment with a full explanation of what it does
Also checks for original url emptiness before returning it.
2019-01-10 10:58:27 +01:00
Nyall Dawson
e8b057b496 Fix crash 2019-01-10 19:54:26 +10:00
Nyall Dawson
b4d764ae74 Fix typo 2019-01-10 19:54:26 +10:00
Nyall Dawson
70880089cc Avoid duplicate code 2019-01-10 19:54:26 +10:00
Nyall Dawson
32126ca2b8 Add missing since annotation 2019-01-10 19:54:26 +10:00
Nyall Dawson
5c2b39438b Dox++ 2019-01-10 19:54:26 +10:00
Nyall Dawson
c7d09a3261 Fix typo 2019-01-10 19:54:26 +10:00
Nyall Dawson
2a2995aad4 Sipify 2019-01-10 19:54:26 +10:00
Alex
f0ffbeb7be change bindings again 2019-01-10 19:54:26 +10:00
Alex
12273fa83a Change bindings
Manually inserting the proper binding
2019-01-10 19:54:26 +10:00
Alex
78caf770e3 removing whitespaces 2019-01-10 19:54:26 +10:00
Alex
2fab80e4f3 adding barebone documentation 2019-01-10 19:54:26 +10:00
Alex
f2290fcd0a adding QgsRenderContext class to the header 2019-01-10 19:54:26 +10:00
Alex
db699adde8 removed duplicate signatures 2019-01-10 19:54:26 +10:00
Alex
1fff24da11 adding missing include for qgsrendercontext 2019-01-10 19:54:26 +10:00
Alex
58dc153754 fixing whitespaces in newer functions 2019-01-10 19:54:26 +10:00
Alex
8b3744331a Adding QgsRenderContext support 2019-01-10 19:54:26 +10:00
Alex
99837cf725 adding QgsRenderContext support 2019-01-10 19:54:26 +10:00
Matthias Kuhn
dafb16654f
Add an additional test for cached mode of sqlite_fetch_and_increment 2019-01-10 10:48:05 +01:00
Matthias Kuhn
abb0f73f3f
Merge pull request #8825 from nirvn/osx
[themes] Force fusion style for non-default UI themes on OS X
2019-01-10 10:38:35 +01:00
Matthias Kuhn
d3b4c7d83a
Add cached mode to sqlite_fetch_and_increment for transactions 2019-01-10 10:35:24 +01:00
Mathieu Pellerin
c7abba03fb [themes] Force fusion style for non-default UI themes on OS X 2019-01-10 15:09:02 +07:00
Matthias Kuhn
c263750930
Merge pull request #8820 from m-kuhn/map_layer_template
QgsProject::mapLayer<Qgs[Type]Layer *>( layerId ); template
2019-01-10 08:06:52 +01:00
Nyall Dawson
43df43fb32 Fix build 2019-01-10 10:25:08 +10:00
Blottiere Paul
fcc3996ddf Remove unnecessary #include in server 2019-01-10 07:50:02 +10:00
Alessandro Pasotti
cf5982c309 Add tests for QgsFcgiServerRequest rewrites 2019-01-09 18:46:32 +01:00
Alessandro Pasotti
00ec08a8aa Rewritten function comment 2019-01-09 18:46:32 +01:00
Alessandro Pasotti
bb9ec39fa6 [server] Fix URL rewrite from fcgi servers
The URL exposed in the XML documents generated
by the server was wrong because instead of
using the original URL (from REQUEST_URI)
the rewritten query string (from QUERY_STRING)
was applied to the internal mUrl variable.

This patch also adds some tests for the
FCGI request, that handle most common
scenarios with bot rewritten and not
rewritten URLs.

QgsFcgiServerRequest is now exposed to
Python mainly for testability purposes.
2019-01-09 18:46:32 +01:00
Matthias Kuhn
918bfef51e
Add a test for transaction save local default value generation with gpkg 2019-01-09 18:13:13 +01:00
Matthias Kuhn
e32c739b47
Make use of QgsProject::mapLayer<QgsVectorLayer *> template 2019-01-09 16:25:45 +01:00
Matthias Kuhn
468f25c5b1
Add a template method to get a casted maplayer
This simplifies the casting of maplayers when accessing them from the layer registry.
2019-01-09 16:12:54 +01:00