[PyQt] Simple program works on Linux, doesn't work on Mac. Why?

Tom Machinski tom.machinski at gmail.com
Thu Nov 6 02:48:57 GMT 2008


The following simple program works perfectly on Linux: it renders a single
window, with a short, thick dashed line running from the top-left corner
towards the center.

On a Mac, it renders the window, but without the line. Why?

Both Linux and Mac version run on top of Qt 4.4.1 and PyQt 4.4.2. The full
source:

#!/usr/bin/env python
from PyQt4.QtGui import *
from PyQt4.QtCore import *

app = QApplication([])
widget = QWidget()

def paintEvent(event):
    p = QPainter(widget)
    p.setPen(QPen(Qt.black, 3, Qt.DashLine))
    p.drawLine(1, 1, 30, 30)
widget.paintEvent = paintEvent

widget.show()
app.exec_()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20081106/11c16430/attachment.html


More information about the PyQt mailing list