Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:qgis/QGIS into scale_lock_button

  • Loading branch information
borysiasty committed Oct 25, 2018
2 parents 8bee898 + dc334ac commit 83065a466d693964eee4786d62a1911a675365c9
Showing with 1,081 additions and 192 deletions.
  1. +1 −0 .gitignore
  2. +3 −1 python/gui/auto_generated/qgsexpressionbuilderwidget.sip.in
  3. +18 −0 python/gui/auto_generated/qgsgui.sip.in
  4. +11 −0 python/gui/auto_generated/qgsmessagebaritem.sip.in
  5. +2 −3 python/plugins/db_manager/dlg_sql_layer_window.py
  6. +1 −1 python/plugins/processing/algs/gdal/ogr2ogr.py
  7. +4 −3 python/plugins/processing/gui/menus.py
  8. +7 −0 python/plugins/processing/tests/GdalAlgorithmsTest.py
  9. +3 −2 python/utils.py
  10. +7 −5 resources/function_help/json/make_circle
  11. +9 −7 resources/function_help/json/make_ellipse
  12. +8 −6 resources/function_help/json/make_point
  13. +8 −6 resources/function_help/json/make_regular_polygon
  14. +6 −4 resources/function_help/json/minimal_circle
  15. +8 −4 resources/function_help/json/nodes_to_points
  16. +9 −6 resources/function_help/json/wordwrap
  17. +41 −14 src/app/qgisapp.cpp
  18. +6 −46 src/app/qgisappstylesheet.cpp
  19. +4 −22 src/app/qgisappstylesheet.h
  20. +2 −2 src/app/qgsoptions.cpp
  21. +51 −8 src/core/mesh/qgsmeshvectorrenderer.cpp
  22. +8 −0 src/core/mesh/qgsmeshvectorrenderer.h
  23. +92 −11 src/core/qgsofflineediting.cpp
  24. +1 −0 src/core/qgsvectorlayer.cpp
  25. +6 −0 src/gui/editorwidgets/qgsdoublespinbox.cpp
  26. +6 −0 src/gui/editorwidgets/qgsspinbox.cpp
  27. +45 −0 src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp
  28. +3 −0 src/gui/editorwidgets/qgsvaluemapconfigdlg.h
  29. +1 −1 src/gui/locator/qgslocatorwidget.cpp
  30. +7 −3 src/gui/processing/qgsprocessingalgorithmdialogbase.cpp
  31. +7 −4 src/gui/qgsexpressionbuilderwidget.cpp
  32. +3 −1 src/gui/qgsexpressionbuilderwidget.h
  33. +14 −0 src/gui/qgsgui.cpp
  34. +19 −0 src/gui/qgsgui.h
  35. +3 −0 src/gui/qgsmessagebar.cpp
  36. +22 −13 src/gui/qgsmessagebaritem.cpp
  37. +15 −0 src/gui/qgsmessagebaritem.h
  38. +2 −0 src/native/mac/qgsmacnative.h
  39. +5 −0 src/native/mac/qgsmacnative.mm
  40. +6 −0 src/native/qgsnative.h
  41. +16 −6 src/providers/arcgisrest/qgsarcgisrestutils.cpp
  42. +9 −0 src/providers/gdal/qgsgdalprovider.cpp
  43. +2 −0 src/providers/gdal/qgsgdalprovider.h
  44. +1 −0 tests/src/core/testqgsofflineediting.cpp
  45. +1 −0 tests/src/gui/CMakeLists.txt
  46. +86 −0 tests/src/gui/testqgsmessagebar.cpp
  47. +86 −0 tests/src/python/test_provider_afs.py
  48. +11 −0 tests/src/python/test_qgsmaplayer.py
  49. +6 −3 tests/src/python/test_qgsserver_wms.py
  50. +109 −10 tests/src/python/test_qgsserver_wms_getfeatureinfo.py
  51. BIN ...iangle_face_vector_user_grid_dataset/expected_quad_and_triangle_face_vector_user_grid_dataset.png
  52. BIN ...le_vertex_vector_user_grid_dataset/expected_quad_and_triangle_vertex_vector_user_grid_dataset.png
  53. BIN tests/testdata/qgis_server/db.gpkg
  54. +13 −0 tests/testdata/qgis_server/get_postgres_types_json_dict.txt
  55. +13 −0 tests/testdata/qgis_server/get_postgres_types_json_list.txt
  56. +254 −0 tests/testdata/qgis_server/test_project_postgres_types.qgs
