aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-17 08:06:56 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-20 13:11:48 +0000
commit7f13c0d0094cf70d85c5859db019c62fb35d2dae (patch)
tree187da3cbb960cf1a335cc61a77e4117d5a182ce4 /sources/pyside2/tests
parentac67527ab94a4da2dfaee7567a956b474a46c5e3 (diff)
Re-add QtSvg
QtSvg was split into QtSvg and QtSvgWidgets in Qt 6. Adapt the PySide2 modules accordingly. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Task-number: QTBUG-41884 Change-Id: I4ff005dfc6e71ac8eb3e3d45b22a7e507eb88f6d Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/tests')
-rw-r--r--sources/pyside2/tests/QtSvg/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtSvg/qsvgrenderer_test.py10
-rw-r--r--sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtSvgWidgets/qsvgwidget_test.py (renamed from sources/pyside2/tests/QtSvg/qsvgwidget_test.py)12
4 files changed, 13 insertions, 11 deletions
diff --git a/sources/pyside2/tests/QtSvg/CMakeLists.txt b/sources/pyside2/tests/QtSvg/CMakeLists.txt
index 4f5e2805f..53d15e857 100644
--- a/sources/pyside2/tests/QtSvg/CMakeLists.txt
+++ b/sources/pyside2/tests/QtSvg/CMakeLists.txt
@@ -1,3 +1,2 @@
PYSIDE_TEST(qsvggenerator_test.py)
PYSIDE_TEST(qsvgrenderer_test.py)
-PYSIDE_TEST(qsvgwidget_test.py)
diff --git a/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py
index 88537edfe..3dd5b61f6 100644
--- a/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py
+++ b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py
@@ -2,7 +2,7 @@
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of Qt for Python.
@@ -36,15 +36,15 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtCore import *
-from PySide2.QtWidgets import *
-from PySide2.QtSvg import *
+from PySide2.QtCore import QFile
+from PySide2.QtGui import QGuiApplication
+from PySide2.QtSvg import QSvgRenderer
class QSvgRendererTest(unittest.TestCase):
def testLoad(self):
tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg')
- app = QApplication([])
+ app = QGuiApplication([])
fromFile = QSvgRenderer(tigerPath)
self.assertTrue(fromFile.isValid())
diff --git a/sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt b/sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt
new file mode 100644
index 000000000..61952169a
--- /dev/null
+++ b/sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt
@@ -0,0 +1 @@
+PYSIDE_TEST(qsvgwidget_test.py)
diff --git a/sources/pyside2/tests/QtSvg/qsvgwidget_test.py b/sources/pyside2/tests/QtSvgWidgets/qsvgwidget_test.py
index 17bf6527b..a3749c0ee 100644
--- a/sources/pyside2/tests/QtSvg/qsvgwidget_test.py
+++ b/sources/pyside2/tests/QtSvgWidgets/qsvgwidget_test.py
@@ -2,7 +2,7 @@
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of Qt for Python.
@@ -36,14 +36,16 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtCore import *
-from PySide2.QtWidgets import *
-from PySide2.QtSvg import *
+from PySide2.QtCore import QFile, QFileInfo, QDir
+from PySide2.QtWidgets import QApplication
+from PySide2.QtSvgWidgets import QSvgWidget
class QSvgWidgetTest(unittest.TestCase):
def testLoad(self):
- tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg')
+ dir = os.path.dirname(__file__)
+ tigerPath = QDir.cleanPath("{}/../QtSvg/tiger.svg".format(dir))
+ self.assertTrue(QFileInfo.exists(tigerPath))
app = QApplication([])
fromFile = QSvgWidget()