Skip to content
Permalink
Browse files

Merge branch 'master' into pyflakes

  • Loading branch information
m-kuhn committed May 6, 2020
2 parents 3e6c7c2 + 1e0b890 commit 0aa1eb0e1e3716c0940d93e3dd50c5ff90d3b7dc
Showing with 1,605 additions and 203 deletions.
  1. +10 −1 .docker/qgis_resources/test_runner/qgis_testrunner.sh
  2. +1 −0 images/images.qrc
  3. +72 −0 images/themes/default/sort-reverse.svg
  4. +2 −1 python/core/auto_additions/qgsscalebarrenderer.py
  5. +29 −0 python/core/auto_generated/layertree/qgslayertreelayer.sip.in
  6. +18 −0 python/core/auto_generated/layertree/qgslayertreemodellegendnode.sip.in
  7. +2 −0 python/core/auto_generated/layout/qgslayoutitem.sip.in
  8. +36 −0 python/core/auto_generated/layout/qgslayoutitemscalebar.sip.in
  9. +28 −0 python/core/auto_generated/mesh/qgsmeshlayer.sip.in
  10. +98 −1 python/core/auto_generated/qgslegendsettings.sip.in
  11. +18 −0 python/core/auto_generated/qgsmaplayerlegend.sip.in
  12. +1 −0 python/core/auto_generated/scalebar/qgsscalebarrenderer.sip.in
  13. +36 −0 python/core/auto_generated/scalebar/qgsscalebarsettings.sip.in
  14. +5 −1 python/gui/auto_generated/attributetable/qgsfeaturelistmodel.sip.in
  15. +7 −6 scripts/parse_dash_results.py
  16. +5 −0 src/core/layertree/qgslayertreelayer.cpp
  17. +33 −0 src/core/layertree/qgslayertreelayer.h
  18. +17 −0 src/core/layertree/qgslayertreemodellegendnode.h
  19. +2 −0 src/core/layout/qgslayoutitem.h
  20. +4 −0 src/core/layout/qgslayoutitemscalebar.cpp
  21. +28 −0 src/core/layout/qgslayoutitemscalebar.h
  22. +150 −45 src/core/mesh/qgsmeshlayer.cpp
  23. +34 −0 src/core/mesh/qgsmeshlayer.h
  24. +82 −15 src/core/qgslegendrenderer.cpp
  25. +10 −2 src/core/qgslegendrenderer.h
  26. +98 −1 src/core/qgslegendsettings.h
  27. +16 −0 src/core/qgsmaplayerlegend.cpp
  28. +16 −0 src/core/qgsmaplayerlegend.h
  29. +1 −0 src/core/scalebar/qgsscalebarrenderer.h
  30. +4 −0 src/core/scalebar/qgsscalebarsettings.cpp
  31. +32 −0 src/core/scalebar/qgsscalebarsettings.h
  32. +36 −15 src/core/scalebar/qgsticksscalebarrenderer.cpp
  33. +34 −16 src/gui/attributetable/qgsdualview.cpp
  34. +4 −4 src/gui/attributetable/qgsdualview.h
  35. +3 −3 src/gui/attributetable/qgsfeaturelistmodel.cpp
  36. +2 −1 src/gui/attributetable/qgsfeaturelistmodel.h
  37. +53 −0 src/gui/layout/qgslayoutlegendwidget.cpp
  38. +2 −0 src/gui/layout/qgslayoutlegendwidget.h
  39. +41 −0 src/gui/layout/qgslayoutscalebarwidget.cpp
  40. +2 −0 src/gui/layout/qgslayoutscalebarwidget.h
  41. +4 −3 src/gui/qgsexpressionpreviewwidget.cpp
  42. +1 −0 src/gui/qgsexpressionpreviewwidget.h
  43. +59 −14 src/gui/qgsfilewidget.cpp
  44. +6 −0 src/gui/qgsfilewidget.h
  45. +5 −1 src/gui/qgsnewgeopackagelayerdialog.cpp
  46. +3 −1 src/gui/qgsnewvectorlayerdialog.cpp
  47. +73 −31 src/providers/postgres/qgspostgresprovider.cpp
  48. +67 −41 src/ui/layout/qgslayoutlegendnodewidgetbase.ui
  49. +36 −0 src/ui/layout/qgslayoutscalebarwidgetbase.ui
  50. +48 −0 tests/src/core/testqgslayoutscalebar.cpp
  51. +146 −0 tests/src/core/testqgslegendrenderer.cpp
  52. +46 −0 tests/src/core/testqgsmeshlayer.cpp
  53. +39 −0 tests/src/python/test_provider_postgres.py
  54. BIN ..._scalebar/expected_layoutscalebar_tick_subdivisions/expected_layoutscalebar_tick_subdivisions.png
  55. BIN ...ebar/expected_layoutscalebar_tick_subdivisions/expected_layoutscalebar_tick_subdivisions_mask.png
  56. BIN tests/testdata/control_images/legend/expected_legend_column_breaks/expected_legend_column_breaks.png
  57. BIN .../testdata/control_images/legend/expected_legend_column_breaks2/expected_legend_column_breaks2.png
  58. BIN .../testdata/control_images/legend/expected_legend_column_breaks3/expected_legend_column_breaks3.png
  59. BIN .../testdata/control_images/legend/expected_legend_column_breaks4/expected_legend_column_breaks4.png
  60. BIN .../testdata/control_images/legend/expected_legend_column_breaks5/expected_legend_column_breaks5.png
  61. BIN ...end/expected_legend_layer_column_splitting_allow/expected_legend_layer_column_splitting_allow.png
  62. BIN ...expected_legend_layer_column_splitting_prevent/expected_legend_layer_column_splitting_prevent.png
