[PyQt] Setting image as background in QListView

Hans-Peter Jansen hpj at urpla.net
Mon Nov 22 18:23:30 GMT 2010


On Monday 22 November 2010, 18:21:21 absk82 wrote:
> Does anyone have any ideas about this?
>
> absk82 wrote:
> > For some reason, my post didn't make it through for 2 days, so
> > trying to send it through the mailing list.
> >
> > Hi,
> > I have been having some trouble setting the background image in a
> > QListView
> > using style sheets. I tried using both jpg as well as png images as
> > background. This is the stylesheet entry generated  by QtDesigner.
> > "QListView{\n"
> > "    background-image: url(:/icons/images/wood_texture_png.png);\n"
> > "}")

Did you created and included the image(s) in the resource correctly.
The PyQt examples have plenty of hmm, examples of using resources.

Hint: try to display the image with a Qlabel.. 

Pete


More information about the PyQt mailing list