Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge from qgis #11

Merged
merged 56 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
878d229
1st fix for broken GetFeatureInfo URLs in REST WMTS layers
ianturton Sep 28, 2020
d97d11f
formatted
ianturton Sep 29, 2020
5f74d6a
Rename geometry_overlay_* functions into overlay_*
DelazJ Oct 4, 2020
a775957
add robustness
ianturton Oct 7, 2020
1bce971
swtich to QStringList
ianturton Oct 7, 2020
d3d88e2
[OGR provider] Remove calls to ResetReading() in changeGeometryValues…
rouault Oct 7, 2020
2f6c33c
Merge branch 'ogrprovider_remove_useless_resetreading' of https://git…
elpaso Oct 8, 2020
505ef99
Skip potential reset reading calls
elpaso Oct 8, 2020
02c168a
mDoNotResetReading -> mAllowResetReading
elpaso Oct 8, 2020
1d5ebe9
Update src/core/providers/ogr/qgsogrfeatureiterator.cpp
elpaso Oct 8, 2020
fd495d0
Skip test on GDAL < 2.3
elpaso Oct 8, 2020
7216045
[layouts] Allow negative values for grid annotation distance
nyalldawson Oct 9, 2020
5ddf9aa
Merge pull request #39257 from elpaso/rouault-ogrprovider_remove_usel…
elpaso Oct 9, 2020
72c8673
Transaction group: keep editing status after save
elpaso Oct 9, 2020
1258afe
Merge pull request #39174 from DelazJ/overlayOnly
m-kuhn Oct 9, 2020
9d06186
fix crashes in QGIS 3D, mostly directly at project load
PeterPetrik Oct 9, 2020
f940ffc
GUI: renaming GPKG layer: allow any character but | (fixes #39288)
rouault Oct 9, 2020
6829e63
[layouts] Fix resizing multiline label items to adjust to the size
nyalldawson Oct 9, 2020
b788aa2
[ui] use a lower size for border in metadata information
slarosa Oct 10, 2020
8eb52c8
Merge pull request #39286 from elpaso/bugfix-gh39282-transaction-grou…
elpaso Oct 10, 2020
0824eff
Merge pull request #39070 from ianturton/issue-39002
elpaso Oct 10, 2020
e0ce602
Merge pull request #39297 from slarosa/stylesheet
slarosa Oct 10, 2020
1c06551
Add scripts/qstringfixup.py and .sh
rouault Oct 10, 2020
a76670e
QStringLiteral -> QLatin1String changes generated by scripts/qstringf…
rouault Oct 10, 2020
66f19ab
[ui] use grid layout for groupbox widgets in digitizing option
slarosa Oct 10, 2020
6de9f60
[ui] stretch last section in filed table widget
slarosa Oct 10, 2020
1ddfbe6
Fix translation for geometry checks
m-kuhn Oct 9, 2020
99dc28e
Readd q_gadget
m-kuhn Oct 10, 2020
bd60cf1
Remove include
m-kuhn Oct 10, 2020
18bfe1f
Try to make PROJ >= 6 related tests more robust to output from differ…
rouault Oct 9, 2020
e29f17c
Use edge color for tab indentation guide in code editors
nyalldawson Oct 11, 2020
5e4707f
Enable -DQT_USE_QSTRINGBUILDER and fix related build errors
rouault Oct 11, 2020
e4fa6cb
qgspostgresprovider.cpp: use classic initialization
rouault Oct 11, 2020
cce7aa7
[pyqgis-console] restore marker icon for syntax check
slarosa Oct 11, 2020
aaa813a
Split indentation guide color from edge color in code editor settings
nyalldawson Oct 11, 2020
5c8013d
[console] Fix exception when running scripts (followup cce7aa7)
nyalldawson Oct 12, 2020
1d2bb41
Lazy construct expression context for memory provider feature sources
nyalldawson Oct 11, 2020
c2831cc
Don't crash on transaction save
elpaso Oct 9, 2020
ea90774
flake8
elpaso Oct 9, 2020
9b99ecb
OGR decodeUri: be tolerant on layerName case
elpaso Oct 12, 2020
498bbbb
Merge pull request #39283 from elpaso/bugfix-gh39265-transactions-cra…
elpaso Oct 12, 2020
afd474b
Merge pull request #39328 from elpaso/bugfix-unreported-ogr-gpkg-laye…
elpaso Oct 12, 2020
00ccfc8
GDAL provider: don't crash on invalid bands
elpaso Oct 12, 2020
dbe2a3b
Add note about Python bindings in QgsAction
Gustry Oct 12, 2020
5aba56c
fix 3d mesh dataset rendering
vcloarec Oct 12, 2020
364e2e9
fix and improve test
vcloarec Oct 12, 2020
b02d7b3
Add option to apply parameterized colors to SVGs returned by
nyalldawson Oct 12, 2020
0a3f40a
Allow error indicator colors to be controlled for code editor color s…
nyalldawson Oct 12, 2020
56b3494
Spelling
nyalldawson Oct 12, 2020
8298d68
Catch another situation where the user-set custom CRS name needs to b…
nyalldawson Oct 9, 2020
9a35b27
When creating a CRS from WKT and the WKT has an embedded CRS name, co…
nyalldawson Oct 9, 2020
ad3f0a8
Make test WKT comparison more tolerant
nyalldawson Oct 12, 2020
1ac5941
Cleanup handling of margins in QgsCodeEditor and subclasses
nyalldawson Oct 13, 2020
88726e9
Javascript code editor should show line numbers
nyalldawson Oct 13, 2020
66226f6
Use proper method to show line numbers in Virtual Layers SQL editor
nyalldawson Oct 13, 2020
8d3e028
Cleanup raw margin manipulation used to hide holding controls, use pr…
nyalldawson Oct 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ ADD_DEFINITIONS(-DQT_DEPRECATED_WARNINGS)
# Unfortunately Qwt uses deprecated QString::null in headers, preventing this being raised above 5.8
ADD_DEFINITIONS(-DQT_DISABLE_DEPRECATED_BEFORE=0x050800)

# For fast string concatenation
ADD_DEFINITIONS(-DQT_USE_QSTRINGBUILDER)

IF (WITH_GEOREFERENCER)
FIND_PACKAGE(GSL REQUIRED)
SET(HAVE_GEOREFERENCER TRUE)
Expand Down
1 change: 1 addition & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@
<file>themes/default/mActionLabelAnchorStart.svg</file>
<file>themes/default/transformation.svg</file>
<file>themes/default/mIconCodeEditor.svg</file>
<file>themes/default/console/iconSyntaxErrorConsoleParams.svg</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion python/console/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def _textFindChanged(self):
def onClickGoToLine(self, item, column):
tabEditor = self.tabEditorWidget.currentWidget().newEditor
if item.text(1) == 'syntaxError':
check = tabEditor.syntaxCheck(fromContextMenu=False)
check = tabEditor.syntaxCheck()
if check and not tabEditor.isReadOnly():
self.tabEditorWidget.currentWidget().save()
return
Expand Down
64 changes: 16 additions & 48 deletions python/console/console_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,18 @@ def eventFilter(self, obj, event):

class Editor(QgsCodeEditorPython):

MARKER_NUM = 6

def __init__(self, parent=None):
super().__init__(parent)
self.parent = parent
# recent modification time
self.lastModified = 0
self.opening = ['(', '{', '[', "'", '"']
self.closing = [')', '}', ']', "'", '"']

# List of marker line to be deleted from check syntax
self.bufferMarkerLine = []

self.settings = QgsSettings()

self.markerDefine(QgsApplication.getThemePixmap("console/iconSyntaxErrorConsole.svg"),
self.MARKER_NUM)

self.setMinimumHeight(120)

self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)