@@ -13,10 +13,19 @@ TEST_NAME=$1
TEST_RUNNER_PATH=${TEST_RUNNER_PATH:-/usr/bin/qgis_testrunner.py}
QGIS_BUILD_PATH=${QGIS_BUILD_PATH:-qgis}

LOGFILE=/tmp/qgis_testrunner_$$

echo "Running test $1 ..."
OUTPUT=$(QGIS_TEST_MODULE=${TEST_NAME} unbuffer ${QGIS_BUILD_PATH} --version-migration --nologo --code ${TEST_RUNNER_PATH} "$TEST_NAME" 2>/dev/null | tee /dev/tty)
QGIS_TEST_MODULE=${TEST_NAME} unbuffer ${QGIS_BUILD_PATH} \
--version-migration --nologo --code \
${TEST_RUNNER_PATH} "$TEST_NAME" \
2>/dev/null | \
tee ${LOGFILE}

# NOTE: EXIT_CODE will always be 0 if "tee" works,
# we could `set -o pipefail` to change this
EXIT_CODE="$?"
OUTPUT=$(cat $LOGFILE) # quick hack to avoid changing too many lines
if [ -z "$OUTPUT" ]; then
echo "ERROR: no output from the test runner! (exit code: ${EXIT_CODE})"
exit 1
@@ -675,6 +675,7 @@
<file>themes/default/multieditSameValues.svg</file>
<file>themes/default/locked_repeating.svg</file>
<file>themes/default/sort.svg</file>
<file>themes/default/sort-reverse.svg</file>
<file>themes/default/styleicons/multibandcolor.svg</file>
<file>themes/default/styleicons/paletted.svg</file>
<file>themes/default/styleicons/singlebandgray.svg</file>
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0rc1 (09960d6, 2020-04-09)"
sodipodi:docname="sort-reverse.svg"
id="svg839"
version="1.1"
width="16"
viewBox="0 0 4.2333333 4.2333335"
height="16">
<metadata
id="metadata845">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs843" />
<sodipodi:namedview
inkscape:current-layer="svg839"
inkscape:window-maximized="0"
inkscape:window-y="23"
inkscape:window-x="0"
inkscape:cy="8"
inkscape:cx="8"
inkscape:zoom="44.5"
showgrid="false"
id="namedview841"
inkscape:window-height="1012"
inkscape:window-width="1759"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<path
inkscape:connector-curvature="0"
id="path833"
style="fill:#6d97c4;fill-rule:evenodd;stroke:#415a75;stroke-width:0.198438;stroke-linecap:round;stroke-linejoin:round"
d="M 2.9088665,0.40079901 1.8293909,1.6410334 H 2.602776 L 2.8915153,3.7628679 3.2054438,1.6410334 h 0.7828981 z" />
<path
id="path835"
stroke-width=".19843751"
stroke-linejoin="round"
stroke-linecap="round"
stroke="#a40000"
fill="#f79191"
d="m1.2400171 1.4925339h-.54129826l-.0854208.2668105h-.3479775l.49723917-1.46451483h.41271749l.4972392 1.46451483h-.3479775l-.084522-.2668105m-.45497826-.271715h.36775916l-.1834298-.58266702-.18432916.58266702" />
<path
id="path837"
stroke-width=".19843751"
stroke-linejoin="round"
stroke-linecap="round"
stroke="#0044a4"
fill="#91bbf7"
d="m .40469133 2.2147734h1.12845407v.2285545l-.72023241.9505123h.74091331v.285448h-1.16981581v-.2285546l.72023251-.9505123h-.69955167z" />
</svg>
@@ -11,5 +11,6 @@
QgsScaleBarRenderer.Flag.FlagUsesLabelVerticalPlacement.__doc__ = "Renderer uses the QgsScaleBarSettings::labelVerticalPlacement() setting"
QgsScaleBarRenderer.Flag.FlagUsesLabelHorizontalPlacement.__doc__ = "Renderer uses the QgsScaleBarSettings::labelHorizontalPlacement() setting"
QgsScaleBarRenderer.Flag.FlagUsesAlignment.__doc__ = "Renderer uses the QgsScaleBarSettings::alignment() setting"
QgsScaleBarRenderer.Flag.__doc__ = 'Flags which control scalebar renderer behavior.\n\n.. versionadded:: 3.14\n\n' + '* ``FlagUsesLineSymbol``: ' + QgsScaleBarRenderer.Flag.FlagUsesLineSymbol.__doc__ + '\n' + '* ``FlagUsesFillSymbol``: ' + QgsScaleBarRenderer.Flag.FlagUsesFillSymbol.__doc__ + '\n' + '* ``FlagUsesAlternateFillSymbol``: ' + QgsScaleBarRenderer.Flag.FlagUsesAlternateFillSymbol.__doc__ + '\n' + '* ``FlagRespectsUnits``: ' + QgsScaleBarRenderer.Flag.FlagRespectsUnits.__doc__ + '\n' + '* ``FlagRespectsMapUnitsPerScaleBarUnit``: ' + QgsScaleBarRenderer.Flag.FlagRespectsMapUnitsPerScaleBarUnit.__doc__ + '\n' + '* ``FlagUsesUnitLabel``: ' + QgsScaleBarRenderer.Flag.FlagUsesUnitLabel.__doc__ + '\n' + '* ``FlagUsesSegments``: ' + QgsScaleBarRenderer.Flag.FlagUsesSegments.__doc__ + '\n' + '* ``FlagUsesLabelBarSpace``: ' + QgsScaleBarRenderer.Flag.FlagUsesLabelBarSpace.__doc__ + '\n' + '* ``FlagUsesLabelVerticalPlacement``: ' + QgsScaleBarRenderer.Flag.FlagUsesLabelVerticalPlacement.__doc__ + '\n' + '* ``FlagUsesLabelHorizontalPlacement``: ' + QgsScaleBarRenderer.Flag.FlagUsesLabelHorizontalPlacement.__doc__ + '\n' + '* ``FlagUsesAlignment``: ' + QgsScaleBarRenderer.Flag.FlagUsesAlignment.__doc__
QgsScaleBarRenderer.Flag.FlagUsesSubdivisions.__doc__ = "Renderer uses the scalebar subdivisions"
QgsScaleBarRenderer.Flag.__doc__ = 'Flags which control scalebar renderer behavior.\n\n.. versionadded:: 3.14\n\n' + '* ``FlagUsesLineSymbol``: ' + QgsScaleBarRenderer.Flag.FlagUsesLineSymbol.__doc__ + '\n' + '* ``FlagUsesFillSymbol``: ' + QgsScaleBarRenderer.Flag.FlagUsesFillSymbol.__doc__ + '\n' + '* ``FlagUsesAlternateFillSymbol``: ' + QgsScaleBarRenderer.Flag.FlagUsesAlternateFillSymbol.__doc__ + '\n' + '* ``FlagRespectsUnits``: ' + QgsScaleBarRenderer.Flag.FlagRespectsUnits.__doc__ + '\n' + '* ``FlagRespectsMapUnitsPerScaleBarUnit``: ' + QgsScaleBarRenderer.Flag.FlagRespectsMapUnitsPerScaleBarUnit.__doc__ + '\n' + '* ``FlagUsesUnitLabel``: ' + QgsScaleBarRenderer.Flag.FlagUsesUnitLabel.__doc__ + '\n' + '* ``FlagUsesSegments``: ' + QgsScaleBarRenderer.Flag.FlagUsesSegments.__doc__ + '\n' + '* ``FlagUsesLabelBarSpace``: ' + QgsScaleBarRenderer.Flag.FlagUsesLabelBarSpace.__doc__ + '\n' + '* ``FlagUsesLabelVerticalPlacement``: ' + QgsScaleBarRenderer.Flag.FlagUsesLabelVerticalPlacement.__doc__ + '\n' + '* ``FlagUsesLabelHorizontalPlacement``: ' + QgsScaleBarRenderer.Flag.FlagUsesLabelHorizontalPlacement.__doc__ + '\n' + '* ``FlagUsesAlignment``: ' + QgsScaleBarRenderer.Flag.FlagUsesAlignment.__doc__ + '\n' + '* ``FlagUsesSubdivisions``: ' + QgsScaleBarRenderer.Flag.FlagUsesSubdivisions.__doc__
# --
@@ -177,6 +177,35 @@ symbol width or height from :py:class:`QgsLegendSettings`.

