[PyQt] Got error using QPixmap.fill

Gottfried Müller gottfried.mueller at gmx.de
Thu Nov 10 09:14:47 GMT 2016


I am using PyQt 5.7 and Qt 5.7 (Manjaro distribution):

I've got this error:

Traceback (most recent call last):
   File "./testPixmapFill.py", line 27, in <module>
     main()
   File "./testPixmapFill.py", line 22, in main
     mainWindow = MainWindow()
   File "./testPixmapFill.py", line 17, in __init__
     pixmap.fill(QColor.yellow)
TypeError: fill(self, color: Union[QColor, Qt.GlobalColor, QGradient] = 
Qt.white): argument 1 has unexpected type 'builtin_function_or_method'

with the short script in the attachment. Is this my mistake? An what is 
the solution. I know I can use QPainter. But I found this fill 
possibility in the C++ documentation of QPixmap.

Gottfried





-------------- next part --------------
A non-text attachment was scrubbed...
Name: testPixmapFill.py
Type: text/x-python
Size: 512 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20161110/d0abddb3/attachment.py>


More information about the PyQt mailing list