diff options
Diffstat (limited to 'sources/pyside2/tests/QtUiTools')
27 files changed, 0 insertions, 1253 deletions
diff --git a/sources/pyside2/tests/QtUiTools/CMakeLists.txt b/sources/pyside2/tests/QtUiTools/CMakeLists.txt deleted file mode 100644 index 68ed7f134..000000000 --- a/sources/pyside2/tests/QtUiTools/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -PYSIDE_TEST(bug_360.py) -PYSIDE_TEST(bug_376.py) -PYSIDE_TEST(bug_392.py) -PYSIDE_TEST(bug_426.py) -PYSIDE_TEST(bug_552.py) -PYSIDE_TEST(bug_797.py) -PYSIDE_TEST(bug_909.py) -PYSIDE_TEST(bug_913.py) -PYSIDE_TEST(bug_958.py) -PYSIDE_TEST(bug_965.py) -PYSIDE_TEST(bug_1060.py) -PYSIDE_TEST(uiloader_test.py) -PYSIDE_TEST(ui_test.py) diff --git a/sources/pyside2/tests/QtUiTools/action.ui b/sources/pyside2/tests/QtUiTools/action.ui deleted file mode 100644 index 9eda559de..000000000 --- a/sources/pyside2/tests/QtUiTools/action.ui +++ /dev/null @@ -1,16 +0,0 @@ -<ui version="4.0"> - <class>main_window</class> - <widget class="QMainWindow" name="main_window"> - <widget class="QWidget" name="centralwidget"/> - <widget class="QMenuBar" name="menubar"/> - <widget class="QStatusBar" name="statusbar"> - <action name="actionFoo"> - <property name="text"> - <string>foo</string> - </property> - </action> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/bug_1060.py b/sources/pyside2/tests/QtUiTools/bug_1060.py deleted file mode 100644 index f60912780..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_1060.py +++ /dev/null @@ -1,54 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -''' unit test for BUG #1060 ''' - -import os -import sys - -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 helper.helper import adjust_filename -from PySide2.QtWidgets import QApplication -from PySide2.QtUiTools import QUiLoader - - -class MyQUiLoader(QUiLoader): - def __init__(self): - super(MyQUiLoader, self).__init__() - - def createWidget(self, *args): - return super(MyQUiLoader, self).createWidget(*args) - -if __name__ == "__main__": - app = QApplication([]) - - ui = MyQUiLoader().load(adjust_filename("bug_1060.ui", __file__)) - ui.show() diff --git a/sources/pyside2/tests/QtUiTools/bug_1060.ui b/sources/pyside2/tests/QtUiTools/bug_1060.ui deleted file mode 100644 index f4044a8c2..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_1060.ui +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Dialog</class> - <widget class="QDialog" name="Dialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>100</width> - <height>100</height> - </rect> - </property> - <property name="windowTitle"> - <string>Dialog</string> - </property> - </widget> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/bug_360.py b/sources/pyside2/tests/QtUiTools/bug_360.py deleted file mode 100644 index 8d15f2730..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_360.py +++ /dev/null @@ -1,70 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 helper.usesqapplication import UsesQApplication - -from PySide2 import QtCore, QtWidgets -from PySide2.QtUiTools import QUiLoader - -class MyQUiLoader(QUiLoader): - def __init__(self, baseinstance): - QUiLoader.__init__(self) - self.baseinstance = baseinstance - self._widgets = [] - - def createWidget(self, className, parent=None, name=""): - widget = QUiLoader.createWidget(self, className, parent, name) - self._widgets.append(widget) - if parent is None: - return self.baseinstance - else: - setattr(self.baseinstance, name, widget) - return widget - -class ButTest(UsesQApplication): - def testCase(self): - w = QtWidgets.QWidget() - loader = MyQUiLoader(w) - - filePath = os.path.join(os.path.dirname(__file__), 'minimal.ui') - ui = loader.load(filePath) - - self.assertEqual(len(loader._widgets), 1) - self.assertEqual(type(loader._widgets[0]), QtWidgets.QFrame) - -if __name__ == '__main__': - unittest.main() - diff --git a/sources/pyside2/tests/QtUiTools/bug_376.py b/sources/pyside2/tests/QtUiTools/bug_376.py deleted file mode 100644 index 264faad7f..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_376.py +++ /dev/null @@ -1,53 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 helper.usesqapplication import UsesQApplication - -from PySide2 import QtCore, QtWidgets -from PySide2.QtUiTools import QUiLoader - -class BugTest(UsesQApplication): - def testCase(self): - w = QtWidgets.QWidget() - loader = QUiLoader() - - filePath = os.path.join(os.path.dirname(__file__), 'test.ui') - result = loader.load(filePath, w) - self.assertTrue(isinstance(result.child_object, QtWidgets.QFrame)) - -if __name__ == '__main__': - unittest.main() - diff --git a/sources/pyside2/tests/QtUiTools/bug_392.py b/sources/pyside2/tests/QtUiTools/bug_392.py deleted file mode 100644 index 2439e7203..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_392.py +++ /dev/null @@ -1,81 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 helper.usesqapplication import UsesQApplication - -from PySide2 import QtWidgets -from PySide2.QtUiTools import QUiLoader - -class MyWidget(QtWidgets.QComboBox): - def __init__(self, parent=None): - QtWidgets.QComboBox.__init__(self, parent) - - def isPython(self): - return True - -class BugTest(UsesQApplication): - def testCase(self): - w = QtWidgets.QWidget() - loader = QUiLoader() - - filePath = os.path.join(os.path.dirname(__file__), 'action.ui') - result = loader.load(filePath, w) - self.assertTrue(isinstance(result.actionFoo, QtWidgets.QAction)) - - def testPythonCustomWidgets(self): - w = QtWidgets.QWidget() - loader = QUiLoader() - loader.registerCustomWidget(MyWidget) - - filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget.ui') - result = loader.load(filePath, w) - self.assertTrue(isinstance(result.custom, MyWidget)) - self.assertTrue(result.custom.isPython()) - - def testPythonCustomWidgetsTwice(self): - w = QtWidgets.QWidget() - loader = QUiLoader() - loader.registerCustomWidget(MyWidget) - - filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget2.ui') - result = loader.load(filePath, w) - self.assertTrue(isinstance(result.custom, MyWidget)) - self.assertTrue(isinstance(result.custom2, MyWidget)) - self.assertTrue(result.custom.isPython()) - -if __name__ == '__main__': - unittest.main() - diff --git a/sources/pyside2/tests/QtUiTools/bug_426.py b/sources/pyside2/tests/QtUiTools/bug_426.py deleted file mode 100644 index e84da0382..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_426.py +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 import QtCore, QtWidgets -from PySide2.QtUiTools import QUiLoader - -class Window(object): - def __init__(self): - loader = QUiLoader() - filePath = os.path.join(os.path.dirname(__file__), 'bug_426.ui') - self.widget = loader.load(filePath) - self.group = QtWidgets.QActionGroup(self.widget) - self.widget.show() - QtCore.QTimer.singleShot(0, self.widget.close) - -if __name__ == "__main__": - app = QtWidgets.QApplication(sys.argv) - win = Window() - sys.exit(app.exec_()) diff --git a/sources/pyside2/tests/QtUiTools/bug_426.ui b/sources/pyside2/tests/QtUiTools/bug_426.ui deleted file mode 100644 index 99353cd2b..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_426.ui +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Form</class> - <widget class="QWidget" name="Form"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - </widget> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/bug_552.py b/sources/pyside2/tests/QtUiTools/bug_552.py deleted file mode 100644 index be42789cf..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_552.py +++ /dev/null @@ -1,57 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 helper.helper import adjust_filename -from PySide2 import QtWidgets, QtCore -from PySide2.QtUiTools import QUiLoader - -class View_1(QtWidgets.QWidget): - - def __init__(self): - QtWidgets.QWidget.__init__(self) - loader = QUiLoader() - widget = loader.load(adjust_filename('bug_552.ui', __file__), self) - self.children = [] - for child in widget.findChildren(QtCore.QObject, None): - self.children.append(child) - self.t = widget.tabWidget - self.t.removeTab(0) - -app = QtWidgets.QApplication([]) -window = View_1() -window.show() - -# If it doesn't crash it works :-) diff --git a/sources/pyside2/tests/QtUiTools/bug_552.ui b/sources/pyside2/tests/QtUiTools/bug_552.ui deleted file mode 100644 index f98da4421..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_552.ui +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Form</class> - <widget class="QWidget" name="Form"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <widget class="QTabWidget" name="tabWidget"> - <property name="geometry"> - <rect> - <x>130</x> - <y>80</y> - <width>139</width> - <height>80</height> - </rect> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="tab"> - <attribute name="title"> - <string>Tab 1</string> - </attribute> - </widget> - <widget class="QWidget" name="tab_2"> - <attribute name="title"> - <string>Tab 2</string> - </attribute> - </widget> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/bug_797.py b/sources/pyside2/tests/QtUiTools/bug_797.py deleted file mode 100644 index 454699196..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_797.py +++ /dev/null @@ -1,49 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 helper.helper import adjust_filename - -from PySide2 import QtUiTools -from PySide2 import QtCore -from PySide2 import QtWidgets - - -app = QtWidgets.QApplication([]) -loader = QtUiTools.QUiLoader() -file = QtCore.QFile(adjust_filename('bug_552.ui', __file__)) -w = QtWidgets.QWidget() -# An exception can't be thrown -mainWindow = loader.load(file, w) diff --git a/sources/pyside2/tests/QtUiTools/bug_909.py b/sources/pyside2/tests/QtUiTools/bug_909.py deleted file mode 100644 index 9831b6b0e..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_909.py +++ /dev/null @@ -1,57 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 QFile -from PySide2.QtWidgets import QTabWidget -from PySide2.QtUiTools import QUiLoader - -from helper.usesqapplication import UsesQApplication -from helper.helper import adjust_filename - -class TestDestruction(UsesQApplication): - def testBug909(self): - fileName = QFile(adjust_filename('bug_909.ui', __file__)) - loader = QUiLoader() - main_win = loader.load(fileName) - self.assertEqual(sys.getrefcount(main_win), 2) - fileName.close() - - tw = QTabWidget(main_win) - main_win.setCentralWidget(tw) - main_win.show() - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/bug_909.ui b/sources/pyside2/tests/QtUiTools/bug_909.ui deleted file mode 100644 index b07f62d05..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_909.ui +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>800</width> - <height>600</height> - </rect> - </property> - <property name="windowTitle"> - <string>MainWindow</string> - </property> - <widget class="QWidget" name="centralwidget"/> - <widget class="QMenuBar" name="menubar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>800</width> - <height>25</height> - </rect> - </property> - </widget> - <widget class="QStatusBar" name="statusbar"/> - </widget> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/bug_913.py b/sources/pyside2/tests/QtUiTools/bug_913.py deleted file mode 100644 index 3e2ca818b..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_913.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 helper.helper import adjust_filename - -from PySide2.QtCore import * -from PySide2.QtWidgets import * -from PySide2.QtUiTools import * - -class TestBug913 (unittest.TestCase): - - def testIt(self): - app = QApplication([]) - - loader = QUiLoader() - widget = loader.load(adjust_filename('bug_913.ui', __file__)) - widget.tabWidget.currentIndex() # direct child is available as member - widget.le_first.setText('foo') # child of QTabWidget must also be available! - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/bug_913.ui b/sources/pyside2/tests/QtUiTools/bug_913.ui deleted file mode 100644 index 0fc95fd53..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_913.ui +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Form</class> - <widget class="QWidget" name="Form"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QTabWidget" name="tabWidget"> - <widget class="QWidget" name="tab"> - <attribute name="title"> - <string>Tab 1</string> - </attribute> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>First name:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="le_first"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Last name:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="le_last"/> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_2"> - <attribute name="title"> - <string>Tab 2</string> - </attribute> - </widget> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/bug_958.py b/sources/pyside2/tests/QtUiTools/bug_958.py deleted file mode 100644 index 98ac16189..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_958.py +++ /dev/null @@ -1,59 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 import QtWidgets, QtUiTools -from helper.helper import adjust_filename -from helper.timedqapplication import TimedQApplication - -class Gui_Qt(QtWidgets.QMainWindow): - def __init__(self, parent=None): - super(Gui_Qt, self).__init__(parent) - - lLoader = QtUiTools.QUiLoader() - - # this used to cause a segfault because the old inject code used to destroy the parent layout - self._cw = lLoader.load(adjust_filename('bug_958.ui', __file__), self) - - self.setCentralWidget(self._cw) - -class BugTest(TimedQApplication): - def testCase(self): - lMain = Gui_Qt() - lMain.show() - self.app.exec_() - -if __name__ == "__main__": - unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/bug_958.ui b/sources/pyside2/tests/QtUiTools/bug_958.ui deleted file mode 100644 index 57cdbddba..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_958.ui +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>customWidget</class> - <widget class="QWidget" name="customWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>626</width> - <height>578</height> - </rect> - </property> - <property name="minimumSize"> - <size> - <width>500</width> - <height>0</height> - </size> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QTableWidget" name="resultTable"/> - </item> - <item> - <widget class="QProgressBar" name="progressBar"> - <property name="value"> - <number>0</number> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="actionLayout"> - <item> - <widget class="QPushButton" name="processButton"> - <property name="text"> - <string>&Berechnen</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/bug_965.py b/sources/pyside2/tests/QtUiTools/bug_965.py deleted file mode 100644 index 217f948af..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_965.py +++ /dev/null @@ -1,55 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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.QtUiTools import QUiLoader - -from helper.usesqapplication import UsesQApplication -from helper.helper import adjust_filename - -class MyQUiLoader(QUiLoader): - def __init__(self): - super(MyQUiLoader, self).__init__() - - def createWidget(self, className, parent=None, name=""): - return None - -class BugTest(UsesQApplication): - def testCase(self): - loader = MyQUiLoader() - self.assertRaises(RuntimeError, loader.load, adjust_filename('bug_965.ui', __file__)) - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/bug_965.ui b/sources/pyside2/tests/QtUiTools/bug_965.ui deleted file mode 100644 index e324db829..000000000 --- a/sources/pyside2/tests/QtUiTools/bug_965.ui +++ /dev/null @@ -1,27 +0,0 @@ -<ui version="4.0" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow" > - <property name="objectName" > - <string notr="true" >MainWindow</string> - </property> - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>800</width> - <height>600</height> - </rect> - </property> - <property name="windowTitle" > - <string>MainWindow</string> - </property> - <widget class="QMenuBar" name="menubar" /> - <widget class="QWidget" name="centralwidget" /> - <widget class="QStatusBar" name="statusbar" /> - </widget> - <pixmapfunction></pixmapfunction> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/loadUiType_test.py b/sources/pyside2/tests/QtUiTools/loadUiType_test.py deleted file mode 100644 index 9a3756376..000000000 --- a/sources/pyside2/tests/QtUiTools/loadUiType_test.py +++ /dev/null @@ -1,75 +0,0 @@ -############################################################################# -## -## 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. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 helper.usesqapplication import UsesQApplication - -from PySide2.QtWidgets import QWidget, QFrame, QPushButton -from PySide2.QtUiTools import loadUiType - -class loadUiTypeTester(UsesQApplication): - def testFunction(self): - filePath = os.path.join(os.path.dirname(__file__), "minimal.ui") - loaded = loadUiType(filePath) - self.assertNotEqual(loaded, None) - - # (<class '__main__.Ui_Form'>, <class 'PySide2.QtWidgets.QFrame'>) - generated, base = loaded - - # Generated class contains retranslateUi method - self.assertTrue("retranslateUi" in dir(generated)) - - # Base class instance will be QFrame for this example - self.assertTrue(isinstance(base(), QFrame)) - - anotherFileName = os.path.join(os.path.dirname(__file__), "test.ui") - another = loadUiType(anotherFileName) - self.assertNotEqual(another, None) - - generated, base = another - # Base class instance will be QWidget for this example - self.assertTrue(isinstance(base(), QWidget)) - - w = base() - ui = generated() - ui.setupUi(w) - - self.assertTrue(isinstance(ui.child_object, QFrame)) - self.assertTrue(isinstance(ui.grandson_object, QPushButton)) - - -if __name__ == '__main__': - unittest.main() - diff --git a/sources/pyside2/tests/QtUiTools/minimal.ui b/sources/pyside2/tests/QtUiTools/minimal.ui deleted file mode 100644 index c6bb70cda..000000000 --- a/sources/pyside2/tests/QtUiTools/minimal.ui +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Form</class> - <widget class="QFrame" name="Form"> - </widget> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/pycustomwidget.ui b/sources/pyside2/tests/QtUiTools/pycustomwidget.ui deleted file mode 100644 index c066153a0..000000000 --- a/sources/pyside2/tests/QtUiTools/pycustomwidget.ui +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>qwidget</class> - <widget class="QWidget" name="qwidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string/> - </property> - <widget class="MyWidget" name="custom"> - <property name="geometry"> - <rect> - <x>10</x> - <y>10</y> - <width>79</width> - <height>23</height> - </rect> - </property> - </widget> - </widget> - <customwidgets> - <customwidget> - <class>MyWidget</class> - <extends>QComboBox</extends> - <header>customwidget</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/pycustomwidget2.ui b/sources/pyside2/tests/QtUiTools/pycustomwidget2.ui deleted file mode 100644 index 8826ac1fb..000000000 --- a/sources/pyside2/tests/QtUiTools/pycustomwidget2.ui +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>qwidget</class> - <widget class="QWidget" name="qwidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string/> - </property> - - <widget class="MyWidget" name="custom"> - <property name="geometry"> - <rect> - <x>10</x> - <y>10</y> - <width>79</width> - <height>23</height> - </rect> - </property> - </widget> - - <widget class="MyWidget" name="custom2"> - <property name="geometry"> - <rect> - <x>10</x> - <y>10</y> - <width>79</width> - <height>23</height> - </rect> - </property> - </widget> - </widget> - <customwidgets> - <customwidget> - <class>MyWidget</class> - <extends>QComboBox</extends> - <header>customwidget</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/test.ui b/sources/pyside2/tests/QtUiTools/test.ui deleted file mode 100644 index 60afe22b3..000000000 --- a/sources/pyside2/tests/QtUiTools/test.ui +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Form</class> - <widget class="QWidget" name="Form"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>185</width> - <height>133</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <widget class="QFrame" name="child_object"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>181</width> - <height>131</height> - </rect> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <widget class="QPushButton" name="grandson_object"> - <property name="geometry"> - <rect> - <x>50</x> - <y>60</y> - <width>80</width> - <height>25</height> - </rect> - </property> - <property name="text"> - <string>PushButton</string> - </property> - </widget> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/sources/pyside2/tests/QtUiTools/ui_test.py b/sources/pyside2/tests/QtUiTools/ui_test.py deleted file mode 100644 index 6705bb0be..000000000 --- a/sources/pyside2/tests/QtUiTools/ui_test.py +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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.QtUiTools import QUiLoader - -from helper.usesqapplication import UsesQApplication - -class QUiLoaderCreation(UsesQApplication): - - def testConstructor(self): - loader = QUiLoader() - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/uiloader_test.py b/sources/pyside2/tests/QtUiTools/uiloader_test.py deleted file mode 100644 index 48b401426..000000000 --- a/sources/pyside2/tests/QtUiTools/uiloader_test.py +++ /dev/null @@ -1,77 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -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 helper.usesqapplication import UsesQApplication - -from PySide2.QtWidgets import QWidget -from PySide2.QtUiTools import QUiLoader - -def get_file_path(): - for path in file_path: - if os.path.exists(path): - return path - return "" - -class QUioaderTeste(UsesQApplication): - def testLoadFile(self): - filePath = os.path.join(os.path.dirname(__file__), 'test.ui') - loader = QUiLoader() - parent = QWidget() - w = loader.load(filePath, parent) - self.assertNotEqual(w, None) - - self.assertEqual(len(parent.children()), 1) - - child = w.findChild(QWidget, "child_object") - self.assertNotEqual(child, None) - self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object")) - - def testLoadFileUnicodeFilePath(self): - filePath = str(os.path.join(os.path.dirname(__file__), 'test.ui')) - loader = QUiLoader() - parent = QWidget() - w = loader.load(filePath, parent) - self.assertNotEqual(w, None) - - self.assertEqual(len(parent.children()), 1) - - child = w.findChild(QWidget, "child_object") - self.assertNotEqual(child, None) - self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object")) - -if __name__ == '__main__': - unittest.main() - |