[PyQt] Re: About setting a pixmap as background
david at boddie.org.uk
Fri Aug 3 13:08:42 BST 2007
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()
> palette.setBrush(QPalette.Background, brush)
> 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.
More information about the PyQt