Skip to content

Commit 83065a4

Browse files
committed
Merge branch 'master' of github.com:qgis/QGIS into scale_lock_button
2 parents 8bee898 + dc334ac commit 83065a4

File tree

56 files changed

+1081
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1081
-192
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ qgis.kdev4
5252
qgis.supp
5353
qgis-test.ctest
5454
qtcreator-build/
55+
resources/themes/*/style.qss.auto
5556
scripts/astyle.exe
5657
scripts/Debug
5758
scripts/qgisstyle*

python/gui/auto_generated/qgsexpressionbuilderwidget.sip.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ preview result and for populating the list of available functions and variables.
198198
void registerItem( const QString &group, const QString &label, const QString &expressionText,
199199
const QString &helpText = QString(),
200200
QgsExpressionItem::ItemType type = QgsExpressionItem::ExpressionNode,
201-
bool highlightedItem = false, int sortOrder = 1 );
201+
bool highlightedItem = false, int sortOrder = 1,
202+
QIcon icon = QIcon() );
202203
%Docstring
203204
Registers a node item for the expression builder.
204205

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

214216
bool isExpressionValid();

python/gui/auto_generated/qgsgui.sip.in

+18
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ Sets the global window ``manager``. Ownership is transferred to the QgsGui insta
9797

9898
.. seealso:: :py:func:`windowManager`
9999

100+
.. versionadded:: 3.4
101+
%End
102+
103+
enum HigFlag
104+
{
105+
HigMenuTextIsTitleCase,
106+
HigDialogTitleIsTitleCase
107+
};
108+
typedef QFlags<QgsGui::HigFlag> HigFlags;
109+
110+
111+
static QgsGui::HigFlags higFlags();
112+
%Docstring
113+
Returns HIG flags. Currently indicates whether titles should be title case depending on the current locale.
114+
100115
.. versionadded:: 3.4
101116
%End
102117

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

124+
QFlags<QgsGui::HigFlag> operator|(QgsGui::HigFlag f1, QFlags<QgsGui::HigFlag> f2);
125+
126+
109127
/************************************************************************
110128
* This file has been generated automatically from *
111129
* *

python/gui/auto_generated/qgsmessagebaritem.sip.in

+11
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ returns the duration in second of the message
8282
QString getStyleSheet();
8383
%Docstring
8484
returns the styleSheet
85+
%End
86+
87+
public slots:
88+
89+
void dismiss();
90+
%Docstring
91+
Dismisses the item, removing it from the message bar and deleting
92+
it. Calling this on items which have not been added to a message bar
93+
has no effect.
94+
95+
.. versionadded:: 3.4
8596
%End
8697

8798
signals:

python/plugins/db_manager/dlg_sql_layer_window.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,8 @@ def __init__(self, iface, layer, parent=None):
177177
item.setCheckState(Qt.Checked)
178178
else:
179179
keyColumn = uri.keyColumn()
180-
for item in self.uniqueModel.findItems("*", Qt.MatchWildcard):
181-
if item.data() == keyColumn:
182-
self.uniqueCombo.setCurrentIndex(self.uniqueModel.indexFromItem(item).row())
180+
if self.uniqueModel.findItems(keyColumn):
181+
self.uniqueCombo.setEditText(keyColumn)
183182

184183
# Finally layer name, filter and selectAtId
185184
self.layerNameEdit.setText(layer.name())

python/plugins/processing/algs/gdal/ogr2ogr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
8282

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

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

8888
arguments = []

python/plugins/processing/gui/menus.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from processing.gui.AlgorithmDialog import AlgorithmDialog
3434
from qgis.utils import iface
3535
from qgis.core import QgsApplication, QgsMessageLog, QgsStringUtils, QgsProcessingAlgorithm
36+
from qgis.gui import QgsGui
3637
from processing.gui.MessageBarProgress import MessageBarProgress
3738
from processing.gui.AlgorithmExecutor import execute
3839
from processing.gui.Postprocessing import handleAlgorithmResults
@@ -183,10 +184,10 @@ def removeMenus():
183184

184185
def addAlgorithmEntry(alg, menuName, submenuName, actionText=None, icon=None, addButton=False):
185186
if actionText is None:
186-
if alg.flags() & QgsProcessingAlgorithm.FlagDisplayNameIsLiteral:
187-
alg_title = alg.displayName()
188-
else:
187+
if (QgsGui.higFlags() & QgsGui.HigMenuTextIsTitleCase) and not (alg.flags() & QgsProcessingAlgorithm.FlagDisplayNameIsLiteral):
189188
alg_title = QgsStringUtils.capitalize(alg.displayName(), QgsStringUtils.TitleCase)
189+
else:
190+
alg_title = alg.displayName()
190191
actionText = alg_title + QCoreApplication.translate('Processing', '…')
191192
action = QAction(icon or alg.icon(), actionText, iface.mainWindow())
192193
alg_id = alg.id()

python/plugins/processing/tests/GdalAlgorithmsTest.py

+7
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,13 @@ def testOgr2Ogr(self):
14581458
'-f "LIBKML" "' + outdir + '/my out/check.kml" ' +
14591459
source + ' polys2'])
14601460

1461+
self.assertEqual(
1462+
alg.getConsoleCommands({'INPUT': source,
1463+
'OUTPUT': outdir + '/check.gpkg'}, context, feedback),
1464+
['ogr2ogr',
1465+
'-f "GPKG" ' + outdir + '/check.gpkg ' +
1466+
source + ' polys2'])
1467+
14611468
def testOgr2PostGis(self):
14621469
context = QgsProcessingContext()
14631470
feedback = QgsProcessingFeedback()

python/utils.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ def startPlugin(packageName):
328328

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

331-
start = time.clock()
331+
start = time.process_time()
332+
332333
# create an instance of the plugin
333334
try:
334335
plugins[packageName] = package.classFactory(iface)
@@ -350,7 +351,7 @@ def startPlugin(packageName):
350351

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

356357
return True

resources/function_help/json/make_circle

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"description": "Creates a circular polygon.",
55
"variableLenArguments": true,
66
"arguments": [
7-
{"arg":"center", "description": "center point of the circle"},
8-
{"arg":"radius", "description": "radius of the circle"},
9-
{"arg":"segment", "description": "optional argument for polygon segmentation. By default this value is 36"}],
10-
"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))'"},
7+
{"arg":"center", "description": "center point of the circle"},
8+
{"arg":"radius", "description": "radius of the circle"},
9+
{"arg":"segment", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}
10+
],
11+
"examples": [
12+
{ "expression":"geom_to_wkt(make_circle(make_point(10,10), 5, 4))", "returns":"'Polygon ((10 15, 15 10, 10 5, 5 10, 10 15))'"},
1113
{ "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))'"},
1214
{ "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))'"}
13-
]
15+
]
1416
}

resources/function_help/json/make_ellipse

+9-7
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
"description": "Creates an elliptical polygon.",
55
"variableLenArguments": true,
66
"arguments": [
7-
{"arg":"center", "description": "center point of the ellipse"},
8-
{"arg":"semi_major_axis", "description": "semi-major axis of the ellipse"},
9-
{"arg":"semi_minor_axis", "description": "semi-minor axis of the ellipse"},
10-
{"arg":"azimuth", "description": "orientation of the ellipse"},
11-
{"arg":"segment", "description": "optional argument for polygon segmentation. By default this value is 36"}],
12-
"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))'"},
7+
{"arg":"center", "description": "center point of the ellipse"},
8+
{"arg":"semi_major_axis", "description": "semi-major axis of the ellipse"},
9+
{"arg":"semi_minor_axis", "description": "semi-minor axis of the ellipse"},
10+
{"arg":"azimuth", "description": "orientation of the ellipse"},
11+
{"arg":"segment", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}
12+
],
13+
"examples": [
14+
{ "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))'"},
1315
{ "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))'"},
1416
{ "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))'"}
15-
]
17+
]
1618
}

resources/function_help/json/make_point

+8-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
"type": "function",
44
"description": "Creates a point geometry from an x and y (and optional z and m) value.",
55
"arguments": [
6-
{"arg":"x","description":"x coordinate of point"},
7-
{"arg":"y","description":"y coordinate of point"},
8-
{"arg":"z","description":"optional z coordinate of point"},
9-
{"arg":"m","description":"optional m value of point"} ],
10-
"examples": [ { "expression":"geom_to_wkt(make_point(2,4))", "returns":"'Point (2 4)'"},
6+
{"arg":"x","description":"x coordinate of point"},
7+
{"arg":"y","description":"y coordinate of point"},
8+
{"arg":"z", "optional": true, "description":"optional z coordinate of point"},
9+
{"arg":"m", "optional": true, "description":"optional m value of point"}
10+
],
11+
"examples": [
12+
{ "expression":"geom_to_wkt(make_point(2,4))", "returns":"'Point (2 4)'"},
1113
{ "expression":"geom_to_wkt(make_point(2,4,6))", "returns":"'PointZ (2 4 6)'"},
1214
{ "expression":"geom_to_wkt(make_point(2,4,6,8))", "returns":"'PointZM (2 4 6 8)'"}
13-
]
15+
]
1416
}

resources/function_help/json/make_regular_polygon

+8-6
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"description": "Creates a regular polygon.",
55
"variableLenArguments": true,
66
"arguments": [
7-
{"arg":"center", "description": "center of the regular polygon"},
8-
{"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."},
9-
{"arg":"number_sides", "description": "Number of sides/edges of the regular polygon"},
10-
{"arg":"circle", "description": "Optional argument to construct the regular polygon. By default this value is 0. Value can be 0 (inscribed) or 1 (circumscribed)"}],
11-
"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))'"},
7+
{"arg":"center", "description": "center of the regular polygon"},
8+
{"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."},
9+
{"arg":"number_sides", "description": "Number of sides/edges of the regular polygon"},
10+
{"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)"}
11+
],
12+
"examples": [
13+
{ "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))'"},
1214
{ "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))'"}
13-
]
15+
]
1416
}

resources/function_help/json/minimal_circle

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
"name": "minimal_circle",
33
"type": "function",
44
"description": "Returns the minimal enclosing circle of a geometry. It represents the minimum circle that encloses all geometries within the set.",
5-
"arguments": [ {"arg":"geometry","description":"a geometry"},
6-
{"arg":"segment", "description": "optional argument for polygon segmentation. By default this value is 36"}],
7-
"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))"},
8-
{ "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))"}
5+
"arguments": [
6+
{"arg":"geometry","description":"a geometry"},
7+
{"arg":"segment", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}],
8+
"examples": [
9+
{ "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))"},
10+
{ "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))"}
911
]
1012
}

resources/function_help/json/nodes_to_points

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
"name": "nodes_to_points",
33
"type": "function",
44
"description": "Returns a multipoint geometry consisting of every node in the input geometry.",
5-
"arguments": [ {"arg":"geometry","description":"geometry object"},
6-
{"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."} ],
7-
"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))'"},
8-
{ "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))'"}]
5+
"arguments": [
6+
{"arg":"geometry","description":"geometry object"},
7+
{"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."}
8+
],
9+
"examples": [
10+
{ "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))'"},
11+
{ "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))'"}
12+
]
913
}

resources/function_help/json/wordwrap

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
"name": "wordwrap",
33
"type": "function",
44
"description": "Returns a string wrapped to a maximum/minimum number of characters.",
5-
"arguments": [ {"arg":"string","description":"the string to be wrapped"},
6-
{"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."},
7-
{"arg":"delimiter_string","description":"the delimiter string to wrap to a new line (optional)."}
8-
],
9-
"examples": [ { "expression":"wordwrap('UNIVERSITY OF QGIS',13)", "returns":"'UNIVERSITY OF<br>QGIS'"},
10-
{ "expression":"wordwrap('UNIVERSITY OF QGIS',-3)", "returns":"'UNIVERSITY<br>OF QGIS'"} ]
5+
"arguments": [
6+
{"arg":"string","description":"the string to be wrapped"},
7+
{"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."},
8+
{"arg":"delimiter_string","optional": true, "description":"Optional delimiter string to wrap to a new line."}
9+
],
10+
"examples": [
11+
{ "expression":"wordwrap('UNIVERSITY OF QGIS',13)", "returns":"'UNIVERSITY OF<br>QGIS'"},
12+
{ "expression":"wordwrap('UNIVERSITY OF QGIS',-3)", "returns":"'UNIVERSITY<br>OF QGIS'"}
13+
]
1114
}

0 commit comments

Comments
 (0)