.. seealso:: :py:func:`patchSize`

.. versionadded:: 3.14
%End

enum LegendNodesSplitBehavior
{
UseDefaultLegendSetting,
AllowSplittingLegendNodesOverMultipleColumns,
PreventSplittingLegendNodesOverMultipleColumns,
};

LegendNodesSplitBehavior legendSplitBehavior() const;
%Docstring
Returns the column split behavior for the node.

This value controls how legend nodes belonging the to layer may be split over multiple columns in legends.

.. seealso:: :py:func:`setLegendSplitBehavior`

.. versionadded:: 3.14
%End

void setLegendSplitBehavior( LegendNodesSplitBehavior behavior );
%Docstring
Sets the column split ``behavior`` for the node.

This value controls how legend nodes belonging the to layer may be split over multiple columns in legends.

.. seealso:: :py:func:`legendSplitBehavior`

.. versionadded:: 3.14
%End

@@ -93,6 +93,24 @@ symbol width or height from :py:class:`QgsLegendSettings`.

.. seealso:: :py:func:`userPatchSize`

.. versionadded:: 3.14
%End

virtual void setColumnBreak( bool breakBeforeNode );
%Docstring
Sets whether a forced column break should occur before the node.

.. seealso:: :py:func:`columnBreak`

.. versionadded:: 3.14
%End

