Skip to content
Permalink
Browse files
Merge pull request #45032 from qgis/queued_ltr_backports
Queued ltr backports (3.16.12)
  • Loading branch information
nyalldawson committed Sep 14, 2021
2 parents 3996de7 + dbba1ed commit 0e2e98b9ed0eec7127f83c7d29af80c162d25de9
Showing with 1,333 additions and 469 deletions.
  1. +24 −0 python/core/auto_generated/qgsvectorlayer.sip.in
  2. +4 −4 python/plugins/processing/algs/gdal/merge.py
  3. +1 −1 python/plugins/processing/tests/GdalAlgorithmsRasterTest.py
  4. +11 −2 src/app/qgsmaptooloffsetcurve.cpp
  5. +2 −0 src/app/qgsmaptooloffsetcurve.h
  6. +1 −1 src/core/layout/qgslayoutitemmap.cpp
  7. +8 −0 src/core/layout/qgslayoutitemmapgrid.cpp
  8. +134 −73 src/core/providers/memory/qgsmemoryprovider.cpp
  9. +7 −1 src/core/qgscolorramp.cpp
  10. +1 −1 src/core/qgsfield.cpp
  11. +2 −2 src/core/qgstiles.cpp
  12. +12 −0 src/core/qgsvectorlayer.h
  13. +4 −4 src/core/qgsvectorlayereditutils.cpp
  14. +2 −3 src/gui/layout/qgslayoutmapwidget.cpp
  15. +11 −4 src/gui/qgsfilewidget.cpp
  16. +8 −0 src/gui/qgsfilewidget.h
  17. +1 −0 tests/src/core/CMakeLists.txt
  18. +113 −0 tests/src/core/testqgstiles.cpp
  19. +54 −7 tests/src/core/testqgsvectorlayer.cpp
  20. +51 −2 tests/src/python/test_provider_memory.py
  21. +1 −1 tests/src/python/test_qgsauxiliarystorage.py
  22. +7 −4 tests/src/python/test_qgscolorramp.py
  23. +109 −1 tests/src/python/test_qgsserver_wms_dimension.py
  24. BIN .../control_images/qgis_server/WMS_GetMap_Dimension_All_NoValue/WMS_GetMap_Dimension_All_NoValue.png
  25. BIN ...mages/qgis_server/WMS_GetMap_Dimension_Date_MultiValues/WMS_GetMap_Dimension_Date_MultiValues.png
  26. BIN ..._images/qgis_server/WMS_GetMap_Dimension_Date_RangeValue/WMS_GetMap_Dimension_Date_RangeValue.png
  27. BIN ...ta/control_images/qgis_server/WMS_GetMap_Dimension_Date_Value/WMS_GetMap_Dimension_Date_Value.png
  28. BIN ...mages/qgis_server/WMS_GetMap_Dimension_Time_MultiValues/WMS_GetMap_Dimension_Time_MultiValues.png
  29. BIN ..._images/qgis_server/WMS_GetMap_Dimension_Time_RangeValue/WMS_GetMap_Dimension_Time_RangeValue.png
  30. BIN ...ta/control_images/qgis_server/WMS_GetMap_Dimension_Time_Value/WMS_GetMap_Dimension_Time_Value.png
  31. BIN tests/testdata/qgis_server_accesscontrol/dimensions.gpkg
  32. +736 −354 tests/testdata/qgis_server_accesscontrol/project_with_dimensions.qgs
  33. +29 −4 tests/testdata/qgis_server_accesscontrol/results/getcapabilities_wms_dimension.txt
@@ -1658,8 +1658,14 @@ Adds topological points for every vertex of the geometry.

:param geom: the geometry where each vertex is added to segments of other features

:return: -1 in case of layer error (invalid or non editable)

:return: 0 in case of success

:return: 1 in case of geometry error (non spatial or null geometry)

:return: 2 in case no vertices needed to be added

