[PyQt] scene and layers

Christopher M. Nahler christopher.nahler at papermodels.at
Fri Apr 30 10:25:49 BST 2010


drawBackground works. thx for the help.

     def drawBackground(self, painter, rect):
         backgroundColor = Qt.red
         painter.setPen(QPen(backgroundColor, 1, Qt.SolidLine))
         painter.setBrush(QBrush(Qt.lightGray, Qt.SolidPattern))
         # draw frame
         painter.drawRect(0, 0, 800, 600)
         # draw grid
         for y in range(0, 601, 50):
             for x in range(0, 801, 50):
                 painter.drawRect(x-1, y-1, 3, 3)


More information about the PyQt mailing list