diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-07 10:06:31 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-07 10:06:31 +0200 |
commit | 5ce20bd3efde4e1c44dee6c4af33b184b520b06b (patch) | |
tree | ab2f69dfc9cfda5b1c910a06462339d69d105796 | |
parent | 6a116c6465451e5a58d1467ec926563b68ac677f (diff) | |
parent | 39c6018e484d2a6850d239de03fef89df730f357 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I299a65f15fb6b7eb900256590bbe76ad0568f546
-rw-r--r-- | dist/changes-5.14.2.3 | 35 | ||||
-rw-r--r-- | examples/opengl/grabber.py | 10 | ||||
-rw-r--r-- | examples/widgets/dialogs/classwizard/classwizard.py | 2 | ||||
-rw-r--r-- | examples/widgets/itemviews/addressbook/addresswidget.py | 9 | ||||
-rw-r--r-- | examples/widgets/richtext/syntaxhighlighter.py | 56 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/schema.py | 43 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtCore/typesystem_core_common.xml | 3 | ||||
-rw-r--r-- | sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py | 7 |
8 files changed, 112 insertions, 53 deletions
diff --git a/dist/changes-5.14.2.3 b/dist/changes-5.14.2.3 new file mode 100644 index 000000000..6f17bc4bd --- /dev/null +++ b/dist/changes-5.14.2.3 @@ -0,0 +1,35 @@ +Qt for Python 5.14.2.3 is a bug-fix release. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qtforpython/ + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* PySide2 * +**************************************************************************** + + - [PYSIDE-1223] pyside2-uic instead of uic is not used for loadUiType() + - [PYSIDE-1257] Deployment with cx_freeze using zip_include_packages has + been fixed + - [PYSIDE-1282] A crash using QThread.terminate() on pthreads has + been fixed + - [PYSIDE-1311] The downloads functionality of the Tabbedbrowser example + has been fixed + - [PYSIDE-1321] A leaking reference in the PySide2 property getter has + been fixed + +**************************************************************************** +* Shiboken2 * +**************************************************************************** + + - [PYSIDE-1325] Wrong generated code for default-initialized function + arguments ({}) has been fixed diff --git a/examples/opengl/grabber.py b/examples/opengl/grabber.py index 9b5358a85..04a16fcbc 100644 --- a/examples/opengl/grabber.py +++ b/examples/opengl/grabber.py @@ -414,11 +414,13 @@ class MainWindow(QtWidgets.QMainWindow): if not ok: return QtCore.QSize() - regExp = QtCore.QRegExp("([0-9]+) *x *([0-9]+)") + regExp = QtCore.QRegularExpression("([0-9]+) *x *([0-9]+)") + assert regExp.isValid() - if regExp.exactMatch(text): - width = int(regExp.cap(1)) - height = int(regExp.cap(2)) + match = regExp.match(text) + if match.hasMatch(): + width = int(match.captured(1)) + height = int(match.captured(2)) if width > 0 and width < 2048 and height > 0 and height < 2048: return QtCore.QSize(width, height) diff --git a/examples/widgets/dialogs/classwizard/classwizard.py b/examples/widgets/dialogs/classwizard/classwizard.py index fc2feb498..d0e970f94 100644 --- a/examples/widgets/dialogs/classwizard/classwizard.py +++ b/examples/widgets/dialogs/classwizard/classwizard.py @@ -325,7 +325,7 @@ class CodeStylePage(QtWidgets.QWizardPage): if not is_baseClass: self.baseIncludeLineEdit.clear() - elif QtCore.QRegExp('Q[A-Z].*').exactMatch(baseClass): + elif QtCore.QRegularExpression('^Q[A-Z].*$').match(baseClass).hasMatch(): self.baseIncludeLineEdit.setText('<' + baseClass + '>') else: self.baseIncludeLineEdit.setText('"' + baseClass.lower() + '.h"') diff --git a/examples/widgets/itemviews/addressbook/addresswidget.py b/examples/widgets/itemviews/addressbook/addresswidget.py index b70b44b0a..d0c1747fb 100644 --- a/examples/widgets/itemviews/addressbook/addresswidget.py +++ b/examples/widgets/itemviews/addressbook/addresswidget.py @@ -45,7 +45,7 @@ try: except ImportError: import pickle -from PySide2.QtCore import (Qt, Signal, QRegExp, QModelIndex, +from PySide2.QtCore import (Qt, Signal, QRegularExpression, QModelIndex, QItemSelection, QSortFilterProxyModel) from PySide2.QtWidgets import QTabWidget, QMessageBox, QTableView, QAbstractItemView @@ -193,9 +193,10 @@ class AddressWidget(QTabWidget): # tab. The regex will end up looking like "^[ABC].*", only # allowing this tab to display items where the name starts with # "A", "B", or "C". Notice that we set it to be case-insensitive. - reFilter = "^[%s].*" % group - - proxyModel.setFilterRegExp(QRegExp(reFilter, Qt.CaseInsensitive)) + re = QRegularExpression("^[{}].*".format(group)) + assert re.isValid() + re.setPatternOptions(QRegularExpression.CaseInsensitiveOption) + proxyModel.setFilterRegularExpression(re) proxyModel.setFilterKeyColumn(0) # Filter on the "name" column proxyModel.sort(0, Qt.AscendingOrder) diff --git a/examples/widgets/richtext/syntaxhighlighter.py b/examples/widgets/richtext/syntaxhighlighter.py index 82e4c79a1..9be299401 100644 --- a/examples/widgets/richtext/syntaxhighlighter.py +++ b/examples/widgets/richtext/syntaxhighlighter.py @@ -130,65 +130,73 @@ class Highlighter(QtGui.QSyntaxHighlighter): "\\bunion\\b", "\\bunsigned\\b", "\\bvirtual\\b", "\\bvoid\\b", "\\bvolatile\\b"] - self.highlightingRules = [(QtCore.QRegExp(pattern), keywordFormat) + self.highlightingRules = [(QtCore.QRegularExpression(pattern), keywordFormat) for pattern in keywordPatterns] classFormat = QtGui.QTextCharFormat() classFormat.setFontWeight(QtGui.QFont.Bold) classFormat.setForeground(QtCore.Qt.darkMagenta) - self.highlightingRules.append((QtCore.QRegExp("\\bQ[A-Za-z]+\\b"), - classFormat)) + pattern = QtCore.QRegularExpression(r'\bQ[A-Za-z]+\b') + assert pattern.isValid() + self.highlightingRules.append((pattern, classFormat)) singleLineCommentFormat = QtGui.QTextCharFormat() singleLineCommentFormat.setForeground(QtCore.Qt.red) - self.highlightingRules.append((QtCore.QRegExp("//[^\n]*"), - singleLineCommentFormat)) + pattern = QtCore.QRegularExpression('//[^\n]*') + assert pattern.isValid() + self.highlightingRules.append((pattern, singleLineCommentFormat)) self.multiLineCommentFormat = QtGui.QTextCharFormat() self.multiLineCommentFormat.setForeground(QtCore.Qt.red) quotationFormat = QtGui.QTextCharFormat() quotationFormat.setForeground(QtCore.Qt.darkGreen) - self.highlightingRules.append((QtCore.QRegExp("\".*\""), - quotationFormat)) + pattern = QtCore.QRegularExpression('".*"') + assert pattern.isValid() + self.highlightingRules.append((pattern, quotationFormat)) functionFormat = QtGui.QTextCharFormat() functionFormat.setFontItalic(True) functionFormat.setForeground(QtCore.Qt.blue) - self.highlightingRules.append((QtCore.QRegExp("\\b[A-Za-z0-9_]+(?=\\()"), - functionFormat)) + pattern = QtCore.QRegularExpression(r'\b[A-Za-z0-9_]+(?=\()') + assert pattern.isValid() + self.highlightingRules.append((pattern, functionFormat)) - self.commentStartExpression = QtCore.QRegExp("/\\*") - self.commentEndExpression = QtCore.QRegExp("\\*/") + self.commentStartExpression = QtCore.QRegularExpression(r'/\*') + assert self.commentStartExpression.isValid() + self.commentEndExpression = QtCore.QRegularExpression(r'\*/') + assert self.commentEndExpression.isValid() def highlightBlock(self, text): for pattern, format in self.highlightingRules: - expression = QtCore.QRegExp(pattern) - index = expression.indexIn(text) - while index >= 0: - length = expression.matchedLength() + match = pattern.match(text) + while match.hasMatch(): + index = match.capturedStart(0) + length = match.capturedLength(0) self.setFormat(index, length, format) - index = expression.indexIn(text, index + length) + match = pattern.match(text, index + length) self.setCurrentBlockState(0) startIndex = 0 if self.previousBlockState() != 1: - startIndex = self.commentStartExpression.indexIn(text) + match = self.commentStartExpression.match(text) + startIndex = match.capturedStart(0) if match.hasMatch() else -1 while startIndex >= 0: - endIndex = self.commentEndExpression.indexIn(text, startIndex) - - if endIndex == -1: + match = self.commentEndExpression.match(text, startIndex) + if match.hasMatch(): + endIndex = match.capturedStart(0) + length = match.capturedLength(0) + commentLength = endIndex - startIndex + length + else: self.setCurrentBlockState(1) commentLength = len(text) - startIndex - else: - commentLength = endIndex - startIndex + self.commentEndExpression.matchedLength() self.setFormat(startIndex, commentLength, self.multiLineCommentFormat) - startIndex = self.commentStartExpression.indexIn(text, - startIndex + commentLength) + match = self.commentStartExpression.match(text, startIndex + commentLength) + startIndex = match.capturedStart(0) if match.hasMatch() else -1 if __name__ == '__main__': diff --git a/examples/xmlpatterns/schema/schema.py b/examples/xmlpatterns/schema/schema.py index 677b56498..d3c22c184 100644 --- a/examples/xmlpatterns/schema/schema.py +++ b/examples/xmlpatterns/schema/schema.py @@ -77,19 +77,22 @@ class XmlSyntaxHighlighter(QtGui.QSyntaxHighlighter): format = QtGui.QTextCharFormat() format.setForeground(QtCore.Qt.darkBlue) format.setFontWeight(QtGui.QFont.Bold) - pattern = QtCore.QRegExp("(<[a-zA-Z:]+\\b|<\\?[a-zA-Z:]+\\b|\\?>|>|/>|</[a-zA-Z:]+>)") + pattern = QtCore.QRegularExpression(r'(<[a-zA-Z:]+\b|<\?[a-zA-Z:]+\b|\?>|>|/>|</[a-zA-Z:]+>)') + assert pattern.isValid() self.highlightingRules.append((pattern, format)) # Attribute format. format = QtGui.QTextCharFormat() format.setForeground(QtCore.Qt.darkGreen) - pattern = QtCore.QRegExp("[a-zA-Z:]+=") + pattern = QtCore.QRegularExpression('[a-zA-Z:]+=') + assert pattern.isValid() self.highlightingRules.append((pattern, format)) # Attribute content format. format = QtGui.QTextCharFormat() format.setForeground(QtCore.Qt.red) - pattern = QtCore.QRegExp("(\"[^\"]*\"|'[^']*')") + pattern = QtCore.QRegularExpression("(\"[^\"]*\"|'[^']*')") + assert pattern.isValid() self.highlightingRules.append((pattern, format)) # Comment format. @@ -97,35 +100,41 @@ class XmlSyntaxHighlighter(QtGui.QSyntaxHighlighter): self.commentFormat.setForeground(QtCore.Qt.lightGray) self.commentFormat.setFontItalic(True) - self.commentStartExpression = QtCore.QRegExp("<!--") - self.commentEndExpression = QtCore.QRegExp("-->") + self.commentStartExpression = QtCore.QRegularExpression("<!--") + assert self.commentStartExpression.isValid() + self.commentEndExpression = QtCore.QRegularExpression("-->") + assert self.commentEndExpression.isValid() def highlightBlock(self, text): for pattern, format in self.highlightingRules: - expression = QtCore.QRegExp(pattern) - index = expression.indexIn(text) - while index >= 0: - length = expression.matchedLength() + match = pattern.match(text) + while match.hasMatch(): + index = match.capturedStart() + length = match.capturedLength(0) self.setFormat(index, length, format) - index = expression.indexIn(text, index + length) + match = pattern.match(text, index + length) self.setCurrentBlockState(0) startIndex = 0 if self.previousBlockState() != 1: - startIndex = self.commentStartExpression.indexIn(text) + match = self.commentStartExpression.match(text) + startIndex = match.capturedStart(0) if match.hasMatch() else -1 while startIndex >= 0: - endIndex = self.commentEndExpression.indexIn(text, startIndex) - if endIndex == -1: + match = self.commentEndExpression.match(text, startIndex) + endIndex = match.capturedStart(0) if match.hasMatch() else -1 + if match.hasMatch(): + endIndex = match.capturedStart(0) + length = match.capturedLength(0) + commentLength = endIndex - startIndex + length + else: self.setCurrentBlockState(1) commentLength = text.length() - startIndex - else: - commentLength = endIndex - startIndex + self.commentEndExpression.matchedLength() self.setFormat(startIndex, commentLength, self.commentFormat) - startIndex = self.commentStartExpression.indexIn(text, - startIndex + commentLength) + match = self.commentStartExpression.match(text, startIndex + commentLength) + startIndex = match.capturedStart(0) if match.hasMatch() else -1 class MessageHandler(QtXmlPatterns.QAbstractMessageHandler): diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index 1bbd0bfb0..216b02a4d 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -1938,9 +1938,6 @@ <modify-function signature="setNum(short,int)" remove="all"/> <modify-function signature="setNum(qulonglong,int)" remove="all"/> <modify-function signature="number(uint,int)" remove="all"/> - <modify-function signature="number(ushort,int)" remove="all"/> - <modify-function signature="number(float,char,int)" remove="all"/> - <modify-function signature="number(short,int)" remove="all"/> <modify-function signature="number(qulonglong,int)" remove="all"/> <!--### --> diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py index 49ea382f6..e556ec9aa 100644 --- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py +++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py @@ -439,6 +439,7 @@ def init_PySide2_QtCore(): "4294967295UL": 4294967295, # 5.6, RHEL 6.6 "CheckIndexOption.NoOption": Instance( "PySide2.QtCore.QAbstractItemModel.CheckIndexOptions.NoOption"), # 5.11 + "DescriptorType(-1)": int, # Native handle of QSocketDescriptor "false": False, "list of QAbstractAnimation": typing.List[PySide2.QtCore.QAbstractAnimation], "list of QAbstractState": typing.List[PySide2.QtCore.QAbstractState], @@ -447,6 +448,7 @@ def init_PySide2_QtCore(): "nullptr": None, # 5.9 "PyByteArray": bytearray, "PyBytes": bytes, + "QDeadlineTimer(QDeadlineTimer.Forever)": Instance("PySide2.QtCore.QDeadlineTimer"), "PySide2.QtCore.QCborStreamReader.StringResult[PySide2.QtCore.QByteArray]": PySide2.QtCore.QCborStringResultByteArray, "PySide2.QtCore.QCborStreamReader.StringResult[QString]": @@ -541,10 +543,15 @@ def init_PySide2_QtSql(): def init_PySide2_QtNetwork(): + from PySide2.QtNetwork import QNetworkRequest best_structure = typing.OrderedDict if getattr(typing, "OrderedDict", None) else typing.Dict type_map.update({ "QMultiMap[PySide2.QtNetwork.QSsl.AlternativeNameEntryType, QString]": best_structure[PySide2.QtNetwork.QSsl.AlternativeNameEntryType, typing.List[str]], + "DefaultTransferTimeoutConstant": + QNetworkRequest.TransferTimeoutConstant, + "QNetworkRequest.DefaultTransferTimeoutConstant": + QNetworkRequest.TransferTimeoutConstant, }) del best_structure return locals() |