aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pysidetest/CMakeLists.txt1
-rw-r--r--tests/pysidetest/qvariant_test.py17
-rw-r--r--tests/pysidetest/testobject.h2
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/pysidetest/CMakeLists.txt b/tests/pysidetest/CMakeLists.txt
index caa5019bb..aa2411223 100644
--- a/tests/pysidetest/CMakeLists.txt
+++ b/tests/pysidetest/CMakeLists.txt
@@ -78,6 +78,7 @@ PYSIDE_TEST(delegatecreateseditor_test.py)
PYSIDE_TEST(homonymoussignalandmethod_test.py)
PYSIDE_TEST(list_signal_test.py)
PYSIDE_TEST(modelview_test.py)
+PYSIDE_TEST(qvariant_test.py)
PYSIDE_TEST(signalandnamespace_test.py)
PYSIDE_TEST(signalwithdefaultvalue_test.py)
PYSIDE_TEST(signalemissionfrompython_test.py)
diff --git a/tests/pysidetest/qvariant_test.py b/tests/pysidetest/qvariant_test.py
new file mode 100644
index 000000000..d855e2b39
--- /dev/null
+++ b/tests/pysidetest/qvariant_test.py
@@ -0,0 +1,17 @@
+import unittest
+
+from testbinding import TestObject
+from PySide.QtCore import Qt
+from PySide.QtGui import QKeySequence
+
+from helper import UsesQApplication
+
+class QVariantTest(UsesQApplication):
+
+ def testQKeySequenceQVariantOperator(self):
+ # bug #775
+ ks = QKeySequence(Qt.SHIFT, Qt.CTRL, Qt.Key_P, Qt.Key_R)
+ self.assertEqual(TestObject.checkType(ks), 76)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/pysidetest/testobject.h b/tests/pysidetest/testobject.h
index f2cdd5a2b..bfb7edd8b 100644
--- a/tests/pysidetest/testobject.h
+++ b/tests/pysidetest/testobject.h
@@ -4,6 +4,7 @@
#include <QObject>
#include <QApplication>
#include <QMetaType>
+#include <QVariant>
#ifdef pysidetest_EXPORTS
#define PYSIDE_EXPORTS 1
#endif
@@ -14,6 +15,7 @@ class PYSIDE_API TestObject : public QObject
Q_OBJECT
public:
static void createApp() { int argc=0; new QApplication(argc, 0); };
+ static int checkType(const QVariant& var) { return (int)var.type(); }
TestObject(int idValue, QObject* parent = 0) : QObject(parent), m_idValue(idValue) {}
int idValue() const { return m_idValue; }