aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2')
-rw-r--r--sources/pyside2/PySide2/QtQml/typesystem_qml.xml9
-rw-r--r--sources/pyside2/doc/CMakeLists.txt1
-rw-r--r--sources/pyside2/doc/tutorials/basictutorial/uifiles.rst8
-rw-r--r--sources/pyside2/libpyside/pysideqflags.cpp13
-rw-r--r--sources/pyside2/pyside_version.py2
-rw-r--r--sources/pyside2/tests/QtCore/feature_with_uic_test.py2
-rw-r--r--sources/pyside2/tests/QtGui/qrasterwindow_test.py28
-rw-r--r--sources/pyside2/tests/pysidetest/enum_test.py24
8 files changed, 54 insertions, 33 deletions
diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
index 0a12d44cf..c237a9d57 100644
--- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
+++ b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
@@ -116,7 +116,14 @@
<object-type name="QQmlAbstractUrlInterceptor">
<enum-type name="DataType"/>
</object-type>
- <object-type name="QQmlApplicationEngine"/>
+ <object-type name="QQmlApplicationEngine">
+ <!-- PYSIDE-1681: QQmlApplicationEngine constructor, load() and similar need
+ allow-thread in case there is a message handler installed
+ (qInstallMessageHandler) -->
+ <modify-function signature="^QQmlApplicationEngine\(.*\)$" allow-thread="yes"/>
+ <modify-function signature="load(const QString &amp;)" allow-thread="yes"/>
+ <modify-function signature="load(const QUrl &amp;)" allow-thread="yes"/>
+ </object-type>
<object-type name="QQmlComponent">
<enum-type name="CompilationMode"/>
<enum-type name="Status"/>
diff --git a/sources/pyside2/doc/CMakeLists.txt b/sources/pyside2/doc/CMakeLists.txt
index ab5d694e7..950e48686 100644
--- a/sources/pyside2/doc/CMakeLists.txt
+++ b/sources/pyside2/doc/CMakeLists.txt
@@ -152,6 +152,7 @@ configure_file("conf.py.in" "rst/conf.py" @ONLY)
add_custom_target("docrsts"
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/rst
COMMAND Shiboken2::shiboken2 --generator-set=qtdoc ${docHeader}
+ --enable-pyside-extensions
--include-paths="${QT_INCLUDE_DIR}${PATH_SEP}${pyside2_SOURCE_DIR}${PATH_SEP}${TS_ROOT}"
--api-version=${SUPPORTED_QT_VERSION}
--typesystem-paths="${QDOC_TYPESYSTEM_PATH}"
diff --git a/sources/pyside2/doc/tutorials/basictutorial/uifiles.rst b/sources/pyside2/doc/tutorials/basictutorial/uifiles.rst
index 982384629..8da69819e 100644
--- a/sources/pyside2/doc/tutorials/basictutorial/uifiles.rst
+++ b/sources/pyside2/doc/tutorials/basictutorial/uifiles.rst
@@ -185,3 +185,11 @@ command prompt:
.. code-block:: python
python main.py
+
+.. note::
+
+ `QUiLoader` uses connect() calls taking the function signatures as string
+ arguments for signal/slot connections.
+ It is thus unable to handle Python types like `str` or `list` from
+ custom widgets written in Python since these types are internally mapped
+ to different C++ types.
diff --git a/sources/pyside2/libpyside/pysideqflags.cpp b/sources/pyside2/libpyside/pysideqflags.cpp
index b141ce157..8b224f2c8 100644
--- a/sources/pyside2/libpyside/pysideqflags.cpp
+++ b/sources/pyside2/libpyside/pysideqflags.cpp
@@ -99,12 +99,17 @@ extern "C" {
return NULL;
}
- long valA = PYSIDE_QFLAGS(self)->ob_value;
- long valB = getNumberValue(other);
-
if (self == other) {
- result = 1;
+ switch (op) {
+ case Py_EQ:
+ case Py_LE:
+ case Py_GE:
+ result = 1;
+ break;
+ }
} else {
+ const long valA = PYSIDE_QFLAGS(self)->ob_value;
+ const long valB = getNumberValue(other);
switch (op) {
case Py_EQ:
result = (valA == valB);
diff --git a/sources/pyside2/pyside_version.py b/sources/pyside2/pyside_version.py
index 3ee73451b..9ec9b0e70 100644
--- a/sources/pyside2/pyside_version.py
+++ b/sources/pyside2/pyside_version.py
@@ -39,7 +39,7 @@
major_version = "5"
minor_version = "15"
-patch_version = "6"
+patch_version = "7"
# For example: "a", "b", "rc"
# (which means "alpha", "beta", "release candidate").
diff --git a/sources/pyside2/tests/QtCore/feature_with_uic_test.py b/sources/pyside2/tests/QtCore/feature_with_uic_test.py
index 5b61a4afb..64a620be8 100644
--- a/sources/pyside2/tests/QtCore/feature_with_uic_test.py
+++ b/sources/pyside2/tests/QtCore/feature_with_uic_test.py
@@ -46,7 +46,7 @@ init_test_paths(False)
from helper.usesqapplication import UsesQApplication
-from PySide2.QtCore import QLibraryInfo, qVersion
+from PySide2.QtCore import QCoreApplication, QLibraryInfo, qVersion
from PySide2.QtWidgets import QApplication, QMainWindow
if sys.version_info[0] >= 3:
diff --git a/sources/pyside2/tests/QtGui/qrasterwindow_test.py b/sources/pyside2/tests/QtGui/qrasterwindow_test.py
index f18ceaaf4..1776e5efb 100644
--- a/sources/pyside2/tests/QtGui/qrasterwindow_test.py
+++ b/sources/pyside2/tests/QtGui/qrasterwindow_test.py
@@ -40,27 +40,6 @@ from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import QEvent, QPoint, QRect, QSize, QTimer, Qt
from PySide2.QtGui import QColor, QBackingStore, QPaintDevice, QPainter, QWindow, QPaintDeviceWindow, QRasterWindow, QRegion, QStaticText
-# QWindow rendering via QBackingStore
-class TestBackingStoreWindow(QWindow):
- def __init__(self):
- super(TestBackingStoreWindow, self).__init__()
- self.backingStore = QBackingStore(self)
- self.text = QStaticText("BackingStoreWindow")
-
- def event(self, event):
- if event.type() == QEvent.Resize:
- self.backingStore.resize(self.size())
- self.render()
- elif event.type() == QEvent.UpdateRequest or event.type() == QEvent.Expose:
- self.backingStore.flush(QRegion(QRect(QPoint(0, 0), self.size())))
-
- return QWindow.event(self, event)
-
- def render(self):
- clientRect = QRect(QPoint(0, 0), self.size())
- painter = QPainter(self.backingStore.paintDevice())
- painter.fillRect(clientRect, QColor(Qt.green))
- painter.drawStaticText(QPoint(10, 10), self.text)
# Window using convenience class QRasterWindow
class TestRasterWindow(QRasterWindow):
@@ -74,19 +53,16 @@ class TestRasterWindow(QRasterWindow):
painter.fillRect(clientRect, QColor(Qt.red))
painter.drawStaticText(QPoint(10, 10), self.text)
+
class QRasterWindowTest(UsesQApplication):
def test(self):
rasterWindow = TestRasterWindow()
rasterWindow.setFramePosition(QPoint(100, 100))
rasterWindow.resize(QSize(400, 400))
rasterWindow.show()
- backingStoreWindow = TestBackingStoreWindow()
- backingStoreWindow.setFramePosition(QPoint(600, 100))
- backingStoreWindow.resize(QSize(400, 400))
- backingStoreWindow.show()
-
QTimer.singleShot(100, self.app.quit)
self.app.exec_()
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/pysidetest/enum_test.py b/sources/pyside2/tests/pysidetest/enum_test.py
index d179d6248..a9396383e 100644
--- a/sources/pyside2/tests/pysidetest/enum_test.py
+++ b/sources/pyside2/tests/pysidetest/enum_test.py
@@ -36,6 +36,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(True)
+from PySide2.QtCore import Qt
from testbinding import Enum1, TestObjectWithoutNamespace
class ListConnectionTest(unittest.TestCase):
@@ -46,6 +47,29 @@ class ListConnectionTest(unittest.TestCase):
self.assertEqual(TestObjectWithoutNamespace.Enum2.Option3, 3)
self.assertEqual(TestObjectWithoutNamespace.Enum2.Option4, 4)
+ def testFlagComparisonOperators(self): # PYSIDE-1696, compare to self
+ f1 = Qt.AlignHCenter | Qt.AlignBottom
+ f2 = Qt.AlignHCenter | Qt.AlignBottom
+ self.assertTrue(f1 == f1)
+ self.assertTrue(f1 <= f1)
+ self.assertTrue(f1 >= f1)
+ self.assertFalse(f1 != f1)
+ self.assertFalse(f1 < f1)
+ self.assertFalse(f1 > f1)
+
+ self.assertTrue(f1 == f2)
+ self.assertTrue(f1 <= f2)
+ self.assertTrue(f1 >= f2)
+ self.assertFalse(f1 != f2)
+ self.assertFalse(f1 < f2)
+ self.assertFalse(f1 > f2)
+
+ self.assertTrue(Qt.AlignHCenter < Qt.AlignBottom)
+ self.assertFalse(Qt.AlignHCenter > Qt.AlignBottom)
+ self.assertFalse(Qt.AlignBottom < Qt.AlignHCenter)
+ self.assertTrue(Qt.AlignBottom > Qt.AlignHCenter)
+
+
if __name__ == '__main__':
unittest.main()