aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-04-13 19:38:07 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:11 -0300
commitaccbee8ae8c76f93f97635a3a28fa8d7f1adac84 (patch)
tree26fb27e96ae622700df727658e05ac69a5fcdd2c /tests/QtGui
parenteed7193f32218465381ddb5c0310585006674add (diff)
Fixes bug #741 - Method "qreal QTextLine::cursorToX(int*,Edge) const" missing.
Also added unit tests. http://bugs.pyside.org/show_bug.cgi?id=741
Diffstat (limited to 'tests/QtGui')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/qtextline_test.py23
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 5b4b02bce..91236afe8 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -109,6 +109,7 @@ PYSIDE_TEST(qtableview_test.py)
PYSIDE_TEST(qtabwidget_test.py)
PYSIDE_TEST(qtextedit_test.py)
PYSIDE_TEST(qtextedit_signal_test.py)
+PYSIDE_TEST(qtextline_test.py)
PYSIDE_TEST(qtoolbar_test.py)
PYSIDE_TEST(qtoolbox_test.py)
PYSIDE_TEST(qtransform_test.py)
diff --git a/tests/QtGui/qtextline_test.py b/tests/QtGui/qtextline_test.py
new file mode 100644
index 000000000..76a711e32
--- /dev/null
+++ b/tests/QtGui/qtextline_test.py
@@ -0,0 +1,23 @@
+
+import unittest
+
+from PySide.QtGui import QTextLayout
+from helper import UsesQApplication
+
+class QTextLineTest(UsesQApplication):
+
+ def testCursorToX(self):
+ textLayout = QTextLayout()
+ textLayout.beginLayout()
+ line = textLayout.createLine()
+ self.assert_(line.isValid())
+ x, cursorPos = line.cursorToX(0)
+ self.assertEqual(type(x), float)
+ self.assertEqual(type(cursorPos), int)
+ x, cursorPos = line.cursorToX(1)
+ self.assertEqual(type(x), float)
+ self.assertEqual(type(cursorPos), int)
+
+if __name__ == '__main__':
+ unittest.main()
+