virtual bool columnBreak() const;
%Docstring
Returns whether a forced column break should occur before the node.

.. seealso:: :py:func:`setColumnBreak`

.. versionadded:: 3.14
%End

@@ -223,6 +223,8 @@ Base class for graphical items within a :py:class:`QgsLayout`.
UndoScaleBarSegmentsLeft,
UndoScaleBarSegments,
UndoScaleBarHeight,
UndoScaleBarSubdivisions,
UndoScaleBarSubdivisionsHeight,
UndoScaleBarFontColor,
UndoScaleBarFillColor,
UndoScaleBarFillColor2,
@@ -74,6 +74,42 @@ Sets the number of ``segments`` included in the left part of the scalebar.
.. seealso:: :py:func:`numberOfSegmentsLeft`

.. seealso:: :py:func:`setNumberOfSegments`
%End

int numberOfSubdivisions() const;
%Docstring
Returns the number of subdivisions for segments included in the right part of the scalebar (only used for some scalebar types).

.. seealso:: :py:func:`setNumberOfSubdivisions`

.. versionadded:: 3.14
%End

void setNumberOfSubdivisions( int subdivisions );
%Docstring
Sets the number of ``subdivisions`` for segments included in the right part of the scalebar (only used for some scalebar types).

.. seealso:: :py:func:`numberOfSubdivisions`

.. versionadded:: 3.14
%End

double subdivisionsHeight() const;
%Docstring
Returns the scalebar subdivisions height (in millimeters) for segments included in the right part of the scalebar (only used for some scalebar types).

.. seealso:: :py:func:`setSubdivisionsHeight`

.. versionadded:: 3.14
%End

void setSubdivisionsHeight( double height );
%Docstring
Sets the scalebar subdivisions ``height`` (in millimeters) for segments included in the right part of the scalebar (only used for some scalebar types).

.. seealso:: :py:func:`subdivisionsHeight`

.. versionadded:: 3.14
%End

double unitsPerSegment() const;
@@ -317,6 +317,34 @@ Sets the reference time of the layer

:param referenceTime: the reference time

.. versionadded:: 3.14
%End