.. note::

geom is not going to be modified by the function
@@ -1681,8 +1687,14 @@ editing.

:param p: position of the vertex

:return: -1 in case of layer error (invalid or non editable)

:return: 0 in case of success

:return: 1 in case of geometry error (non spatial or null geometry)

:return: 2 in case no vertices needed to be added

.. note::

Calls to :py:func:`~QgsVectorLayer.addTopologicalPoints` are only valid for layers in which edits have been enabled
@@ -1703,8 +1715,14 @@ editing.

:param p: position of the vertex

:return: -1 in case of layer error (invalid or non editable)

:return: 0 in case of success

:return: 1 in case of geometry error (non spatial or null geometry)

:return: 2 in case no vertices needed to be added

.. note::

Calls to :py:func:`~QgsVectorLayer.addTopologicalPoints` are only valid for layers in which edits have been enabled
@@ -1724,8 +1742,14 @@ editing.

:param ps: point sequence of the vertices

:return: -1 in case of layer error (invalid or non editable)

:return: 0 in case of success

:return: 1 in case of geometry error (non spatial or null geometry)

:return: 2 in case no vertices needed to be added

.. note::

Calls to :py:func:`~QgsVectorLayer.addTopologicalPoints` are only valid for layers in which edits have been enabled
@@ -71,15 +71,15 @@ def initAlgorithm(self, config=None):

nodata_param = QgsProcessingParameterNumber(self.NODATA_INPUT,
self.tr('Input pixel value to treat as "nodata"'),
type=QgsProcessingParameterNumber.Integer,
type=QgsProcessingParameterNumber.Double,
defaultValue=None,
optional=True)
nodata_param.setFlags(nodata_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
self.addParameter(nodata_param)

nodata_out_param = QgsProcessingParameterNumber(self.NODATA_OUTPUT,
self.tr('Assign specified "nodata" value to output'),
type=QgsProcessingParameterNumber.Integer,
type=QgsProcessingParameterNumber.Double,
defaultValue=None,
optional=True)
nodata_out_param.setFlags(nodata_out_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -141,12 +141,12 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append('-separate')

if self.NODATA_INPUT in parameters and parameters[self.NODATA_INPUT] is not None:
nodata_input = self.parameterAsInt(parameters, self.NODATA_INPUT, context)
nodata_input = self.parameterAsDouble(parameters, self.NODATA_INPUT, context)
arguments.append('-n')
arguments.append(str(nodata_input))

if self.NODATA_OUTPUT in parameters and parameters[self.NODATA_OUTPUT] is not None:
nodata_output = self.parameterAsInt(parameters, self.NODATA_OUTPUT, context)
nodata_output = self.parameterAsDouble(parameters, self.NODATA_OUTPUT, context)
arguments.append('-a_nodata')
arguments.append(str(nodata_output))

@@ -1974,7 +1974,7 @@ def testMerge(self):
cmd[1] = t[:t.find('--optfile') + 10] + t[t.find('mergeInputFiles.txt'):]
self.assertEqual(cmd,
['gdal_merge.py',
'-a_nodata -9999 -ot Float32 -of GTiff ' +
'-a_nodata -9999.0 -ot Float32 -of GTiff ' +
'-o ' + outdir + '/check.tif ' +
'--optfile mergeInputFiles.txt'])

@@ -131,6 +131,15 @@ void QgsMapToolOffsetCurve::canvasReleaseEvent( QgsMapMouseEvent *e )
}
}

void QgsMapToolOffsetCurve::applyOffsetFromWidget( double offset, Qt::KeyboardModifiers modifiers )
{
if ( mSourceLayer && !mOriginalGeometry.isNull() && !qgsDoubleNear( offset, 0 ) )
{
mGeometryModified = true;
applyOffset( offset, modifiers );
}
}

