Results 1 to 2 of 2

Thread: BIG Problem with Background-image using Style Sheets

  1. #1
    Join Date
    Feb 2007
    Posts
    28
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default BIG Problem with Background-image using Style Sheets

    Hi. Hope someone can help.
    I'm using QT Style sheets property to set a background image to my button.

    QPushButton#editProfileButton{
    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
    Thanks
    CJC

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: BIG Problem with Background-image using Style Sheets

    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.

Similar Threads

  1. BG image on QPushButton using style sheets??
    By JimDaniel in forum Newbie
    Replies: 2
    Last Post: 13th September 2007, 03:31
  2. problem with the back ground image
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 17th April 2006, 21:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.