diff options
author | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-03-30 10:07:56 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-03-30 10:07:56 +0200 |
commit | d2be09eef06241cd4c9eb7a0ca1a993dc2355f02 (patch) | |
tree | 4cd15a74c0629e76a41b30d2e02d22e998fb509d /sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py | |
parent | ad73193e99fef8f5d1bcf095075596dca88949c1 (diff) | |
parent | d47fb98e443e3ac5cb18850b2551143c713917f0 (diff) |
Merge branch '5.14' into 5.14.2v5.14.2
Change-Id: I3f76bc2b1d401d901d6ac5bc74874b0894bf3df9
Diffstat (limited to 'sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py')
-rw-r--r-- | sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py b/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py index 1378ca8ad..111d4ebbf 100644 --- a/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py +++ b/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py @@ -39,7 +39,10 @@ init_test_paths(True) from helper.usesqapplication import UsesQApplication from testbinding import TestView from PySide2.QtCore import Qt -from PySide2.QtWidgets import QAbstractItemDelegate, QComboBox +from PySide2.QtGui import QStandardItem, QStandardItemModel +from PySide2.QtWidgets import (QAbstractItemDelegate, QComboBox, + QSpinBox, QStyledItemDelegate, + QStyleOptionViewItem, QWidget) id_text = 'This is me' @@ -83,6 +86,19 @@ class EditorCreatedByDelegateTest(UsesQApplication): self.assertEqual(editor.itemData(0, Qt.DisplayRole), id_text) editor.metaObject() + def testIntDelegate(self): + """PYSIDE-1250: When creating a QVariant, use int instead of long long + for anything that fits into a int. Verify by checking that a spin + box is created as item view editor for int.""" + item = QStandardItem() + item.setData(123123, Qt.EditRole) # <-- QVariant conversion here + model = QStandardItemModel() + model.appendRow(item) + style_option = QStyleOptionViewItem() + delegate = QStyledItemDelegate() + editor = delegate.createEditor(None, style_option, model.index(0, 0)) + self.assertEqual(type(editor), QSpinBox) + if __name__ == '__main__': unittest.main() |