# Annotations
self.setAnnotationDisplay(QsciScintilla.ANNOTATION_BOXED)

# Disable command key
ctrl, shift = self.SCMOD_CTRL << 16, self.SCMOD_SHIFT << 16
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('L') + ctrl)
Expand Down Expand Up @@ -160,9 +147,9 @@ def contextMenuEvent(self, e):
QCoreApplication.translate("PythonConsole", "Hide Editor"),
self.hideEditor)
menu.addSeparator() # ------------------------------
syntaxCheck = menu.addAction(QgsApplication.getThemeIcon("console/iconSyntaxErrorConsole.svg"),
QCoreApplication.translate("PythonConsole", "Check Syntax"),
self.syntaxCheck, 'Ctrl+4')
syntaxCheckAction = menu.addAction(QgsApplication.getThemeIcon("console/iconSyntaxErrorConsole.svg"),
QCoreApplication.translate("PythonConsole", "Check Syntax"),
self.syntaxCheck, 'Ctrl+4')
runSelected = menu.addAction(QgsApplication.getThemeIcon("console/mIconRunConsole.svg"), # spellok
QCoreApplication.translate("PythonConsole", "Run Selected"),
self.runSelectedCode, 'Ctrl+E') # spellok
Expand Down Expand Up @@ -218,7 +205,7 @@ def contextMenuEvent(self, e):
menu.addAction(QgsApplication.getThemeIcon("console/iconSettingsConsole.svg"),
QCoreApplication.translate("PythonConsole", "Options…"),
self.parent.pc.openSettings)
syntaxCheck.setEnabled(False)
syntaxCheckAction.setEnabled(False)
pasteAction.setEnabled(False)
pyQGISHelpAction.setEnabled(False)
gist_menu.setEnabled(False)
Expand All @@ -237,7 +224,7 @@ def contextMenuEvent(self, e):
pyQGISHelpAction.setEnabled(True)
if not self.text() == '':
selectAllAction.setEnabled(True)
syntaxCheck.setEnabled(True)
syntaxCheckAction.setEnabled(True)
if self.isUndoAvailable():
undoAction.setEnabled(True)
if self.isRedoAvailable():
Expand Down Expand Up @@ -461,7 +448,7 @@ def runScriptCode(self):
self.parent.pc.callWidgetMessageBarEditor(msgEditorBlank, 0, True)
return

