I need some help. I'm using Qt with pyside and python.

I have a QGraphicsScene with a QGraphicsRectItem filled with a custom fill pattern (and also some QGraphicsSimpleText) like this:

Qt Code:
  1. rect=QtGui.QGraphicsRectItem(0,0,30,30)
  2. pix=QtGui.QPixmap('mypattern.png')
  3. brush=QtGui.QBrush(pix)
  4. rect.setBrush(brush)
To copy to clipboard, switch view to plain text mode 

The problem: this only works when the size of the PNG-Pixmap (in pixles) matches exactly the the size of the RectItem (in Scene-units), in this case the pixmap must be 30x30 pixles. On screen it looks OK, but when printed out the pixmap resolution is much to low.

So how do I get a 300x300px png pixmap into a 30x30 scene-units RectItem? I always thought thas Scene units are independent of pixles units.
QPixmap.scaled(30,30) is not solution, because it reduces the resolution, too.

Thank you for your help!