PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 395 - QPainter.drawLines(list-of-something) fails for some overloads
: QPainter.drawLines(list-of-something) fails for some overloads
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: 0.4.1
: All All
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-09-30 18:22 EEST by Dan Halbert
Modified: 2010-11-25 17:48 EET (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Halbert 2010-09-30 18:22:20 EEST
QPainter.drawLines() has many overloads, and is supposed to take lists of
QPoint, QPointF, QLine, and QLineF. It only seems to work for lists of QLine.

Note that Bug 287 fixed these to be overloads. Formerly they were separately
named functions (QPainter.drawLinesFromPoints, etc.). I have not tested all the
changes due to bug 287 being fixed, but there may be other cases besides
QPainter.drawLines() that should be checked.

Test case:
----------------------------------
# all work in PyQt4
#from PyQt4.QtCore import *
#from PyQt4.QtGui import *
from PySide.QtCore import *
from PySide.QtGui import *

app = QApplication([])
pixmap = QPixmap(2,2)
painter = QPainter(pixmap)
painter.drawLines([QLine(QPoint(0,0), QPoint(1,1))])    # works
painter.drawLines([QPoint(0,0), QPoint(1,1)])           # fails
painter.drawLines([QPointF(0,0), QPointF(1,1)])         # fails
painter.drawLines([QLineF(QPointF(0,0), QPointF(1,1))]) # fails
painter.end()
-----------------------------------

Traceback (most recent call last):
  File "super.py", line 11, in <module>
    painter.drawLines([QPoint(0,0), QPoint(1,1)])           # fails
TypeError: 'PySide.QtGui.QPainter.drawLines' called with wrong argument types:
  PySide.QtGui.QPainter.drawLines(list)
Supported signatures:
  PySide.QtGui.QPainter.drawLines(list)
  PySide.QtGui.QPainter.drawLines(list)
  PySide.QtGui.QPainter.drawLines(list)
  PySide.QtGui.QPainter.drawLines(list)
Comment 1 Marcelo Lira 2010-10-19 17:56:04 EEST
Fixed in Shiboken/20a12c80.
Comment 2 Marcelo Lira 2010-10-19 18:26:47 EEST
Test added in PySide/e733c2b1.
Comment 3 renato filho 2010-11-25 17:48:11 EET
released on 1.0.0~beta1