void QgsMapToolOffsetCurve::applyOffset( double offset, Qt::KeyboardModifiers modifiers )
{
if ( !mSourceLayer || offset == 0.0 )
@@ -579,7 +588,7 @@ void QgsMapToolOffsetCurve::createUserInputWidget()
mUserInputWidget->setFocus( Qt::TabFocusReason );

connect( mUserInputWidget, &QgsOffsetUserWidget::offsetChanged, this, &QgsMapToolOffsetCurve::updateGeometryAndRubberBand );
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingFinished, this, &QgsMapToolOffsetCurve::applyOffset );
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingFinished, this, &QgsMapToolOffsetCurve::applyOffsetFromWidget );
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingCanceled, this, &QgsMapToolOffsetCurve::cancel );

connect( mUserInputWidget, &QgsOffsetUserWidget::offsetConfigChanged, this, [ = ] {updateGeometryAndRubberBand( mUserInputWidget->offset() );} );
@@ -590,7 +599,7 @@ void QgsMapToolOffsetCurve::deleteUserInputWidget()
if ( mUserInputWidget )
{
disconnect( mUserInputWidget, &QgsOffsetUserWidget::offsetChanged, this, &QgsMapToolOffsetCurve::updateGeometryAndRubberBand );
disconnect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingFinished, this, &QgsMapToolOffsetCurve::applyOffset );
disconnect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingFinished, this, &QgsMapToolOffsetCurve::applyOffsetFromWidget );
disconnect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingCanceled, this, &QgsMapToolOffsetCurve::cancel );
mUserInputWidget->releaseKeyboard();
mUserInputWidget->deleteLater();
@@ -69,6 +69,8 @@ class APP_EXPORT QgsMapToolOffsetCurve: public QgsMapToolEdit
//! Places curve offset from the mouse position or from the value entered in the spin box
void updateGeometryAndRubberBand( double offset );

void applyOffsetFromWidget( double offset, Qt::KeyboardModifiers modifiers );

//! Apply the offset either from the spin box or from the mouse event
void applyOffset( double offset, Qt::KeyboardModifiers modifiers );

@@ -2610,7 +2610,7 @@ void QgsLayoutItemMap::updateAtlasFeature()
else
scales = mLayout->renderContext().predefinedScales();
Q_NOWARN_DEPRECATED_POP
if ( mAtlasScalingMode == Fixed || isPointLayer || scales.isEmpty() )
if ( mAtlasScalingMode == Fixed || scales.isEmpty() || ( isPointLayer && mAtlasScalingMode != Predefined ) )
{
// only translate, keep the original scale (i.e. width x height)
double xMin = geomCenterX - originalExtent.width() / 2.0;
@@ -1944,6 +1944,13 @@ void QgsLayoutItemMapGrid::refreshDataDefinedProperties()
{
QgsExpressionContext context = createExpressionContext();

// if we are changing the grid interval or offset, then we also have to mark the transform as dirty
mTransformDirty = mTransformDirty
|| mDataDefinedProperties.isActive( QgsLayoutObject::MapGridIntervalX )
|| mDataDefinedProperties.isActive( QgsLayoutObject::MapGridIntervalY )
|| mDataDefinedProperties.isActive( QgsLayoutObject::MapGridOffsetX )
|| mDataDefinedProperties.isActive( QgsLayoutObject::MapGridOffsetY );

mEvaluatedEnabled = mDataDefinedProperties.valueAsBool( QgsLayoutObject::MapGridEnabled, context, enabled() );
switch ( mGridUnit )
{
@@ -1971,6 +1978,7 @@ void QgsLayoutItemMapGrid::refreshDataDefinedProperties()
const double interval = QgsLayoutUtils::calculatePrettySize( minUnitsPerSeg, maxUnitsPerSeg );
mEvaluatedIntervalX = interval;
mEvaluatedIntervalY = interval;
mTransformDirty = true;
}
break;
}

0 comments on commit 0e2e98b

Please sign in to comment.