Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, August 2007
what is the equivalent of Qt3 setPaletteBackgroundPixmap in Qt4


Message 1 in thread

Hi,

I have an application written in PyQt3 which uses the following code to 
set a background-pixmap for a widget.

bgpixmap = QPixmap(aus_gr_px*3*scale,aus_gr_px*3*scale)
bgp = QPainter(bgpixmap)
offset_px_x = 10
offset_px_y = 10
r y in range(3):
     for x in range(3):
         dx= top_left.x() + x*offset_px_x
         dy= top_left.y() + y*offset_px_y
         p = QPixmap()
         p.convertFromImage(image.copy(QRect(QPoint(dx,dy),rsize)))
         px = x * 30
         py = y * 30
         point = QPoint(px,py)
         rd = {}
         rd['position'] = QPoint(dx,dy) - top_left
         rd['rect'] = QRect(point,QSize(aus_gr_px,aus_gr_px))
         self.rects.append(rd)
         bgp.drawPixmap(point,p)
self.setPaletteBackgroundPixmap(bgpixmap)

What this does is draw the bgppixmap and set it as a background for the 
current widget.


In qt4 the setPaletteBackgroundPixmap is only available in Q3Widget, 
which is not available for PyQt4. So my question is, how to do this in Qt4 ?

-- 
 [ signature omitted ]