Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Background-image in local file using setUserStyleSheetUrl()

Background-image in local file using setUserStyleSheetUrl()

Scheduled Pinned Locked Moved Qt WebKit
3 Posts 3 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kickoune
    wrote on last edited by
    #1

    hello, i have a project with Qt application who use QWebView to appli a CSS file.
    The server HTTP is in a µC, i want use CSS for add style (image...) in my QT application.
    i use setUserStyleSheetUrl() to apply my CSS file.

    @ui->webView->settings()->setUserStyleSheetUrl(QUrl("qrc:/CSS/CSS/style.css"));@
    it's work.
    i want store image in qt application, not on server HTTP.

    @#img {
    width:300px;
    height:300px;
    background-image: url("img.bmp");
    border:1px black solid;
    background-color: #C2C7CB;
    }@

    But background-image not work. img.bmp is next to style.css.

    i have try also to use qrc, my image is in qrc.
    i copy path or url but not work.
    @background-image: url("qrc:/CSS/CSS/img.bmp");@

    @ background-image: url(":/CSS/CSS/img.bmp");@

    Can you help me please?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vaynenick
      wrote on last edited by
      #2

      Check this one......"CSS Image Help":http://www.corelangs.com/css/text/image.html

      Hope it will help you.

      Vayne

      http://net-informations.com

      1 Reply Last reply
      0
      • T Offline
        T Offline
        ThatDude
        wrote on last edited by
        #3

        Just a suggestion - will it work with *.png or *.gif instead...
        Perhaps the plugin can't load BMP or you're missing image format plugins

        P.S. also if you're using old version (4.x) that bug probably isn't fixed yet :-)
        https://bugs.webkit.org/show_bug.cgi?id=51159

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved