summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2012-01-25 15:35:14 -0300
committerPaulo Alcantara <pcacjr@gmail.com>2012-01-25 16:45:02 -0300
commit01694f57bbcdd3841b43bf0cc2df0cf2c7d5ab3f (patch)
tree0b94a56eca28fd45b3b263ace4842888afc27f8b
parent6f3792457c3c965d49f9cdc614ccbfff7b94317c (diff)
downloadpyside-01694f57bbcdd3841b43bf0cc2df0cf2c7d5ab3f.tar.gz
pyside-01694f57bbcdd3841b43bf0cc2df0cf2c7d5ab3f.tar.xz
pyside-01694f57bbcdd3841b43bf0cc2df0cf2c7d5ab3f.zip
Fix BUG #1104 - "QSettings has problems with long integers"
See http://bugs.pyside.org/show_bug.cgi?id=1104. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewed-by: Luciano Wolf <luciano.wolf@openbossa.org> Reviewed-by: Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r--PySide/QtCore/typesystem_core_common.xml2
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_1104.py18
3 files changed, 20 insertions, 1 deletions
diff --git a/PySide/QtCore/typesystem_core_common.xml b/PySide/QtCore/typesystem_core_common.xml
index b0ea23d..017547f 100644
--- a/PySide/QtCore/typesystem_core_common.xml
+++ b/PySide/QtCore/typesystem_core_common.xml
@@ -311,7 +311,7 @@
%out = %OUTTYPE(in);
</add-conversion>
<add-conversion type="PyInt">
- int in = %CONVERTTOCPP[int](%in);
+ qlonglong in = %CONVERTTOCPP[qlonglong](%in);
%out = %OUTTYPE(in);
</add-conversion>
<add-conversion type="PyLong" check="PyLong_CheckExact(%in)">
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 9e49b76..b383be4 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -27,6 +27,7 @@ PYSIDE_TEST(bug_1019.py)
PYSIDE_TEST(bug_1031.py)
PYSIDE_TEST(bug_1063.py)
PYSIDE_TEST(bug_1069.py)
+PYSIDE_TEST(bug_1104.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(classinfo_test.py)
PYSIDE_TEST(child_event_test.py)
diff --git a/tests/QtCore/bug_1104.py b/tests/QtCore/bug_1104.py
new file mode 100644
index 0000000..b985f4f
--- /dev/null
+++ b/tests/QtCore/bug_1104.py
@@ -0,0 +1,18 @@
+''' unit test for BUG #1104 '''
+
+from PySide import QtCore
+import py3kcompat as py3k
+from helper import UsesQApplication
+import unittest
+
+class QSettingsTestCase(UsesQApplication):
+ def testSetValueWithLongInts(self):
+ s = QtCore.QSettings()
+ s.setValue("test", [(py3k.unicode_('36/37'), 65824, 69888),
+ (py3k.unicode_('38/39'), 4294902272, 4294906368),
+ (py3k.unicode_('40/41'), 4294902528, 4294906624),
+ (py3k.unicode_('new'), 65824, 69888)])
+ val = s.value("test")
+
+if __name__ == "__main__":
+ unittest.main()