diff options
Diffstat (limited to 'sources/pyside6/tests/QtWidgets')
-rw-r--r-- | sources/pyside6/tests/QtWidgets/CMakeLists.txt | 12 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/bug_480.py (renamed from sources/pyside6/tests/QtWidgets/bug_324.py) | 37 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/bug_493.py | 58 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/bug_785.py | 67 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/event_filter_test.py | 76 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/qbrush_test.py | 61 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/qimage_test.py | 314 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/qpen_test.py | 84 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/qpixmap_constructor.py | 288 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/qshortcut_test.py | 88 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/qstandarditemmodel_test.py | 110 | ||||
-rw-r--r-- | sources/pyside6/tests/QtWidgets/qstring_qkeysequence_test.py | 69 |
12 files changed, 17 insertions, 1247 deletions
diff --git a/sources/pyside6/tests/QtWidgets/CMakeLists.txt b/sources/pyside6/tests/QtWidgets/CMakeLists.txt index 5ec056a26..8978df9a4 100644 --- a/sources/pyside6/tests/QtWidgets/CMakeLists.txt +++ b/sources/pyside6/tests/QtWidgets/CMakeLists.txt @@ -7,7 +7,6 @@ PYSIDE_TEST(application_test.py) PYSIDE_TEST(bug_172.py) PYSIDE_TEST(bug_243.py) PYSIDE_TEST(bug_307.py) -PYSIDE_TEST(bug_324.py) PYSIDE_TEST(bug_338.py) PYSIDE_TEST(bug_389.py) PYSIDE_TEST(bug_400.py) @@ -15,7 +14,7 @@ PYSIDE_TEST(bug_429.py) PYSIDE_TEST(bug_430.py) PYSIDE_TEST(bug_433.py) PYSIDE_TEST(bug_467.py) -PYSIDE_TEST(bug_493.py) +PYSIDE_TEST(bug_480.py) PYSIDE_TEST(bug_512.py) PYSIDE_TEST(bug_525.py) PYSIDE_TEST(bug_546.py) @@ -43,7 +42,6 @@ PYSIDE_TEST(bug_728.py) PYSIDE_TEST(bug_736.py) PYSIDE_TEST(bug_750.py) PYSIDE_TEST(bug_778.py) -PYSIDE_TEST(bug_785.py) PYSIDE_TEST(bug_793.py) PYSIDE_TEST(bug_811.py) PYSIDE_TEST(bug_834.py) @@ -68,7 +66,6 @@ PYSIDE_TEST(bug_1006.py) PYSIDE_TEST(bug_1048.py) PYSIDE_TEST(bug_1077.py) PYSIDE_TEST(customproxywidget_test.py) -PYSIDE_TEST(event_filter_test.py) PYSIDE_TEST(grandparent_method_test.py) PYSIDE_TEST(hashabletype_test.py) PYSIDE_TEST(keep_reference_test.py) @@ -84,7 +81,6 @@ PYSIDE_TEST(qapp_issue_585.py) PYSIDE_TEST(qapp_test.py) PYSIDE_TEST(qapplication_test.py) PYSIDE_TEST(qapplication_exit_segfault_test.py) -PYSIDE_TEST(qbrush_test.py) PYSIDE_TEST(qdynamic_signal.py) # TODO: This passes, but requires manual button clicking (at least on mac) #PYSIDE_TEST(qfontdialog_test.py) @@ -94,7 +90,6 @@ PYSIDE_TEST(qgraphicsitem_isblocked_test.py) PYSIDE_TEST(qgraphicsobjectreimpl_test.py) PYSIDE_TEST(qgraphicsproxywidget_test.py) PYSIDE_TEST(qgraphicsscene_test.py) -PYSIDE_TEST(qimage_test.py) PYSIDE_TEST(qinputdialog_get_test.py) PYSIDE_TEST(qkeysequenceedit_test.py) PYSIDE_TEST(qlabel_test.py) @@ -107,14 +102,9 @@ PYSIDE_TEST(qmainwindow_test.py) PYSIDE_TEST(qmenu_test.py) PYSIDE_TEST(qmenuadd_test.py) PYSIDE_TEST(qobject_mi_test.py) -PYSIDE_TEST(qpen_test.py) PYSIDE_TEST(qpicture_test.py) -PYSIDE_TEST(qpixmap_constructor.py) PYSIDE_TEST(qpushbutton_test.py) -PYSIDE_TEST(qshortcut_test.py) PYSIDE_TEST(qsplitter_test.py) -PYSIDE_TEST(qstandarditemmodel_test.py) -PYSIDE_TEST(qstring_qkeysequence_test.py) PYSIDE_TEST(qstyle_test.py) PYSIDE_TEST(qtableview_test.py) PYSIDE_TEST(qtabwidget_test.py) diff --git a/sources/pyside6/tests/QtWidgets/bug_324.py b/sources/pyside6/tests/QtWidgets/bug_480.py index b3336923f..cd3fd1d6b 100644 --- a/sources/pyside6/tests/QtWidgets/bug_324.py +++ b/sources/pyside6/tests/QtWidgets/bug_480.py @@ -26,8 +26,6 @@ ## ############################################################################# -''' Test bug 324: http://bugs.openbossa.org/show_bug.cgi?id=324''' - import os import sys import unittest @@ -37,33 +35,30 @@ sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) from init_paths import init_test_paths init_test_paths(False) -from PySide6.QtCore import QObject, Signal -from PySide6.QtWidgets import QApplication - - -class QBug(QObject): - def __init__(self, parent=None): - QObject.__init__(self, parent) +from PySide6.QtWidgets import (QApplication, QGridLayout, QLabel, QVBoxLayout, + QWidget) - def check(self): - self.done.emit("abc") - done = Signal(str) +class BuggyWidget(QWidget): + def setup(self): + self.verticalLayout = QVBoxLayout(self) + self.gridLayout = QGridLayout() + self.lbl = QLabel(self) + self.gridLayout.addWidget(self.lbl, 0, 1, 1, 1) + # this cause a segfault during the ownership transfer + self.verticalLayout.addLayout(self.gridLayout) -class Bug324(unittest.TestCase): - - def on_done(self, val): - self.value = val +class LayoutTransferOwnerShip(unittest.TestCase): def testBug(self): app = QApplication([]) - bug = QBug() - self.value = '' - bug.done.connect(self.on_done) - bug.check() - self.assertEqual(self.value, 'abc') + w = BuggyWidget() + w.setup() + w.show() + self.assertTrue(True) if __name__ == '__main__': unittest.main() + diff --git a/sources/pyside6/tests/QtWidgets/bug_493.py b/sources/pyside6/tests/QtWidgets/bug_493.py deleted file mode 100644 index 52aae39da..000000000 --- a/sources/pyside6/tests/QtWidgets/bug_493.py +++ /dev/null @@ -1,58 +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 - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide6.QtCore import Qt, QEvent -from PySide6.QtGui import QKeyEvent, QKeySequence -from PySide6.QtWidgets import QApplication - - -class TestBug493(unittest.TestCase): - - def testIt(self): - # We need a qapp otherwise Qt will crash when trying to detect the - # current platform - app = QApplication([]) - ev1 = QKeyEvent(QEvent.KeyRelease, Qt.Key_Delete, Qt.NoModifier) - ev2 = QKeyEvent(QEvent.KeyRelease, Qt.Key_Copy, Qt.NoModifier) - ks = QKeySequence.Delete - - self.assertTrue(ev1.matches(ks)) - self.assertFalse(ev2.matches(ks)) - - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside6/tests/QtWidgets/bug_785.py b/sources/pyside6/tests/QtWidgets/bug_785.py deleted file mode 100644 index 019dbc0cb..000000000 --- a/sources/pyside6/tests/QtWidgets/bug_785.py +++ /dev/null @@ -1,67 +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 - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide6.QtCore import QItemSelection -from PySide6.QtGui import QStandardItemModel, QStandardItem -from PySide6.QtWidgets import QApplication - - -class Bug324(unittest.TestCase): - def testOperators(self): - model = QStandardItemModel() - for i in range(100): - model.appendRow(QStandardItem(f"Item: {i}")) - - first = model.index(0, 0) - second = model.index(10, 0) - third = model.index(20, 0) - fourth = model.index(30, 0) - - sel = QItemSelection(first, second) - sel2 = QItemSelection() - sel2.select(third, fourth) - - sel3 = sel + sel2 # check operator + - self.assertEqual(len(sel3), 2) - sel4 = sel - sel4 += sel2 # check operator += - self.assertEqual(len(sel4), 2) - self.assertEqual(sel4, sel3) - - -if __name__ == "__main__": - unittest.main() diff --git a/sources/pyside6/tests/QtWidgets/event_filter_test.py b/sources/pyside6/tests/QtWidgets/event_filter_test.py deleted file mode 100644 index 08ca8c7b3..000000000 --- a/sources/pyside6/tests/QtWidgets/event_filter_test.py +++ /dev/null @@ -1,76 +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 - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from helper.usesqapplication import UsesQApplication -from PySide6.QtCore import QObject, QEvent -from PySide6.QtWidgets import QWidget - - -class MyFilter(QObject): - def eventFilter(self, obj, event): - if event.type() == QEvent.KeyPress: - pass - return QObject.eventFilter(self, obj, event) - - -class EventFilter(UsesQApplication): - @unittest.skipUnless(hasattr(sys, "getrefcount"), f"{sys.implementation.name} has no refcount") - def testRefCount(self): - o = QObject() - filt = MyFilter() - o.installEventFilter(filt) - self.assertEqual(sys.getrefcount(o), 2) - - o.installEventFilter(filt) - self.assertEqual(sys.getrefcount(o), 2) - - o.removeEventFilter(filt) - self.assertEqual(sys.getrefcount(o), 2) - - def testObjectDestructorOrder(self): - w = QWidget() - filt = MyFilter() - filt.app = self.app - w.installEventFilter(filt) - w.show() - w.close() - w = None - self.assertTrue(True) - - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside6/tests/QtWidgets/qbrush_test.py b/sources/pyside6/tests/QtWidgets/qbrush_test.py deleted file mode 100644 index 2083a6c56..000000000 --- a/sources/pyside6/tests/QtWidgets/qbrush_test.py +++ /dev/null @@ -1,61 +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$ -## -############################################################################# - -'''Test cases for QBrush''' - -import os -import sys -import unittest - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide6.QtCore import Qt -from PySide6.QtGui import QColor, QBrush -from PySide6.QtWidgets import QApplication - -from helper.usesqapplication import UsesQApplication - - -class Constructor(UsesQApplication): - '''Test case for constructor of QBrush''' - - def testQColor(self): - # QBrush(QColor) constructor - color = QColor('black') - obj = QBrush(color) - self.assertEqual(obj.color(), color) - - obj = QBrush(Qt.blue) - self.assertEqual(obj.color(), Qt.blue) - - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside6/tests/QtWidgets/qimage_test.py b/sources/pyside6/tests/QtWidgets/qimage_test.py deleted file mode 100644 index 6d15d8c3e..000000000 --- a/sources/pyside6/tests/QtWidgets/qimage_test.py +++ /dev/null @@ -1,314 +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$ -## -############################################################################# - -'''Test cases for QImage''' - -import os -import sys -import unittest - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide6.QtGui import QImage -from PySide6.QtWidgets import QLabel -from helper.usesqapplication import UsesQApplication - - -xpm = [ - "27 22 206 2", - " c None", - ". c #FEFEFE", - "+ c #FFFFFF", - "@ c #F9F9F9", - "# c #ECECEC", - "$ c #D5D5D5", - "% c #A0A0A0", - "& c #767676", - "* c #525252", - "= c #484848", - "- c #4E4E4E", - "; c #555555", - "> c #545454", - ", c #5A5A5A", - "' c #4B4B4B", - ") c #4A4A4A", - "! c #4F4F4F", - "~ c #585858", - "{ c #515151", - "] c #4C4C4C", - "^ c #B1B1B1", - "/ c #FCFCFC", - "( c #FDFDFD", - "_ c #C1C1C1", - ": c #848484", - "< c #616161", - "[ c #5E5E5E", - "} c #CECECE", - "| c #E2E2E2", - "1 c #E4E4E4", - "2 c #DFDFDF", - "3 c #D2D2D2", - "4 c #D8D8D8", - "5 c #D4D4D4", - "6 c #E6E6E6", - "7 c #F1F1F1", - "8 c #838383", - "9 c #8E8E8E", - "0 c #8F8F8F", - "a c #CBCBCB", - "b c #CCCCCC", - "c c #E9E9E9", - "d c #F2F2F2", - "e c #EDEDED", - "f c #B5B5B5", - "g c #A6A6A6", - "h c #ABABAB", - "i c #BBBBBB", - "j c #B0B0B0", - "k c #EAEAEA", - "l c #6C6C6C", - "m c #BCBCBC", - "n c #F5F5F5", - "o c #FAFAFA", - "p c #B6B6B6", - "q c #F3F3F3", - "r c #CFCFCF", - "s c #FBFBFB", - "t c #CDCDCD", - "u c #DDDDDD", - "v c #999999", - "w c #F0F0F0", - "x c #2B2B2B", - "y c #C3C3C3", - "z c #A4A4A4", - "A c #D7D7D7", - "B c #E7E7E7", - "C c #6E6E6E", - "D c #9D9D9D", - "E c #BABABA", - "F c #AEAEAE", - "G c #898989", - "H c #646464", - "I c #BDBDBD", - "J c #CACACA", - "K c #2A2A2A", - "L c #212121", - "M c #B7B7B7", - "N c #F4F4F4", - "O c #737373", - "P c #828282", - "Q c #4D4D4D", - "R c #000000", - "S c #151515", - "T c #B2B2B2", - "U c #D6D6D6", - "V c #D3D3D3", - "W c #2F2F2F", - "X c #636363", - "Y c #A1A1A1", - "Z c #BFBFBF", - "` c #E0E0E0", - " . c #6A6A6A", - ".. c #050505", - "+. c #A3A3A3", - "@. c #202020", - "#. c #5F5F5F", - "$. c #B9B9B9", - "%. c #C7C7C7", - "&. c #D0D0D0", - "*. c #3E3E3E", - "=. c #666666", - "-. c #DBDBDB", - ";. c #424242", - ">. c #C2C2C2", - ",. c #1A1A1A", - "'. c #2C2C2C", - "). c #F6F6F6", - "!. c #AAAAAA", - "~. c #DCDCDC", - "{. c #2D2D2D", - "]. c #2E2E2E", - "^. c #A7A7A7", - "/. c #656565", - "(. c #333333", - "_. c #464646", - ":. c #C4C4C4", - "<. c #B8B8B8", - "[. c #292929", - "}. c #979797", - "|. c #EFEFEF", - "1. c #909090", - "2. c #8A8A8A", - "3. c #575757", - "4. c #676767", - "5. c #C5C5C5", - "6. c #7A7A7A", - "7. c #797979", - "8. c #989898", - "9. c #EEEEEE", - "0. c #707070", - "a. c #C8C8C8", - "b. c #111111", - "c. c #AFAFAF", - "d. c #474747", - "e. c #565656", - "f. c #E3E3E3", - "g. c #494949", - "h. c #5B5B5B", - "i. c #222222", - "j. c #353535", - "k. c #D9D9D9", - "l. c #0A0A0A", - "m. c #858585", - "n. c #E5E5E5", - "o. c #0E0E0E", - "p. c #9A9A9A", - "q. c #6F6F6F", - "r. c #868686", - "s. c #060606", - "t. c #1E1E1E", - "u. c #E8E8E8", - "v. c #A5A5A5", - "w. c #0D0D0D", - "x. c #030303", - "y. c #272727", - "z. c #131313", - "A. c #1F1F1F", - "B. c #757575", - "C. c #F7F7F7", - "D. c #414141", - "E. c #080808", - "F. c #6B6B6B", - "G. c #313131", - "H. c #C0C0C0", - "I. c #C9C9C9", - "J. c #0B0B0B", - "K. c #232323", - "L. c #434343", - "M. c #3D3D3D", - "N. c #282828", - "O. c #7C7C7C", - "P. c #252525", - "Q. c #3A3A3A", - "R. c #F8F8F8", - "S. c #1B1B1B", - "T. c #949494", - "U. c #3B3B3B", - "V. c #242424", - "W. c #383838", - "X. c #6D6D6D", - "Y. c #818181", - "Z. c #939393", - "`. c #9E9E9E", - " + c #929292", - ".+ c #7D7D7D", - "++ c #ADADAD", - "@+ c #DADADA", - "#+ c #919191", - "$+ c #E1E1E1", - "%+ c #BEBEBE", - "&+ c #ACACAC", - "*+ c #9C9C9C", - "=+ c #B3B3B3", - "-+ c #808080", - ";+ c #A8A8A8", - ">+ c #393939", - ",+ c #747474", - "'+ c #7F7F7F", - ")+ c #D1D1D1", - "!+ c #606060", - "~+ c #5C5C5C", - "{+ c #686868", - "]+ c #7E7E7E", - "^+ c #787878", - "/+ c #595959", - ". . . + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / . . + + ", - ". ( + _ : < [ & } | 1 2 $ 3 4 5 3 6 7 + + 8 9 + . + . ", - ". + 0 9 a ( 3 a b c d e c f g h i g j $ k + l m + . + ", - "+ 2 8 n o p | ( q r s . # t + + + u ^ v e w + x + + + ", - "+ y z . @ A k B 7 n + ( s | p 8 C D 2 E 4 + + F G + . ", - "# H I $ J G K L - M N . 2 O P Q R R S T U s s V W j + ", - "X Y Z @ o ` _ g ...+.( 4 @.#.m G $.%.7 &.X *.=.-.;.&.", - "Q >.C ,.'.} e + ).!.k + . + + . ~.{.> ].x f 7 ^./.k (.", - "_.:.4 @ <.[.}.|.1.2.+ + + >.} 4 B + ( @ _ 3.4.5.6.r 7.", - "3.8.9.~ 0.+ a.Q b.+ + c.d.#.=.$ |.b #.e.z ^ ; ^. .f.g.", - "-.h.+ i.S M + # p j.% n 9.5.k.H l.m.V ^.n.o.M + M p.q.", - "7 r.N s.1.R t.<.|.| u.v.~ w.x.E + s y.z.A.B.C.+ 5 D.q ", - ").p.2 E.0.9 F.%.O {._ @.+ + i { [ i.G.H.P I.+ s q.} + ", - ").p.6 J.R b.K.L.M.A.! b.g.K [.R M k + N.I + + >.O.+ . ", - ").8.9.N.P...R R R R E.t.W n.+ Q.R.6 @.| + . + S.+ + . ", - "n }.w T.U.B.<.i.@ Y + + U.+ c u V.= B B 7 u.W.c + . + ", - "N T.# + }.X.Y.,.8.F.8 Z.[.`. +.+}.4 ++@+O.< ~.+ ( . + ", - "d #+1 + _ ~.u.$+b $.y @+| $+%+I.&+k.h W +.9.+ ( . + . ", - "w 0 |.*+. >.<.=+++++p a.p -+;+5.k.>+,+@ + . . + . + + ", - "q '+9.R.^ I.t b %.I.)+4 $+n.I.,+ .|.+ . . . + . + + + ", - ". p !+( + + + + + + E 0. .-+8.f.+ + . . + + . + + + + ", - ". ( A ~+{+]+^+l > /+D f.c q . + . . + + . + + + + + + " -] - - -class QImageTest(UsesQApplication): - '''Test case for calling setPixel with float as argument''' - - def testQImageStringBuffer(self): - '''Test if the QImage signatures receiving string buffers exist.''' - file = Path(__file__).resolve().parent / 'sample.png' - self.assertTrue(file.is_file()) - img0 = QImage(file) - - # btw let's test the bits() method - img1 = QImage(img0.bits(), img0.width(), img0.height(), img0.format()) - self.assertEqual(img0, img1) - img2 = QImage(img0.bits(), img0.width(), img0.height(), img0.bytesPerLine(), img0.format()) - self.assertEqual(img0, img2) - - ## test scanLine method - data1 = img0.scanLine(0) - data2 = img1.scanLine(0) - self.assertEqual(data1, data2) - - def testEmptyBuffer(self): - img = QImage(bytes('', "UTF-8"), 100, 100, QImage.Format_ARGB32) - - def testEmptyStringAsBuffer(self): - img = QImage(bytes('', "UTF-8"), 100, 100, QImage.Format_ARGB32) - - def testXpmConstructor(self): - label = QLabel() - img = QImage(xpm) - self.assertFalse(img.isNull()) - self.assertEqual(img.width(), 27) - self.assertEqual(img.height(), 22) - - -if __name__ == '__main__': - unittest.main() - diff --git a/sources/pyside6/tests/QtWidgets/qpen_test.py b/sources/pyside6/tests/QtWidgets/qpen_test.py deleted file mode 100644 index 7ca73cca8..000000000 --- a/sources/pyside6/tests/QtWidgets/qpen_test.py +++ /dev/null @@ -1,84 +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 - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from helper.usesqapplication import UsesQApplication - -from PySide6.QtCore import Qt, QTimer -from PySide6.QtGui import QPen, QPainter -from PySide6.QtWidgets import QWidget - - -class Painting(QWidget): - def __init__(self): - super().__init__() - self.penFromEnum = None - self.penFromInteger = None - - def paintEvent(self, event): - painter = QPainter(self) - painter.setPen(Qt.NoPen) - self.penFromEnum = painter.pen() - painter.setPen(int(Qt.NoPen)) - self.penFromInteger = painter.pen() - # PYSIDE-535: PyPy needs an explicit end() or a context manager. - painter.end() - QTimer.singleShot(20, self.close) - - -class QPenTest(UsesQApplication): - - def testCtorWithCreatedEnums(self): - '''A simple case of QPen creation using created enums.''' - width = 0 - style = Qt.PenStyle(0) - cap = Qt.PenCapStyle(0) - join = Qt.PenJoinStyle(0) - pen = QPen(Qt.blue, width, style, cap, join) - - def testSetPenWithPenStyleEnum(self): - '''Calls QPainter.setPen with both enum and integer. Bug #511.''' - w = Painting() - w.show() - w.setWindowTitle("qpen_test") - self.app.exec() - self.assertEqual(w.penFromEnum.style(), Qt.NoPen) - self.assertEqual(w.penFromInteger.style(), Qt.SolidLine) - - -if __name__ == '__main__': - unittest.main() - diff --git a/sources/pyside6/tests/QtWidgets/qpixmap_constructor.py b/sources/pyside6/tests/QtWidgets/qpixmap_constructor.py deleted file mode 100644 index 81afc3792..000000000 --- a/sources/pyside6/tests/QtWidgets/qpixmap_constructor.py +++ /dev/null @@ -1,288 +0,0 @@ -#!/usr/bin/python - -############################################################################# -## -## 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 - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide6.QtGui import QPixmap -from PySide6.QtWidgets import QLabel - -from helper.usesqapplication import UsesQApplication - -xpm = [ - "27 22 206 2", - " c None", - ". c #FEFEFE", - "+ c #FFFFFF", - "@ c #F9F9F9", - "# c #ECECEC", - "$ c #D5D5D5", - "% c #A0A0A0", - "& c #767676", - "* c #525252", - "= c #484848", - "- c #4E4E4E", - "; c #555555", - "> c #545454", - ", c #5A5A5A", - "' c #4B4B4B", - ") c #4A4A4A", - "! c #4F4F4F", - "~ c #585858", - "{ c #515151", - "] c #4C4C4C", - "^ c #B1B1B1", - "/ c #FCFCFC", - "( c #FDFDFD", - "_ c #C1C1C1", - ": c #848484", - "< c #616161", - "[ c #5E5E5E", - "} c #CECECE", - "| c #E2E2E2", - "1 c #E4E4E4", - "2 c #DFDFDF", - "3 c #D2D2D2", - "4 c #D8D8D8", - "5 c #D4D4D4", - "6 c #E6E6E6", - "7 c #F1F1F1", - "8 c #838383", - "9 c #8E8E8E", - "0 c #8F8F8F", - "a c #CBCBCB", - "b c #CCCCCC", - "c c #E9E9E9", - "d c #F2F2F2", - "e c #EDEDED", - "f c #B5B5B5", - "g c #A6A6A6", - "h c #ABABAB", - "i c #BBBBBB", - "j c #B0B0B0", - "k c #EAEAEA", - "l c #6C6C6C", - "m c #BCBCBC", - "n c #F5F5F5", - "o c #FAFAFA", - "p c #B6B6B6", - "q c #F3F3F3", - "r c #CFCFCF", - "s c #FBFBFB", - "t c #CDCDCD", - "u c #DDDDDD", - "v c #999999", - "w c #F0F0F0", - "x c #2B2B2B", - "y c #C3C3C3", - "z c #A4A4A4", - "A c #D7D7D7", - "B c #E7E7E7", - "C c #6E6E6E", - "D c #9D9D9D", - "E c #BABABA", - "F c #AEAEAE", - "G c #898989", - "H c #646464", - "I c #BDBDBD", - "J c #CACACA", - "K c #2A2A2A", - "L c #212121", - "M c #B7B7B7", - "N c #F4F4F4", - "O c #737373", - "P c #828282", - "Q c #4D4D4D", - "R c #000000", - "S c #151515", - "T c #B2B2B2", - "U c #D6D6D6", - "V c #D3D3D3", - "W c #2F2F2F", - "X c #636363", - "Y c #A1A1A1", - "Z c #BFBFBF", - "` c #E0E0E0", - " . c #6A6A6A", - ".. c #050505", - "+. c #A3A3A3", - "@. c #202020", - "#. c #5F5F5F", - "$. c #B9B9B9", - "%. c #C7C7C7", - "&. c #D0D0D0", - "*. c #3E3E3E", - "=. c #666666", - "-. c #DBDBDB", - ";. c #424242", - ">. c #C2C2C2", - ",. c #1A1A1A", - "'. c #2C2C2C", - "). c #F6F6F6", - "!. c #AAAAAA", - "~. c #DCDCDC", - "{. c #2D2D2D", - "]. c #2E2E2E", - "^. c #A7A7A7", - "/. c #656565", - "(. c #333333", - "_. c #464646", - ":. c #C4C4C4", - "<. c #B8B8B8", - "[. c #292929", - "}. c #979797", - "|. c #EFEFEF", - "1. c #909090", - "2. c #8A8A8A", - "3. c #575757", - "4. c #676767", - "5. c #C5C5C5", - "6. c #7A7A7A", - "7. c #797979", - "8. c #989898", - "9. c #EEEEEE", - "0. c #707070", - "a. c #C8C8C8", - "b. c #111111", - "c. c #AFAFAF", - "d. c #474747", - "e. c #565656", - "f. c #E3E3E3", - "g. c #494949", - "h. c #5B5B5B", - "i. c #222222", - "j. c #353535", - "k. c #D9D9D9", - "l. c #0A0A0A", - "m. c #858585", - "n. c #E5E5E5", - "o. c #0E0E0E", - "p. c #9A9A9A", - "q. c #6F6F6F", - "r. c #868686", - "s. c #060606", - "t. c #1E1E1E", - "u. c #E8E8E8", - "v. c #A5A5A5", - "w. c #0D0D0D", - "x. c #030303", - "y. c #272727", - "z. c #131313", - "A. c #1F1F1F", - "B. c #757575", - "C. c #F7F7F7", - "D. c #414141", - "E. c #080808", - "F. c #6B6B6B", - "G. c #313131", - "H. c #C0C0C0", - "I. c #C9C9C9", - "J. c #0B0B0B", - "K. c #232323", - "L. c #434343", - "M. c #3D3D3D", - "N. c #282828", - "O. c #7C7C7C", - "P. c #252525", - "Q. c #3A3A3A", - "R. c #F8F8F8", - "S. c #1B1B1B", - "T. c #949494", - "U. c #3B3B3B", - "V. c #242424", - "W. c #383838", - "X. c #6D6D6D", - "Y. c #818181", - "Z. c #939393", - "`. c #9E9E9E", - " + c #929292", - ".+ c #7D7D7D", - "++ c #ADADAD", - "@+ c #DADADA", - "#+ c #919191", - "$+ c #E1E1E1", - "%+ c #BEBEBE", - "&+ c #ACACAC", - "*+ c #9C9C9C", - "=+ c #B3B3B3", - "-+ c #808080", - ";+ c #A8A8A8", - ">+ c #393939", - ",+ c #747474", - "'+ c #7F7F7F", - ")+ c #D1D1D1", - "!+ c #606060", - "~+ c #5C5C5C", - "{+ c #686868", - "]+ c #7E7E7E", - "^+ c #787878", - "/+ c #595959", - ". . . + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / . . + + ", - ". ( + _ : < [ & } | 1 2 $ 3 4 5 3 6 7 + + 8 9 + . + . ", - ". + 0 9 a ( 3 a b c d e c f g h i g j $ k + l m + . + ", - "+ 2 8 n o p | ( q r s . # t + + + u ^ v e w + x + + + ", - "+ y z . @ A k B 7 n + ( s | p 8 C D 2 E 4 + + F G + . ", - "# H I $ J G K L - M N . 2 O P Q R R S T U s s V W j + ", - "X Y Z @ o ` _ g ...+.( 4 @.#.m G $.%.7 &.X *.=.-.;.&.", - "Q >.C ,.'.} e + ).!.k + . + + . ~.{.> ].x f 7 ^./.k (.", - "_.:.4 @ <.[.}.|.1.2.+ + + >.} 4 B + ( @ _ 3.4.5.6.r 7.", - "3.8.9.~ 0.+ a.Q b.+ + c.d.#.=.$ |.b #.e.z ^ ; ^. .f.g.", - "-.h.+ i.S M + # p j.% n 9.5.k.H l.m.V ^.n.o.M + M p.q.", - "7 r.N s.1.R t.<.|.| u.v.~ w.x.E + s y.z.A.B.C.+ 5 D.q ", - ").p.2 E.0.9 F.%.O {._ @.+ + i { [ i.G.H.P I.+ s q.} + ", - ").p.6 J.R b.K.L.M.A.! b.g.K [.R M k + N.I + + >.O.+ . ", - ").8.9.N.P...R R R R E.t.W n.+ Q.R.6 @.| + . + S.+ + . ", - "n }.w T.U.B.<.i.@ Y + + U.+ c u V.= B B 7 u.W.c + . + ", - "N T.# + }.X.Y.,.8.F.8 Z.[.`. +.+}.4 ++@+O.< ~.+ ( . + ", - "d #+1 + _ ~.u.$+b $.y @+| $+%+I.&+k.h W +.9.+ ( . + . ", - "w 0 |.*+. >.<.=+++++p a.p -+;+5.k.>+,+@ + . . + . + + ", - "q '+9.R.^ I.t b %.I.)+4 $+n.I.,+ .|.+ . . . + . + + + ", - ". p !+( + + + + + + E 0. .-+8.f.+ + . . + + . + + + + ", - ". ( A ~+{+]+^+l > /+D f.c q . + . . + + . + + + + + + " -] - - -class QStringSequenceTest(UsesQApplication): - def testQPixmapConstructor(self): - label = QLabel() - pixmap1 = QPixmap(xpm) - self.assertFalse(pixmap1.isNull()) - self.assertEqual(pixmap1.width(), 27) - self.assertEqual(pixmap1.height(), 22) - - -if __name__ == "__main__": - unittest.main() diff --git a/sources/pyside6/tests/QtWidgets/qshortcut_test.py b/sources/pyside6/tests/QtWidgets/qshortcut_test.py deleted file mode 100644 index b9bed5a72..000000000 --- a/sources/pyside6/tests/QtWidgets/qshortcut_test.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- 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$ -## -############################################################################# - -''' Test the QShortcut constructor''' - -import os -import sys -import unittest - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide6.QtCore import Qt, QTimer -from PySide6.QtGui import QKeySequence, QShortcut -from PySide6.QtWidgets import QApplication, QWidget - - -class Foo(QWidget): - def __init__(self): - super().__init__() - self.ok = False - self.copy = False - - def slot_of_foo(self): - self.ok = True - - def slot_of_copy(self): - self.copy = True - - -class MyShortcut(QShortcut): - def __init__(self, keys, wdg, slot): - QShortcut.__init__(self, keys, wdg, slot) - - def emit_signal(self): - self.activated.emit() - - -class QAppPresence(unittest.TestCase): - - def testQShortcut(self): - self.qapp = QApplication([]) - f = Foo() - - self.sc = MyShortcut(QKeySequence(Qt.Key_Return), f, f.slot_of_foo) - self.scstd = MyShortcut(QKeySequence.Copy, f, f.slot_of_copy) - QTimer.singleShot(0, self.init) - self.qapp.exec() - self.assertEqual(f.ok, True) - self.assertEqual(f.copy, True) - - def init(self): - self.sc.emit_signal() - self.scstd.emit_signal() - self.qapp.quit() - - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside6/tests/QtWidgets/qstandarditemmodel_test.py b/sources/pyside6/tests/QtWidgets/qstandarditemmodel_test.py deleted file mode 100644 index df052544f..000000000 --- a/sources/pyside6/tests/QtWidgets/qstandarditemmodel_test.py +++ /dev/null @@ -1,110 +0,0 @@ -############################################################################# -## -## Copyright (C) 2021 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 gc -import os -import sys -import unittest - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide6.QtGui import QStandardItemModel, QStandardItem -from PySide6.QtWidgets import QWidget -from shiboken6 import Shiboken -from helper.usesqapplication import UsesQApplication - - -class QStandardItemModelTest(UsesQApplication): - - def setUp(self): - super(QStandardItemModelTest, self).setUp() - self.window = QWidget() - self.model = QStandardItemModel(0, 3, self.window) - - def tearDown(self): - del self.window - del self.model - # PYSIDE-535: Need to collect garbage in PyPy to trigger deletion - gc.collect() - super(QStandardItemModelTest, self).tearDown() - - def testInsertRow(self): - # bug #227 - self.model.insertRow(0) - - def testClear(self): - - model = QStandardItemModel() - root = model.invisibleRootItem() - model.clear() - self.assertFalse(Shiboken.isValid(root)) - - -class QStandardItemModelRef(UsesQApplication): - @unittest.skipUnless(hasattr(sys, "getrefcount"), f"{sys.implementation.name} has no refcount") - def testRefCount(self): - model = QStandardItemModel(5, 5) - items = [] - for r in range(5): - row = [] - for c in range(5): - row.append(QStandardItem(f"{r},{c}")) - self.assertEqual(sys.getrefcount(row[c]), 2) - - model.insertRow(r, row) - - for c in range(5): - ref_after = sys.getrefcount(row[c]) - # check if the ref count was incremented after insertRow - self.assertEqual(ref_after, 3) - - items.append(row) - row = None - - for r in range(3): - my_row = model.takeRow(0) - my_row = None - for c in range(5): - # only rest 1 reference - self.assertEqual(sys.getrefcount(items[r][c]), 2) - - my_i = model.item(0, 0) - # ref(my_i) + parent_ref + items list ref - self.assertEqual(sys.getrefcount(my_i), 4) - - model.clear() - # ref(my_i) - self.assertEqual(sys.getrefcount(my_i), 3) - - -if __name__ == '__main__': - unittest.main() - diff --git a/sources/pyside6/tests/QtWidgets/qstring_qkeysequence_test.py b/sources/pyside6/tests/QtWidgets/qstring_qkeysequence_test.py deleted file mode 100644 index 85ae7b65b..000000000 --- a/sources/pyside6/tests/QtWidgets/qstring_qkeysequence_test.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/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$ -## -############################################################################# - -'''Tests conversions of QString to and from QKeySequence.''' - -import os -import sys -import unittest - -from pathlib import Path -sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths -init_test_paths(False) - -from helper.usesqapplication import UsesQApplication - -from PySide6.QtGui import QAction, QKeySequence - - -class QStringQKeySequenceTest(UsesQApplication): - '''Tests conversions of QString to and from QKeySequence.''' - - def testQStringFromQKeySequence(self): - '''Creates a QString from a QKeySequence.''' - keyseq = 'Ctrl+A' - a = QKeySequence(keyseq) - self.assertEqual(a, keyseq) - - def testPythonStringAsQKeySequence(self): - '''Passes a Python string to an argument expecting a QKeySequence.''' - keyseq = 'Ctrl+A' - action = QAction(None) - action.setShortcut(keyseq) - shortcut = action.shortcut() - self.assertTrue(isinstance(shortcut, QKeySequence)) - self.assertEqual(shortcut.toString(), keyseq) - - -if __name__ == '__main__': - unittest.main() - |