57869 Commits

Author SHA1 Message Date
Julien Cabieces
5848c27a7f Fix multi edit button not displayed for auxiliary storage attribute 2019-09-20 09:49:12 +10:00
Nyall Dawson
5db6165fb5 [layouts] Fix crash when opening layout with dynamic image in html label
Fixes #28996
2019-09-20 06:37:53 +10:00
Alexander Bruy
f9737a9d5f [processing] add default icon for scripts created using decorator (fix #31252) 2019-09-20 06:37:31 +10:00
Nyall Dawson
9fd17c8f3c [reports] Expose report feature settings when an attribute table is
used in an atlas

Fixes #28441
2019-09-19 22:11:22 +10:00
Even Rouault
f43b9f73a3
Merge pull request #31765 from rouault/fix_31026
[WFS provider] Re-inject custom query parameters in DCP HTTP URLs (fixes #31026)
2019-09-19 13:35:11 +02:00
Denis Rouzaud
cc64787ee6
Merge pull request #31859 from 3nids/layer_tree_insertion_point_v2
[layer tree] dedicated method in QgisApp to determine insertion point
2019-09-19 11:17:58 +02:00
nirvn
015b7e91a1 Add test case covering drawing of effects in legend renderer 2019-09-19 14:26:15 +07:00
nirvn
317a7252e5 [symbol] Fix missing effects when rendering polygon simple line symbol preview 2019-09-19 14:26:15 +07:00
Alessandro Pasotti
60fb0cb47f Apply timer spinbox workaround to QgsDoubleSpinBox too
To prevent double changed event fired in case the slot
takes too long to execute.
2019-09-19 09:10:26 +02:00
Alessandro Pasotti
bd6ecba176 Use scoped class for wait cursor 2019-09-19 09:10:08 +02:00
Denis Rouzaud
13119193ba fix API doc and init values 2019-09-19 09:05:40 +02:00
Nyall Dawson
2f220022b0 Update reference images 2019-09-19 16:56:50 +10:00
Nyall Dawson
7b356fe4cd [layouts] Fix attribute table ignores cell margin for top/bottom aligned text
Fixes #31259
2019-09-19 16:56:50 +10:00
Alessandro Pasotti
f410ea9234
Merge pull request #31876 from elpaso/bugfix-gh30550-gpkg-project-removed-dirty
Set GPKG-stored project dirty when removed
2019-09-19 08:54:26 +02:00
Nyall Dawson
6b5d43ec26 More test mask updates 2019-09-19 14:38:42 +10:00
Nyall Dawson
6c4d0efa1f Fix test which relied on local layout default font setting 2019-09-19 14:38:42 +10:00
Nyall Dawson
c988bd8c23 More test mask updates 2019-09-19 14:38:42 +10:00
Nyall Dawson
3410a36885 Ensure legend symbols are rendered using the correct output dpi to match
layout maps
2019-09-19 14:38:42 +10:00
Nyall Dawson
570ce04b00 Add some test mask images 2019-09-19 14:38:42 +10:00
Nyall Dawson
30e149387b Fix truncated legend symbol borders when layer has opacity set 2019-09-19 14:38:42 +10:00
Nyall Dawson
758ac9092f Avoid another creation of unnecessary temporary render context
Fixes #29058
2019-09-19 14:38:42 +10:00
Nyall Dawson
fad597bf77 Avoid creating temporary render context when we already have a real one
available

This also fixes the low-resolution preview symbols shown in the print
layout designer when a layer is semi-transparent.

Refs #29058
2019-09-19 14:38:42 +10:00
Nyall Dawson
ca35020881 Avoid creating some temporary render contexts whilst determining legend size
Refs #29058
2019-09-19 14:38:42 +10:00
Nyall Dawson
c60204d837 [layouts] Only evaluate default layout font when creating legends, not
when drawing every single part of the legend

QgsSettings is sloooow, so we need to avoid using it as much as possible

Refs #29058
2019-09-19 14:38:42 +10:00
Even Rouault
1494246359
Merge pull request #31860 from rouault/fix_30518
[OGR provider] Invalid feature count on layer reload (fixes #30518)
2019-09-18 21:42:25 +02:00
Alessandro Pasotti
e4ea247c6a Set GPKG-stored project dirty when removed
if it's the current project

Fixes #30550
2019-09-18 21:12:00 +02:00
rldhont
3ff8ca5736
Merge pull request #31855 from Gustry/datetime
update docstring about QgsDateTimeEdit with NULL values
2019-09-18 18:42:57 +02:00
rldhont
7a77d90c52
Merge pull request #31351 from rldhont/server-wms-dimensions
Support WMS dimensions in QGIS Server
2019-09-18 18:26:31 +02:00
Alessandro Pasotti
8192ed8cce Fix double event fired by QSpinBox in slow graduated
... renderer widget

Fixes #31635

For the record of the underlying issue:

https://lists.qt-project.org/pipermail/interest/2013-July/007936.html
https://forum.qt.io/topic/82181/qt-doublespin-box-value-changed-slot-has-called-twice
https://forum.qt.io/topic/96094/qspinbox-value-changed-slot-has-called-twice-on-mouse-click
https://www.qtcentre.org/threads/53709-slot-valueChanged(double)-of-doubleSpinBox-called-twice-if-breakpoint-is-set
2019-09-18 15:06:31 +02:00
nirvn
c7aeb4ceb2 [themes] Add disabled state for tree/table/list widgets 2019-09-18 18:06:51 +07:00
Alessandro Pasotti
6146456075
Merge pull request #31865 from elpaso/bugfix-gh31846-server-contextual-legend-no-width-no-height
Server fix getLegendGraphic default WIDTH/HEIGHT when BBOX
2019-09-18 12:09:11 +02:00
Matthias Kuhn
076b988537
Merge pull request #31854 from m-kuhn/gapCheckFixMz
Allow allowed gap layer to be of different ZM type than main layer
2019-09-18 11:45:41 +02:00
Even Rouault
d45c3dd4f1 QgsCoordinateTransform: remove entries from cache when a thread exits (relates to #31762)
Follow-up to https://github.com/qgis/QGIS/pull/31848

When a thread exits, make sure that we iterate over QgsCoordinateTransform::sTransforms
to remove from QgsCoordinateTransformPrivate::mProjProjections objects that
relates to the current thread, in order to free memory.

This is only implemented in the PROJ >= 6 case. In theory, we could probably
now revert //github.com/qgis/QGIS/pull/31848 for its PROJ 6 code paths, but
keeping it doesn't hurt...

A similar fix could potentially be done in PROJ < 6 case, but it would require
probably the starting call to be in QgsProjContextStore::~QgsProjContextStore()
instead of QgsProjContext::~QgsProjContext()
2019-09-18 16:41:20 +07:00
Alessandro Pasotti
10cf18a995 Add mask to getLegendGraphic test and check SRC(HEIGHT/WIDTH) 2019-09-18 11:32:05 +02:00
Alessandro Pasotti
3be3984e8e
Merge pull request #31841 from elpaso/bugfix-gh31799-tid-in-views
PG views: be tolerant for unsupported field type ...
2019-09-18 11:21:48 +02:00
Even Rouault
b5be645ddb Fix crash in QgsCoordinateTransformPrivate at application exit (fixes #31762)
This fixes the following Valgrind reported error:
```
==1703== Invalid read of size 4
==1703==    at 0xE614195: internal_pj_ctx_get_errno (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0xE6116AE: internal_pj_free (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0xE624E78: internal_proj_destroy (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0x7D3EFE7: QgsCoordinateTransformPrivate::freeProj() (qgscoordinatetransform_p.cpp:659)
==1703==    by 0x7D3CD23: QgsCoordinateTransformPrivate::~QgsCoordinateTransformPrivate() (qgscoordinatetransform_p.cpp:120)
==1703==    by 0x7D3AC46: QExplicitlySharedDataPointer<QgsCoordinateTransformPrivate>::~QExplicitlySharedDataPointer() (qshareddata.h:165)
==1703==    by 0x7D36D63: QgsCoordinateTransform::~QgsCoordinateTransform() (qgscoordinatetransform.cpp:148)
==1703==    by 0x7D3C425: QHashNode<QPair<QString, QString>, QgsCoordinateTransform>::~QHashNode() (qhash.h:149)
==1703==    by 0x7D3C459: QHash<QPair<QString, QString>, QgsCoordinateTransform>::deleteNode2(QHashData::Node*) (qhash.h:536)
==1703==    by 0x9BEEB78: QHashData::free_helper(void (*)(QHashData::Node*)) (in /opt/qt59/lib/libQt5Core.so.5.9.1)
==1703==    by 0x7D3B81C: QHash<QPair<QString, QString>, QgsCoordinateTransform>::freeData(QHashData*) (qhash.h:576)
==1703==    by 0x7D3B2B3: QHash<QPair<QString, QString>, QgsCoordinateTransform>::~QHash() (qhash.h:254)
==1703==    by 0x7D3B7DA: QHash<QPair<QString, QString>, QgsCoordinateTransform>::operator=(QHash<QPair<QString, QString>, QgsCoordinateTransform>&&) (qhash.h:260)
==1703==    by 0x7D3B239: QHash<QPair<QString, QString>, QgsCoordinateTransform>::clear() (qhash.h:582)
==1703==    by 0x7D3A685: QgsCoordinateTransform::invalidateCache(bool) (qgscoordinatetransform.cpp:958)
==1703==    by 0x7C73601: QgsApplication::invalidateCaches() (qgsapplication.cpp:365)
==1703==    by 0x7C7A490: QgsApplication::exitQgis() (qgsapplication.cpp:1275)
==1703==    by 0x511BCC5: QgisApp::~QgisApp() (qgisapp.cpp:1662)
==1703==    by 0x511BE73: QgisApp::~QgisApp() (qgisapp.cpp:1664)
==1703==    by 0x418CB4: main (main.cpp:1579)
==1703==  Address 0x48fc4710 is 0 bytes inside a block of size 136 free'd
==1703==    at 0x4C2F440: operator delete(void*) (vg_replace_malloc.c:586)
==1703==    by 0xE625A3A: internal_proj_context_destroy (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0x7F9B78A: QgsProjContext::~QgsProjContext() (qgsprojutils.cpp:48)
==1703==    by 0xA6195FE: __call_tls_dtors (cxa_thread_atexit_impl.c:155)
==1703==    by 0x10A936C7: start_thread (pthread_create.c:343)
==1703==    by 0xA6E641C: clone (clone.S:109)
==1703==  Block was alloc'd at
==1703==    at 0x4C2E709: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:387)
==1703==    by 0xE61445E: internal_pj_ctx_alloc (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0x7F9B761: QgsProjContext::QgsProjContext() (qgsprojutils.cpp:39)
==1703==    by 0x7F9C6B9: __tls_init (qgsprojutils.cpp:31)
==1703==    by 0x7F9C703: TLS wrapper function for QgsProjContext::sProjContext (in /home/even/qgis/QGIS/build/output/lib/libqgis_core.so.3.9.0)
==1703==    by 0x7F9B796: QgsProjContext::get() (qgsprojutils.cpp:57)
==1703==    by 0x7D3D5AA: QgsCoordinateTransformPrivate::threadLocalProjData() (qgscoordinatetransform_p.cpp:299)
==1703==    by 0x7D3D11A: QgsCoordinateTransformPrivate::initialize() (qgscoordinatetransform_p.cpp:199)
==1703==    by 0x7D368E4: QgsCoordinateTransform::QgsCoordinateTransform(QgsCoordinateReferenceSystem const&, QgsCoordinateReferenceSystem const&, QgsCoordinateTransformContext const&) (qgscoordinatetransform.cpp:75)
==1703==    by 0x8317CBE: QgsRasterProjector::block(int, QgsRectangle const&, int, int, QgsRasterBlockFeedback*) (qgsrasterprojector.cpp:779)
==1703==    by 0x82EBE87: QgsRasterIterator::readNextRasterPartInternal(int, int&, int&, std::unique_ptr<QgsRasterBlock, std::default_delete<QgsRasterBlock> >*, int&, int&, QgsRectangle*) (qgsrasteriterator.cpp:130)
==1703==    by 0x82EB791: QgsRasterIterator::readNextRasterPart(int, int&, int&, std::unique_ptr<QgsRasterBlock, std::default_delete<QgsRasterBlock> >&, int&, int&, QgsRectangle*) (qgsrasteriterator.cpp:80)
==1703==    by 0x8334E8D: QgsRasterDrawer::draw(QPainter*, QgsRasterViewPort*, QgsMapToPixel const*, QgsRasterBlockFeedback*) (qgsrasterdrawer.cpp:60)
==1703==    by 0x830AEE3: QgsRasterLayerRenderer::render() (qgsrasterlayerrenderer.cpp:269)
==1703==    by 0x7E764FB: QgsMapRendererCustomPainterJob::doRender() (qgsmaprenderercustompainterjob.cpp:310)
==1703==    by 0x7E76027: QgsMapRendererCustomPainterJob::staticRender(QgsMapRendererCustomPainterJob*) (qgsmaprenderercustompainterjob.cpp:261)
==1703==    by 0x7E788D6: QtConcurrent::StoredFunctorCall1<void, void (*)(QgsMapRendererCustomPainterJob*), QgsMapRendererCustomPainterJob*>::runFunctor() (qtconcurrentstoredfunctioncall.h:432)
==1703==    by 0x7E76E42: QtConcurrent::RunFunctionTask<void>::run() (qtconcurrentrunbase.h:136)
==1703==    by 0x9B93942: ??? (in /opt/qt59/lib/libQt5Core.so.5.9.1)
==1703==    by 0x9B97658: ??? (in /opt/qt59/lib/libQt5Core.so.5.9.1)
==1703==    by 0x10A936B9: start_thread (pthread_create.c:333)
==1703==    by 0xA6E641C: clone (clone.S:109)
```

This issue is also found on QGIS 3.4 / PROJ 5 with a slighly comparable stack
trace.

The issue here is that the static QgsCoordinateTransform::sTransforms cache map
contains QgsCoordinateTransformPrivate::mProjProjections objects, which themselves
are PJ*/projPJ PROJ objects. Those objects may have been created by a thread,
using a PROJ context, which is a TLS object, and thus has been deleted when
the thread is itself deleted. However sTransforms is cleaned afterwards, and
when destroying a PJ*/projPJ object, the context it is attached to must still
be alive.

This fix of this commit consists in creating a temporary PROJ context and assigning
it to the PJ* object before its destruction.

A proper fix would be to remove from sTransforms the PROJ objects that belong to
a given thread when that thread is deleted (or more exactly QgsProjContext is destroyed),
but that's more involved. Another reason for such a proper fix is to avoid a
kind of memory leak, since currently sTransforms might grow without control when
threads are created and destroyed.
2019-09-18 16:04:39 +07:00
Even Rouault
cd3940df7c
Merge pull request #31813 from rouault/fix_29844
[WFS provider] Fix recovery of GeoServer server error when lack of primary key (fixes #29844)
2019-09-18 11:00:58 +02:00
Alessandro Pasotti
55f89db98f Add some comments for checkParameters function
also set const back
2019-09-18 09:58:12 +02:00
Alessandro Pasotti
55f237911a
code layout 2019-09-18 09:44:55 +02:00
Matthias Kuhn
23bd724546 Add safety check for nullptr to fix a crash 2019-09-18 09:36:14 +02:00
Matthias Kuhn
61812648a3 Add API to hook into resolveReferences 2019-09-18 09:32:02 +02:00
Nyall Dawson
2c69b24ffe Avoid use of deprecated method in test 2019-09-18 10:35:23 +10:00
Nyall Dawson
8157971dd7 Fix API break 2019-09-18 10:35:23 +10:00
Nyall Dawson
fcd21e4850 [reports] Fix predefined scale mode is incompatible with report outputs
Fixes #29196
2019-09-18 10:35:23 +10:00
Nyall Dawson
ffc71c4f57 Remove const_cast 2019-09-18 07:55:46 +10:00
Nyall Dawson
3de0593957 Ensure atlas expression evaluation has access to coverage layer scope
Fixes #31807
2019-09-18 07:55:46 +10:00
Even Rouault
2a2cb87f8e
[OGR provider] Invalid feature count on layer reload (fixes #30518) 2019-09-17 22:33:50 +02:00
Denis Rouzaud
838dbef3c0 [layer tree] dedicated method in QgisApp to determine insertion point
and create bindings to get the current insertion point in QgisInterface
2019-09-17 20:55:40 +02:00
Nyall Dawson
421e68cf5a [layouts] Resizing pages to content should not create empty page size
if no items are present

Fixes #29034
2019-09-18 04:29:35 +10:00
Nyall Dawson
f5afebe5dd [layouts] Fix map rotation does not immediately restore in reports
Fixes #31217
2019-09-18 04:29:14 +10:00