if self.syntaxCheck(fromContextMenu=False):
if self.syntaxCheck():
if filename and self.isModified() and autoSave:
self.parent.save(filename)
elif not filename or self.isModified():
Expand Down Expand Up @@ -495,15 +482,14 @@ def goToLine(self, objName, linenr):
self.ensureLineVisible(linenr)
self.setFocus()

def syntaxCheck(self, filename=None, fromContextMenu=True):
eline = None
ecolumn = 0
edescr = ''
def syntaxCheck(self):
source = self.text()
self.clearWarnings()
try:
filename = self.parent.tw.currentWidget().path
if not filename:
filename = self.parent.tw.currentWidget().path
# source = open(filename, 'r').read() + '\n'
tmpFile = self.createTempFile()
filename = tmpFile
if isinstance(source, type("")):
source = source.encode('utf-8')
if isinstance(filename, type("")):
Expand All @@ -512,34 +498,16 @@ def syntaxCheck(self, filename=None, fromContextMenu=True):
compile(source, filename, 'exec')
except SyntaxError as detail:
eline = detail.lineno and detail.lineno or 1
eline -= 1
ecolumn = detail.offset and detail.offset or 1
edescr = detail.msg
if eline is not None:
eline -= 1
for markerLine in self.bufferMarkerLine:
self.markerDelete(markerLine)
self.clearAnnotations(markerLine)
self.bufferMarkerLine.remove(markerLine)
if (eline) not in self.bufferMarkerLine:
self.bufferMarkerLine.append(eline)
self.markerAdd(eline, self.MARKER_NUM)
loadFont = self.settings.value("pythonConsole/fontfamilytext",
"Monospace")
styleAnn = QsciStyle(-1, "Annotation",
QColor(255, 0, 0),
QColor(255, 200, 0),
QFont(loadFont, 8, -1, True),
True)
self.annotate(eline, edescr, styleAnn)

self.addWarning(eline, edescr)
self.setCursorPosition(eline, ecolumn - 1)
# self.setSelection(eline, ecolumn, eline, self.lineLength(eline)-1)
self.ensureLineVisible(eline)
# self.ensureCursorVisible()
return False
else:
self.markerDeleteAll()
self.clearAnnotations()
return True

return True

def keyPressEvent(self, e):
t = e.text()
Expand Down
8 changes: 5 additions & 3 deletions python/console/console_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,18 @@ def insertInitText(self):
else:
self.setText(txtInit + '\n')

def initializeLexer(self):
super().initializeLexer()
self.setFoldingVisible(False)
self.setEdgeMode(QsciScintilla.EdgeNone)

def refreshSettingsOutput(self):
# Set Python lexer
self.initializeLexer()
self.setReadOnly(True)

self.setCaretWidth(0) # NO (blinking) caret in the output

self.setFoldingVisible(False)
self.setEdgeMode(QsciScintilla.EdgeNone)

