nucleic/enaml — pull request #54 by WarrenWeckesser (2013-09-24 05:46:03+00:00)
Title: Work around a difference between PyQt4 and PySide QFont

by always calling setStyle() and setCapitalization() with arguments defined in the QFont class.

Without this change, several examples (e.g. examples/widgets/dock_area.enaml), and the test included in this PR, raise an exception because QFont.setStyle() is being called with an argument of the wrong type. For example, here's the output of running the new test:

```
$ nosetests test_q_resource_helpers.py
E
======================================================================
ERROR: test_q_resource_helpers.test_QFont_from_Font
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/warren/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/warren/gitwork/nucleic_enaml/tests/test_q_resource_helpers.py", line 17, in test_QFont_from_Font
qf = QFont_from_Font(f)
File "/home/warren/local_anaconda_enaml/lib/python2.7/site-packages/enaml-0.8.0-py2.7-linux-x86_64.egg/enaml/qt/q_resource_helpers.py", line 188, in QFont_from_Font
qfont.setStyle(font.style)
TypeError: 'PySide.QtGui.QFont.setStyle' called with wrong argument types:
PySide.QtGui.QFont.setStyle(int)
Supported signatures:
PySide.QtGui.QFont.setStyle(PySide.QtGui.QFont.Style)

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)
```