[PyQt] StyleSheet relative path

Hugo Léveillé hugol at fastmail.net
Thu May 5 20:19:50 BST 2011


Hi

Lets say I have a styleheet and an image file in the same folder

 QTextEdit, QListView {
     background-color: white;
     background-image: url(myImage.png);
     background-attachment: scroll;
 }

I expected this to work since they are at the same level but I still
have to type the whole path like so:

 QTextEdit, QListView {
     background-color: white;
     background-image: url(/path/to/my/file/myImage.png);
     background-attachment: scroll;
 }

What would be the correct syntax to make the filename relative to the
stylesheet so that the image will load on any machine no matter the root
path

Thanks


-- 
  Hugo Léveillé
  TD Compositing, Vision Globale
  hugol at fastmail.net



More information about the PyQt mailing list