QgsPointXY snapOnElement( QgsMesh::ElementType elementType, const QgsPointXY &point, double searchRadius );
%Docstring
Returns the position of the snapped point on the mesh element closest to ``point`` intersecting with
the searching area defined by ``point`` and ``searchRadius``

For vertex, the snapped position is the vertex position
For edge, the snapped position is the projected point on the edge, extremity of edge if outside the edge
For face, the snapped position is the centroid of the face
The returned position is in map coordinates.

.. note::

It uses previously cached and indexed triangular mesh
and so if the layer has not been rendered previously
(e.g. when used in a script) it returns empty :py:class:`QgsPointXY`

.. seealso:: :py:func:`updateTriangularMesh`

:param elementType: the type of element to snap
:param point: the center of the search area in map coordinates
:param searchRadius: the radius of the search area in map units

:return: the position of the snapped point on the closest element, empty QgsPointXY if no element of type ``elementType``


.. versionadded:: 3.14
%End

@@ -107,19 +107,84 @@ line character.
%End

double columnSpace() const;
%Docstring
Returns the margin space between adjacent columns (in millimeters).

.. seealso:: :py:func:`setColumnSpace`
%End

void setColumnSpace( double s );
%Docstring
Sets the margin space between adjacent columns (in millimeters).

.. seealso:: :py:func:`columnSpace`
%End

int columnCount() const;
%Docstring
Returns the desired minimum number of columns to show in the legend.

If legend components have forced column breaks then the actual number of columns in the rendered
legend may be larger than this value.

.. seealso:: :py:func:`setColumnCount`
%End

void setColumnCount( int c );
%Docstring
Sets the desired minimum number of columns to show in the legend.

If legend components have forced column breaks then the actual number of columns in the rendered
legend may be larger than this value.

.. seealso:: :py:func:`columnCount`
%End

bool splitLayer() const;
%Docstring
Returns ``True`` if layer components can be split over multiple columns.

.. seealso:: :py:func:`setSplitLayer`
%End

void setSplitLayer( bool s );
%Docstring
Sets whether layer components can be split over multiple columns.

.. seealso:: :py:func:`splitLayer`
%End

bool equalColumnWidth() const;
%Docstring
Returns ``True`` if all columns should have equal widths.

If ``False`` is returned then columns will be individually resized to their minimum possible width.

.. seealso:: :py:func:`setEqualColumnWidth`
%End

void setEqualColumnWidth( bool s );
%Docstring
Sets whether all columns should have equal widths.

If ``False``, then then columns will be individually resized to their minimum possible width.

.. seealso:: :py:func:`equalColumnWidth`
%End

QColor fontColor() const;
%Docstring
Returns the font color used for legend items.

.. seealso:: :py:func:`setFontColor`
%End

void setFontColor( const QColor &c );
%Docstring
Sets the font color used for legend items.

.. seealso:: :py:func:`fontColor`
%End

QColor layerFontColor() const;
%Docstring
@@ -144,9 +209,19 @@ Overrides fontColor()
.. versionadded:: 3.4.7
%End


QSizeF symbolSize() const;
%Docstring
Returns the default symbol size (in millimeters) used for legend items.

.. seealso:: :py:func:`setSymbolSize`
%End

void setSymbolSize( QSizeF s );
%Docstring
Sets the default symbol size (in millimeters) used for legend items.

.. seealso:: :py:func:`symbolSize`
%End

void setSymbolAlignment( Qt::AlignmentFlag alignment );
%Docstring
@@ -259,10 +334,32 @@ only drawn if drawRasterStroke() is ``True``.
%End

QSizeF wmsLegendSize() const;
%Docstring
Returns the size (in millimeters) of WMS legend graphics shown in the legend.

.. seealso:: :py:func:`setWmsLegendSize`
%End

void setWmsLegendSize( QSizeF s );
%Docstring
Sets the desired size (in millimeters) of WMS legend graphics shown in the legend.

.. seealso:: :py:func:`wmsLegendSize`
%End

double lineSpacing() const;
%Docstring
Returns the line spacing to use between lines of legend text.

.. seealso:: :py:func:`setLineSpacing`
%End

void setLineSpacing( double s );
%Docstring
Sets the line spacing to use between lines of legend text.

.. seealso:: :py:func:`lineSpacing`
%End

double mmPerMapUnit() const /Deprecated/;
%Docstring

0 comments on commit 0aa1eb0

Please sign in to comment.
You can’t perform that action at this time.