View Full Version : BIG Problem with Background-image using Style Sheets

28th November 2007, 22:47
Hi. Hope someone can help.
I'm using QT Style sheets property to set a background image to my button.

min-height: 23px;
max-height: 23px;
min-width: 75px;
max-width: 75px;
background-color: transparent;
border-style: none;
background-repeat: no-repeat;
background-position: center;
background-image: url(styles/img/pics/buttons/blue.png);
color: white;
This work perfectly fine.
The problem is that my application has an autostart functionality, that when the user turn on his PC it will launch the application.
If the application is auto started the background-image property will not load. The rest of the CSS seens to load fine, but the images are missing?

What could be the problem? The path and everything is allright, the font properties are getting loaded correctly, just the image is not loading?
If I close the application and open it manually it will work and load the images.

Any help will be much appreciated :confused::confused::confused::confused:

28th November 2007, 23:10
You are using a relative path and when the application is "autostarted", the current directory is different than when it is started by clicking an icon. Use an absolute path or change the current directory to a well known directory or use Qt resources.