[PyKDE] argument parse error with sip-snapshot-200602116 ?

Gerard Vermeulen gerard.vermeulen at grenoble.cnrs.fr
Fri Feb 17 06:00:01 GMT 2006


Hi Phil,

There is a problem with argument parsing in QPainter.drawText.

This snippet:

            print type(0)
            print type(r.top())
            print type(r.width())
            print type(painter.fontMetrics().height())
            print type(QtCore.Qt.AlignTop | QtCore.Qt.AlignHCenter)
            painter.drawText(
                0, r.top(), r.width(), painter.fontMetrics().height(),
                QtCore.Qt.AlignTop | QtCore.Qt.AlignHCenter, title)

print this:

<type 'int'>
<type 'int'>
<type 'int'>
<type 'int'>
<class 'PyQt4.QtCore.Alignment'>
Traceback (most recent call last):
  File "./CurveDemo1.py", line 102, in paintEvent
    self.drawContents(painter)
  File "./CurveDemo1.py", line 134, in drawContents
    QtCore.Qt.AlignTop | QtCore.Qt.AlignHCenter, title)
TypeError: argument 3 of QPainter.drawText() has an invalid type

Gerard




More information about the PyQt mailing list