@@ -52,6 +52,7 @@ qgis.kdev4
qgis.supp
qgis-test.ctest
qtcreator-build/
resources/themes/*/style.qss.auto
scripts/astyle.exe
scripts/Debug
scripts/qgisstyle*
@@ -198,7 +198,8 @@ preview result and for populating the list of available functions and variables.
void registerItem( const QString &group, const QString &label, const QString &expressionText,
const QString &helpText = QString(),
QgsExpressionItem::ItemType type = QgsExpressionItem::ExpressionNode,
bool highlightedItem = false, int sortOrder = 1 );
bool highlightedItem = false, int sortOrder = 1,
QIcon icon = QIcon() );
%Docstring
Registers a node item for the expression builder.

@@ -209,6 +210,7 @@ Registers a node item for the expression builder.
:param type: The type of the expression item.
:param highlightedItem: set to true to make the item highlighted, which inserts a bold copy of the item at the top level
:param sortOrder: sort ranking for item
:param icon: custom icon to show for item
%End

bool isExpressionValid();
@@ -97,6 +97,21 @@ Sets the global window ``manager``. Ownership is transferred to the QgsGui insta

.. seealso:: :py:func:`windowManager`

.. versionadded:: 3.4
%End

enum HigFlag
{
HigMenuTextIsTitleCase,
HigDialogTitleIsTitleCase
};
typedef QFlags<QgsGui::HigFlag> HigFlags;


static QgsGui::HigFlags higFlags();
%Docstring
Returns HIG flags. Currently indicates whether titles should be title case depending on the current locale.

.. versionadded:: 3.4
%End

@@ -106,6 +121,9 @@ Sets the global window ``manager``. Ownership is transferred to the QgsGui insta
QgsGui( const QgsGui &other );
};

QFlags<QgsGui::HigFlag> operator|(QgsGui::HigFlag f1, QFlags<QgsGui::HigFlag> f2);


/************************************************************************
* This file has been generated automatically from *
* *
@@ -82,6 +82,17 @@ returns the duration in second of the message
QString getStyleSheet();
%Docstring
returns the styleSheet
%End

public slots:

void dismiss();
%Docstring
Dismisses the item, removing it from the message bar and deleting
it. Calling this on items which have not been added to a message bar
has no effect.

.. versionadded:: 3.4
%End

signals:
@@ -177,9 +177,8 @@ def __init__(self, iface, layer, parent=None):
item.setCheckState(Qt.Checked)
else:
keyColumn = uri.keyColumn()
for item in self.uniqueModel.findItems("*", Qt.MatchWildcard):
if item.data() == keyColumn:
self.uniqueCombo.setCurrentIndex(self.uniqueModel.indexFromItem(item).row())
if self.uniqueModel.findItems(keyColumn):
self.uniqueCombo.setEditText(keyColumn)

# Finally layer name, filter and selectAtId
self.layerNameEdit.setText(layer.name())
@@ -82,7 +82,7 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):

output, outputFormat = GdalUtils.ogrConnectionStringAndFormat(outFile, context)

if outputFormat == 'SQLite' and os.path.isfile(output):
if outputFormat in ('SQLite', 'GPKG') and os.path.isfile(output):
raise QgsProcessingException(self.tr('Output file "{}" already exists.'.format(output)))

arguments = []
@@ -33,6 +33,7 @@
from processing.gui.AlgorithmDialog import AlgorithmDialog
from qgis.utils import iface
from qgis.core import QgsApplication, QgsMessageLog, QgsStringUtils, QgsProcessingAlgorithm
from qgis.gui import QgsGui
from processing.gui.MessageBarProgress import MessageBarProgress
from processing.gui.AlgorithmExecutor import execute
from processing.gui.Postprocessing import handleAlgorithmResults
@@ -183,10 +184,10 @@ def removeMenus():

def addAlgorithmEntry(alg, menuName, submenuName, actionText=None, icon=None, addButton=False):
if actionText is None:
if alg.flags() & QgsProcessingAlgorithm.FlagDisplayNameIsLiteral:
alg_title = alg.displayName()
else:
if (QgsGui.higFlags() & QgsGui.HigMenuTextIsTitleCase) and not (alg.flags() & QgsProcessingAlgorithm.FlagDisplayNameIsLiteral):
alg_title = QgsStringUtils.capitalize(alg.displayName(), QgsStringUtils.TitleCase)
else:
alg_title = alg.displayName()
actionText = alg_title + QCoreApplication.translate('Processing', '…')
action = QAction(icon or alg.icon(), actionText, iface.mainWindow())
alg_id = alg.id()
@@ -1458,6 +1458,13 @@ def testOgr2Ogr(self):
'-f "LIBKML" "' + outdir + '/my out/check.kml" ' +
source + ' polys2'])

self.assertEqual(
alg.getConsoleCommands({'INPUT': source,
'OUTPUT': outdir + '/check.gpkg'}, context, feedback),
['ogr2ogr',
'-f "GPKG" ' + outdir + '/check.gpkg ' +
source + ' polys2'])

def testOgr2PostGis(self):
context = QgsProcessingContext()
feedback = QgsProcessingFeedback()
@@ -328,7 +328,8 @@ def startPlugin(packageName):

errMsg = QCoreApplication.translate("Python", "Couldn't load plugin '{0}'").format(packageName)

start = time.clock()
start = time.process_time()

# create an instance of the plugin
try:
plugins[packageName] = package.classFactory(iface)
@@ -350,7 +351,7 @@ def startPlugin(packageName):

# add to active plugins
active_plugins.append(packageName)
end = time.clock()
end = time.process_time()
plugin_times[packageName] = "{0:02f}s".format(end - start)

return True
@@ -4,11 +4,13 @@
"description": "Creates a circular polygon.",
"variableLenArguments": true,
"arguments": [
{"arg":"center", "description": "center point of the circle"},
{"arg":"radius", "description": "radius of the circle"},
{"arg":"segment", "description": "optional argument for polygon segmentation. By default this value is 36"}],
"examples": [ { "expression":"geom_to_wkt(make_circle(make_point(10,10), 5, 4))", "returns":"'Polygon ((10 15, 15 10, 10 5, 5 10, 10 15))'"},
{"arg":"center", "description": "center point of the circle"},
{"arg":"radius", "description": "radius of the circle"},
{"arg":"segment", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}
],
"examples": [
{ "expression":"geom_to_wkt(make_circle(make_point(10,10), 5, 4))", "returns":"'Polygon ((10 15, 15 10, 10 5, 5 10, 10 15))'"},
{ "expression":"geom_to_wkt(make_circle(make_point(10,10,5), 5, 4))", "returns":"'PolygonZ ((10 15 5, 15 10 5, 10 5 5, 5 10 5, 10 15 5))'"},
{ "expression":"geom_to_wkt(make_circle(make_point(10,10,5,30), 5, 4))", "returns":"'PolygonZM ((10 15 5 30, 15 10 5 30, 10 5 5 30, 5 10 5 30, 10 15 5 30))'"}
]
]
}
@@ -4,13 +4,15 @@
"description": "Creates an elliptical polygon.",
"variableLenArguments": true,
"arguments": [
{"arg":"center", "description": "center point of the ellipse"},
{"arg":"semi_major_axis", "description": "semi-major axis of the ellipse"},
{"arg":"semi_minor_axis", "description": "semi-minor axis of the ellipse"},
{"arg":"azimuth", "description": "orientation of the ellipse"},
{"arg":"segment", "description": "optional argument for polygon segmentation. By default this value is 36"}],
"examples": [ { "expression":"geom_to_wkt(make_ellipse(make_point(10,10), 5, 2, 90, 4))", "returns":"'Polygon ((15 10, 10 8, 5 10, 10 12, 15 10))'"},
{"arg":"center", "description": "center point of the ellipse"},
{"arg":"semi_major_axis", "description": "semi-major axis of the ellipse"},
{"arg":"semi_minor_axis", "description": "semi-minor axis of the ellipse"},
{"arg":"azimuth", "description": "orientation of the ellipse"},
{"arg":"segment", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}
],
"examples": [
{ "expression":"geom_to_wkt(make_ellipse(make_point(10,10), 5, 2, 90, 4))", "returns":"'Polygon ((15 10, 10 8, 5 10, 10 12, 15 10))'"},
{ "expression":"geom_to_wkt(make_ellipse(make_point(10,10,5), 5, 2, 90, 4))", "returns":"'PolygonZ ((15 10 5, 10 8 5, 5 10 5, 10 12 5, 15 10 5))'"},
{ "expression":"geom_to_wkt(make_ellipse(make_point(10,10,5,30), 5, 2, 90, 4))", "returns":"'PolygonZM ((15 10 5 30, 10 8 5 30, 5 10 5 30, 10 12 5 30, 15 10 5 30))'"}
]
]
}
@@ -3,12 +3,14 @@
"type": "function",
"description": "Creates a point geometry from an x and y (and optional z and m) value.",
"arguments": [
{"arg":"x","description":"x coordinate of point"},
{"arg":"y","description":"y coordinate of point"},
{"arg":"z","description":"optional z coordinate of point"},
{"arg":"m","description":"optional m value of point"} ],
"examples": [ { "expression":"geom_to_wkt(make_point(2,4))", "returns":"'Point (2 4)'"},
{"arg":"x","description":"x coordinate of point"},
{"arg":"y","description":"y coordinate of point"},
{"arg":"z", "optional": true, "description":"optional z coordinate of point"},
{"arg":"m", "optional": true, "description":"optional m value of point"}
],
"examples": [
{ "expression":"geom_to_wkt(make_point(2,4))", "returns":"'Point (2 4)'"},
{ "expression":"geom_to_wkt(make_point(2,4,6))", "returns":"'PointZ (2 4 6)'"},
{ "expression":"geom_to_wkt(make_point(2,4,6,8))", "returns":"'PointZM (2 4 6 8)'"}
]
]
}
@@ -4,11 +4,13 @@
"description": "Creates a regular polygon.",
"variableLenArguments": true,
"arguments": [
{"arg":"center", "description": "center of the regular polygon"},
{"arg":"radius", "description": "second point. The first if the regular polygon is inscribed. The midpoint of the first side if the regular polygon is circumscribed."},
{"arg":"number_sides", "description": "Number of sides/edges of the regular polygon"},
{"arg":"circle", "description": "Optional argument to construct the regular polygon. By default this value is 0. Value can be 0 (inscribed) or 1 (circumscribed)"}],
"examples": [ { "expression":"geom_to_wkt(make_regular_polygon(make_point(0,0), make_point(0,5), 5))", "returns":"'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'"},
{"arg":"center", "description": "center of the regular polygon"},
{"arg":"radius", "description": "second point. The first if the regular polygon is inscribed. The midpoint of the first side if the regular polygon is circumscribed."},
{"arg":"number_sides", "description": "Number of sides/edges of the regular polygon"},
{"arg":"circle", "optional": true, "default": "0", "description": "Optional argument to construct the regular polygon. By default this value is 0. Value can be 0 (inscribed) or 1 (circumscribed)"}
],
"examples": [
{ "expression":"geom_to_wkt(make_regular_polygon(make_point(0,0), make_point(0,5), 5))", "returns":"'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'"},
{ "expression":"geom_to_wkt(make_regular_polygon(make_point(0,0), project(make_point(0,0), 4.0451, radians(36)), 5))", "returns":"'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'"}
]
]
}
@@ -2,9 +2,11 @@
"name": "minimal_circle",
"type": "function",
"description": "Returns the minimal enclosing circle of a geometry. It represents the minimum circle that encloses all geometries within the set.",
"arguments": [ {"arg":"geometry","description":"a geometry"},
{"arg":"segment", "description": "optional argument for polygon segmentation. By default this value is 36"}],
"examples": [ { "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'LINESTRING(0 5, 0 -5, 2 1)' ), 4 ) )", "returns":"Polygon ((0 5, 5 -0, -0 -5, -5 0, 0 5))"},
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ), 4 ) )", "returns":"Polygon ((3 4, 3 2, 1 2, 1 4, 3 4))"}
"arguments": [
{"arg":"geometry","description":"a geometry"},
{"arg":"segment", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}],
"examples": [
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'LINESTRING(0 5, 0 -5, 2 1)' ), 4 ) )", "returns":"Polygon ((0 5, 5 -0, -0 -5, -5 0, 0 5))"},
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ), 4 ) )", "returns":"Polygon ((3 4, 3 2, 1 2, 1 4, 3 4))"}
]
}
@@ -2,8 +2,12 @@
"name": "nodes_to_points",
"type": "function",
"description": "Returns a multipoint geometry consisting of every node in the input geometry.",
"arguments": [ {"arg":"geometry","description":"geometry object"},
{"arg":"ignore_closing_nodes","description":"optional argument specifying whether to include duplicate nodes which close lines or polygons rings. Defaults to false, set to true to avoid including these duplicate nodes in the output collection."} ],
"examples": [ { "expression":"geom_to_wkt(nodes_to_points(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))", "returns":"'MultiPoint ((0 0),(1 1),(2 2))'"},
{ "expression":"geom_to_wkt(nodes_to_points(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))'),true))", "returns":"'MultiPoint ((-1 -1),(4 0),(4 2),(0 2))'"}]
"arguments": [
{"arg":"geometry","description":"geometry object"},
{"arg":"ignore_closing_nodes", "optional": true, "default": "false", "description":"optional argument specifying whether to include duplicate nodes which close lines or polygons rings. Defaults to false, set to true to avoid including these duplicate nodes in the output collection."}
],
"examples": [
{ "expression":"geom_to_wkt(nodes_to_points(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))", "returns":"'MultiPoint ((0 0),(1 1),(2 2))'"},
{ "expression":"geom_to_wkt(nodes_to_points(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))'),true))", "returns":"'MultiPoint ((-1 -1),(4 0),(4 2),(0 2))'"}
]
}
@@ -2,10 +2,13 @@
"name": "wordwrap",
"type": "function",
"description": "Returns a string wrapped to a maximum/minimum number of characters.",
"arguments": [ {"arg":"string","description":"the string to be wrapped"},
{"arg":"wrap_length","description":"an integer. If wrap_length is positive the number represents the ideal maximum number of characters to wrap; if negative, the number represents the minimum number of characters to wrap."},
{"arg":"delimiter_string","description":"the delimiter string to wrap to a new line (optional)."}
],
"examples": [ { "expression":"wordwrap('UNIVERSITY OF QGIS',13)", "returns":"'UNIVERSITY OF<br>QGIS'"},
{ "expression":"wordwrap('UNIVERSITY OF QGIS',-3)", "returns":"'UNIVERSITY<br>OF QGIS'"} ]
"arguments": [
{"arg":"string","description":"the string to be wrapped"},
{"arg":"wrap_length","description":"an integer. If wrap_length is positive the number represents the ideal maximum number of characters to wrap; if negative, the number represents the minimum number of characters to wrap."},
{"arg":"delimiter_string","optional": true, "description":"Optional delimiter string to wrap to a new line."}
],
"examples": [
{ "expression":"wordwrap('UNIVERSITY OF QGIS',13)", "returns":"'UNIVERSITY OF<br>QGIS'"},
{ "expression":"wordwrap('UNIVERSITY OF QGIS',-3)", "returns":"'UNIVERSITY<br>OF QGIS'"}
]
}

0 comments on commit 83065a4

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