[PyQt] Re: About setting a pixmap as background

"Gustavo A. Dí­az" gustavo.diaz at gmail.com
Fri Aug 3 13:54:22 BST 2007


David Boddie escribió:
> On Friday 03 August 2007 03:56, Gustavo A. Dí­az wrote:
>
>   
>> I am afraid that didnt worked, i wrote:
>>
>>          self.centralwidget = QtGui.QWidget()
>>          palette = self.centralwidget.palette()
>>          bgPixmap = QtGui.QPixmap(":/Pixmaps/pixmaps/oc_clientBg.svg")
>>          brush = QtGui.QBrush()
>>          brush.setTexture(bgPixmap)
>>          palette.setBrush(QPalette.Background, brush)
>>          self.centralwidget.setPalette(palette)
>>
>> The app runs but no pixmap appears as BG and now debug error.
>>     
>
> You need to convert the SVG drawing to a pixmap first. One way of doing this
> is to use QSvgRenderer; another is to load the SVG file into an QIcon and
> generate a pixmap of the desired size using its pixmap() method.
>
> David
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>   
Indeed I've tested with a .png pixmaps too David...

Any way, i used a label pixmap and set it like a mask, and i have my
background.

The result of a PyQT styled app:
http://opencoffee.lnxteam.org/downloads/pub/pics/OpenCoffee-Client_DevPic.png

Thanks anyway! cheers.

-- 
/Gustavo A. Díaz/
*GDNet Projects*
www.gdnet.com.ar <http://www.gdnet.com.ar>
Gustavo A. Díaz
-------------- next part --------------
Skipped content of type multipart/related


More information about the PyQt mailing list