def clearConsole(self):
self.setText('')
self.insertInitText()
Expand Down
27 changes: 14 additions & 13 deletions python/console/console_sci.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import traceback

from qgis.core import QgsApplication, QgsSettings, Qgis
from qgis.gui import QgsCodeEditor

from .ui_console_history_dlg import Ui_HistoryDialogPythonConsole

_init_commands = ["import sys", "import os", "import re", "import math", "from qgis.core import *",
Expand Down Expand Up @@ -105,6 +107,18 @@ def __init__(self, parent=None):
self.newShortcutCAS.activated.connect(self.autoComplete)
self.newShortcutCSS.activated.connect(self.showHistory)

def initializeLexer(self):
super().initializeLexer()
self.setCaretLineVisible(False)
self.setLineNumbersVisible(False) # NO linenumbers for the input line
self.setFoldingVisible(False)
# Margin 1 is used for the '>>>' prompt (console input)
self.setMarginLineNumbers(1, True)
self.setMarginWidth(1, "00000")
self.setMarginType(1, 5) # TextMarginRightJustified=5
self.setMarginsBackgroundColor(self.color(QgsCodeEditorColorScheme.ColorRole.Background))
self.setEdgeMode(QsciScintilla.EdgeNone)

def _setMinimumHeight(self):
font = self.lexer().defaultFont(0)
fm = QFontMetrics(font)
Expand All @@ -118,19 +132,6 @@ def refreshSettingsShell(self):
# Sets minimum height for input area based of font metric
self._setMinimumHeight()

self.setCaretLineVisible(False)
self.setMarginLineNumbers(0, False) # NO linenumbers for the input line
self.setMarginWidth(0, 0)
# margin 2 is the folding
self.setMarginWidth(2, 0)
# Margin 1 is used for the '>>>' prompt (console input)
self.setMarginLineNumbers(1, True)
self.setMarginWidth(1, "00000")
self.setMarginType(1, 5) # TextMarginRightJustified=5
self.setMarginsBackgroundColor(self.color(QgsCodeEditorColorScheme.ColorRole.Background))
self.setFoldingVisible(False)
self.setEdgeMode(QsciScintilla.EdgeNone)

def showHistory(self):
if not self.historyDlg.isVisible():
self.historyDlg.show()
Expand Down
8 changes: 4 additions & 4 deletions python/core/auto_generated/diagram/qgsdiagram.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Base class for all diagram types.
public:

%ConvertToSubClassCode
if ( sipCpp->diagramName() == QStringLiteral( "Pie" ) )
if ( sipCpp->diagramName() == QLatin1String( "Pie" ) )
sipType = sipType_QgsPieDiagram;
else if ( sipCpp->diagramName() == QStringLiteral( "Histogram" ) )
else if ( sipCpp->diagramName() == QLatin1String( "Histogram" ) )
sipType = sipType_QgsHistogramDiagram;
else if ( sipCpp->diagramName() == QStringLiteral( "Text" ) )
else if ( sipCpp->diagramName() == QLatin1String( "Text" ) )
sipType = sipType_QgsTextDiagram;
else if ( sipCpp->diagramName() == QStringLiteral( "Stacked" ) )
else if ( sipCpp->diagramName() == QLatin1String( "Stacked" ) )
sipType = sipType_QgsStackedBarDiagram;
else
sipType = NULL;
Expand Down
10 changes: 8 additions & 2 deletions python/core/auto_generated/qgsaction.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Create a new QgsAction
:param description: A human readable description string
:param command: The action text. Its interpretation depends on the type
:param capture: If this is set to ``True``, the output will be captured when an action is run
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode. Not available in Python bindings.
%End

QgsAction( ActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle = QString(), const QSet<QString> &actionScopes = QSet<QString>(), const QString &notificationMessage = QString() );
Expand All @@ -57,7 +57,7 @@ Create a new QgsAction
:param shortTitle: A short string used to label user interface elements like buttons
:param actionScopes: A set of scopes in which this action will be available
:param notificationMessage: A particular message which reception will trigger the action
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode. Not available in Python bindings.
%End

QString name() const;
Expand Down Expand Up @@ -126,6 +126,12 @@ Whether to capture output for display when this action is run
Returns whether only enabled in editable mode
%End

void setEnabledOnlyWhenEditable( bool enable );
%Docstring
Set whether the action is only enabled in editable mode

.. versionadded:: 3.16
%End

bool runable() const;
%Docstring
Expand Down
6 changes: 5 additions & 1 deletion python/core/auto_generated/qgsapplication.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,14 @@ Cursors are automatically scaled to look like a 16px cursor on 96dpi
screens.
%End

static QPixmap getThemePixmap( const QString &name );
static QPixmap getThemePixmap( const QString &name, const QColor &foreColor = QColor(), const QColor &backColor = QColor(), int size = 16 );
%Docstring
Helper to get a theme icon as a pixmap. It will fall back to the
default theme if the active theme does not have the required icon.

If ``foreColor`` or ``backColor`` are specified, then these colors will
be used for parametrized colors in SVG files wherever available. If
colors are specified then the ``size`` argument also must be set.
%End

static QString userStylePath();
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/qgsdiagramrenderer.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,9 @@ Evaluates and returns the diagram settings relating to a diagram for a specific
#include "qgsdiagramrenderer.h"
%End
%ConvertToSubClassCode
if ( sipCpp->rendererName() == QStringLiteral( "SingleCategory" ) )
if ( sipCpp->rendererName() == QLatin1String( "SingleCategory" ) )
sipType = sipType_QgsSingleCategoryDiagramRenderer;
else if ( sipCpp->rendererName() == QStringLiteral( "LinearlyInterpolated" ) )
else if ( sipCpp->rendererName() == QLatin1String( "LinearlyInterpolated" ) )
sipType = sipType_QgsLinearlyInterpolatedDiagramRenderer;
else
sipType = NULL;
Expand Down
20 changes: 10 additions & 10 deletions python/core/auto_generated/symbology/qgsrenderer.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ class QgsFeatureRenderer

const QString type = sipCpp->type();

if ( type == QStringLiteral( "singleSymbol" ) )
if ( type == QLatin1String( "singleSymbol" ) )
sipType = sipType_QgsSingleSymbolRenderer;
else if ( type == QStringLiteral( "categorizedSymbol" ) )
else if ( type == QLatin1String( "categorizedSymbol" ) )
sipType = sipType_QgsCategorizedSymbolRenderer;
else if ( type == QStringLiteral( "graduatedSymbol" ) )
else if ( type == QLatin1String( "graduatedSymbol" ) )
sipType = sipType_QgsGraduatedSymbolRenderer;
else if ( type == QStringLiteral( "RuleRenderer" ) )
else if ( type == QLatin1String( "RuleRenderer" ) )
sipType = sipType_QgsRuleBasedRenderer;
else if ( type == QStringLiteral( "heatmapRenderer" ) )
else if ( type == QLatin1String( "heatmapRenderer" ) )
sipType = sipType_QgsHeatmapRenderer;
else if ( type == QStringLiteral( "invertedPolygonRenderer" ) )
else if ( type == QLatin1String( "invertedPolygonRenderer" ) )
sipType = sipType_QgsInvertedPolygonRenderer;
else if ( type == QStringLiteral( "pointCluster" ) )
else if ( type == QLatin1String( "pointCluster" ) )
sipType = sipType_QgsPointClusterRenderer;
else if ( type == QStringLiteral( "pointDisplacement" ) )
else if ( type == QLatin1String( "pointDisplacement" ) )
sipType = sipType_QgsPointDisplacementRenderer;
else if ( type == QStringLiteral( "25dRenderer" ) )
else if ( type == QLatin1String( "25dRenderer" ) )
sipType = sipType_Qgs25DRenderer;
else if ( type == QStringLiteral( "nullSymbol" ) )
else if ( type == QLatin1String( "nullSymbol" ) )
sipType = sipType_QgsNullSymbolRenderer;
else
sipType = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Base class for labeling configuration classes for vector tile layers.

const QString type = sipCpp->type();

if ( type == QStringLiteral( "basic" ) )
if ( type == QLatin1String( "basic" ) )
sipType = sipType_QgsVectorTileBasicLabeling;
else
sipType = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ For rendering it is expected that client code calls:

const QString type = sipCpp->type();

if ( type == QStringLiteral( "basic" ) )
if ( type == QLatin1String( "basic" ) )
sipType = sipType_QgsVectorTileBasicRenderer;
else
sipType = 0;
Expand Down
Loading